very tiny script to remove tabs and trailing whitespace from patches
[libav.git] / libavcodec / armv4l / dsputil_arm.c
CommitLineData
92651f67
FB
1/*
2 * ARMv4L optimized DSP utils
3 * Copyright (c) 2001 Lionel Ulmer.
4 *
ff4ec49e
FB
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
92651f67 9 *
ff4ec49e 10 * This library is distributed in the hope that it will be useful,
92651f67 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ff4ec49e
FB
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
92651f67 14 *
ff4ec49e
FB
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
92651f67
FB
18 */
19
20#include "../dsputil.h"
21
22extern void j_rev_dct_ARM(DCTELEM *data);
bd7d1ea7 23extern void simple_idct_ARM(DCTELEM *data);
92651f67 24
b0368839
MN
25/* XXX: local hack */
26static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
27static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
28
29/* XXX: those functions should be suppressed ASAP when all IDCTs are
30 converted */
bd7d1ea7 31static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
b0368839
MN
32{
33 j_rev_dct_ARM (block);
34 ff_put_pixels_clamped(block, dest, line_size);
35}
bd7d1ea7 36static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
b0368839
MN
37{
38 j_rev_dct_ARM (block);
39 ff_add_pixels_clamped(block, dest, line_size);
40}
bd7d1ea7
AB
41static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
42{
43 simple_idct_ARM (block);
44 ff_put_pixels_clamped(block, dest, line_size);
45}
46static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
47{
48 simple_idct_ARM (block);
49 ff_add_pixels_clamped(block, dest, line_size);
50}
b0368839
MN
51
52void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
92651f67 53{
b0368839
MN
54 const int idct_algo= avctx->idct_algo;
55
56 ff_put_pixels_clamped = c->put_pixels_clamped;
57 ff_add_pixels_clamped = c->add_pixels_clamped;
58
59 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_ARM){
bd7d1ea7
AB
60 c->idct_put= j_rev_dct_ARM_put;
61 c->idct_add= j_rev_dct_ARM_add;
62 c->idct = j_rev_dct_ARM;
b0368839 63 c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
bd7d1ea7
AB
64 } else if (idct_algo==FF_IDCT_SIMPLEARM){
65 c->idct_put= simple_idct_ARM_put;
66 c->idct_add= simple_idct_ARM_add;
67 c->idct = simple_idct_ARM;
68 c->idct_permutation_type= FF_NO_IDCT_PERM;
b0368839 69 }
92651f67 70}