annotate armv4l/dsputil_arm.c @ 2954:43f14ef874de libavcodec

Support for samples with fft_order = 7 Fail init for unknown fft order, to prevent an array overflow Output sound high-pitched compared to binary. Sample here http://a1862.g.akamai.net/7/1862/14448/v1/esa.download.akamai.com/13452/qt/ESA_VenusExpress_110K_Stream.mov
author rtognimp
date Tue, 06 Dec 2005 17:42:16 +0000
parents 930e56f92c57
children bfabfdf9ce55
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
1 /*
fefaa96def6e arm specific code
glantau
parents:
diff changeset
2 * ARMv4L optimized DSP utils
fefaa96def6e arm specific code
glantau
parents:
diff changeset
3 * Copyright (c) 2001 Lionel Ulmer.
fefaa96def6e arm specific code
glantau
parents:
diff changeset
4 *
429
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
5 * This library is free software; you can redistribute it and/or
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
7 * License as published by the Free Software Foundation; either
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
8 * version 2 of the License, or (at your option) any later version.
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
9 *
429
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
10 * This library is distributed in the hope that it will be useful,
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
429
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
13 * Lesser General Public License for more details.
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
14 *
429
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
16 * License along with this library; if not, write to the Free Software
718a22dc121f license/copyright change
glantau
parents: 61
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
18 */
fefaa96def6e arm specific code
glantau
parents:
diff changeset
19
fefaa96def6e arm specific code
glantau
parents:
diff changeset
20 #include "../dsputil.h"
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
21 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
22 #include "ipp.h"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
23 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
24
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
25 extern void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx);
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
26
fefaa96def6e arm specific code
glantau
parents:
diff changeset
27 extern void j_rev_dct_ARM(DCTELEM *data);
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
28 extern void simple_idct_ARM(DCTELEM *data);
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
29
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
30 /* XXX: local hack */
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
31 static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
32 static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
33
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
34 void put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
35 void put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
36 void put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
37 void put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
38
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
39 void put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
40 void put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
41 void put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
42
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
43 void put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
44
2735
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
45 CALL_2X_PIXELS(put_pixels16_x2_arm , put_pixels8_x2_arm , 8)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
46 CALL_2X_PIXELS(put_pixels16_y2_arm , put_pixels8_y2_arm , 8)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
47 CALL_2X_PIXELS(put_pixels16_xy2_arm, put_pixels8_xy2_arm, 8)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
48 CALL_2X_PIXELS(put_no_rnd_pixels16_x2_arm , put_no_rnd_pixels8_x2_arm , 8)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
49 CALL_2X_PIXELS(put_no_rnd_pixels16_y2_arm , put_no_rnd_pixels8_y2_arm , 8)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
50 CALL_2X_PIXELS(put_no_rnd_pixels16_xy2_arm, put_no_rnd_pixels8_xy2_arm, 8)
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
51
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
52 static void add_pixels_clamped_ARM(short *block, unsigned char *dest, int line_size)
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
53 {
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
54 asm volatile (
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
55 "mov r10, #8 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
56
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
57 "1: \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
58
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
59 /* load dest */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
60 "ldr r4, [%1] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
61 /* block[0] and block[1]*/
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
62 "ldrsh r5, [%0] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
63 "ldrsh r7, [%0, #2] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
64 "and r6, r4, #0xFF \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
65 "and r8, r4, #0xFF00 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
66 "add r6, r5, r6 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
67 "add r8, r7, r8, lsr #8 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
68 "mvn r5, r5 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
69 "mvn r7, r7 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
70 "tst r6, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
71 "movne r6, r5, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
72 "tst r8, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
73 "movne r8, r7, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
74 "mov r9, r6 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
75 "ldrsh r5, [%0, #4] \n\t" /* moved form [A] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
76 "orr r9, r9, r8, lsl #8 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
77 /* block[2] and block[3] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
78 /* [A] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
79 "ldrsh r7, [%0, #6] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
80 "and r6, r4, #0xFF0000 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
81 "and r8, r4, #0xFF000000 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
82 "add r6, r5, r6, lsr #16 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
83 "add r8, r7, r8, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
84 "mvn r5, r5 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
85 "mvn r7, r7 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
86 "tst r6, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
87 "movne r6, r5, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
88 "tst r8, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
89 "movne r8, r7, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
90 "orr r9, r9, r6, lsl #16 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
91 "ldr r4, [%1, #4] \n\t" /* moved form [B] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
92 "orr r9, r9, r8, lsl #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
93 /* store dest */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
94 "ldrsh r5, [%0, #8] \n\t" /* moved form [C] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
95 "str r9, [%1] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
96
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
97 /* load dest */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
98 /* [B] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
99 /* block[4] and block[5] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
100 /* [C] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
101 "ldrsh r7, [%0, #10] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
102 "and r6, r4, #0xFF \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
103 "and r8, r4, #0xFF00 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
104 "add r6, r5, r6 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
105 "add r8, r7, r8, lsr #8 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
106 "mvn r5, r5 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
107 "mvn r7, r7 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
108 "tst r6, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
109 "movne r6, r5, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
110 "tst r8, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
111 "movne r8, r7, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
112 "mov r9, r6 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
113 "ldrsh r5, [%0, #12] \n\t" /* moved from [D] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
114 "orr r9, r9, r8, lsl #8 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
115 /* block[6] and block[7] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
116 /* [D] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
117 "ldrsh r7, [%0, #14] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
118 "and r6, r4, #0xFF0000 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
119 "and r8, r4, #0xFF000000 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
120 "add r6, r5, r6, lsr #16 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
121 "add r8, r7, r8, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
122 "mvn r5, r5 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
123 "mvn r7, r7 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
124 "tst r6, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
125 "movne r6, r5, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
126 "tst r8, #0x100 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
127 "movne r8, r7, lsr #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
128 "orr r9, r9, r6, lsl #16 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
129 "add %0, %0, #16 \n\t" /* moved from [E] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
130 "orr r9, r9, r8, lsl #24 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
131 "subs r10, r10, #1 \n\t" /* moved from [F] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
132 /* store dest */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
133 "str r9, [%1, #4] \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
134
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
135 /* [E] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
136 /* [F] */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
137 "add %1, %1, %2 \n\t"
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
138 "bne 1b \n\t"
2735
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
139 : "+r"(block),
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
140 "+r"(dest)
7f38814cffa1 cleanup
michael
parents: 2734
diff changeset
141 : "r"(line_size)
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
142 : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "cc", "memory" );
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
143 }
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
144
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
145 /* XXX: those functions should be suppressed ASAP when all IDCTs are
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
146 converted */
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
147 static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
148 {
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
149 j_rev_dct_ARM (block);
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
150 ff_put_pixels_clamped(block, dest, line_size);
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
151 }
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
152 static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
153 {
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
154 j_rev_dct_ARM (block);
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
155 ff_add_pixels_clamped(block, dest, line_size);
61
fefaa96def6e arm specific code
glantau
parents:
diff changeset
156 }
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
157 static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
158 {
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
159 simple_idct_ARM (block);
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
160 ff_put_pixels_clamped(block, dest, line_size);
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
161 }
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
162 static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
163 {
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
164 simple_idct_ARM (block);
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
165 ff_add_pixels_clamped(block, dest, line_size);
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
166 }
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
167 static void simple_idct_ipp(DCTELEM *block)
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
168 {
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
169 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
170 ippiDCT8x8Inv_Video_16s_C1I(block);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
171 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
172 }
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
173 static void simple_idct_ipp_put(uint8_t *dest, int line_size, DCTELEM *block)
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
174 {
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
175 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
176 ippiDCT8x8Inv_Video_16s8u_C1R(block, dest, line_size);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
177 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
178 }
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
179
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
180 void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_size);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
181
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
182 static void simple_idct_ipp_add(uint8_t *dest, int line_size, DCTELEM *block)
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
183 {
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
184 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
185 ippiDCT8x8Inv_Video_16s_C1I(block);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
186 #ifdef HAVE_IWMMXT
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
187 add_pixels_clamped_iwmmxt(block, dest, line_size);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
188 #else
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
189 add_pixels_clamped_ARM(block, dest, line_size);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
190 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
191 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
192 }
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
193
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
194 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
195 {
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
196 const int idct_algo= avctx->idct_algo;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
197
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
198 ff_put_pixels_clamped = c->put_pixels_clamped;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
199 ff_add_pixels_clamped = c->add_pixels_clamped;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
200
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
201 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
202 if(idct_algo==FF_IDCT_ARM){
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
203 #else
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
204 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_ARM){
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
205 #endif
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
206 c->idct_put= j_rev_dct_ARM_put;
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
207 c->idct_add= j_rev_dct_ARM_add;
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
208 c->idct = j_rev_dct_ARM;
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
209 c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
1347
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
210 } else if (idct_algo==FF_IDCT_SIMPLEARM){
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
211 c->idct_put= simple_idct_ARM_put;
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
212 c->idct_add= simple_idct_ARM_add;
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
213 c->idct = simple_idct_ARM;
cca26199ab17 Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents: 1324
diff changeset
214 c->idct_permutation_type= FF_NO_IDCT_PERM;
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
215 #ifdef HAVE_IPP
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
216 } else if (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_IPP){
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
217 #else
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
218 } else if (idct_algo==FF_IDCT_IPP){
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
219 #endif
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
220 c->idct_put= simple_idct_ipp_put;
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
221 c->idct_add= simple_idct_ipp_add;
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
222 c->idct = simple_idct_ipp;
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
223 c->idct_permutation_type= FF_NO_IDCT_PERM;
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
224 }
2734
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
225
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
226 /* c->put_pixels_tab[0][0] = put_pixels16_arm; */ // NG!
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
227 c->put_pixels_tab[0][1] = put_pixels16_x2_arm; //OK!
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
228 c->put_pixels_tab[0][2] = put_pixels16_y2_arm; //OK!
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
229 /* c->put_pixels_tab[0][3] = put_pixels16_xy2_arm; /\* NG *\/ */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
230 /* c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm; // ?(使われない) */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
231 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_arm; // OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
232 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_arm; //OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
233 /* c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_arm; //NG */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
234 c->put_pixels_tab[1][0] = put_pixels8_arm; //OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
235 c->put_pixels_tab[1][1] = put_pixels8_x2_arm; //OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
236 /* c->put_pixels_tab[1][2] = put_pixels8_y2_arm; //NG */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
237 /* c->put_pixels_tab[1][3] = put_pixels8_xy2_arm; //NG */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
238 c->put_no_rnd_pixels_tab[1][0] = put_pixels8_arm;//OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
239 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_arm; //OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
240 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
241 /* c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;//NG */
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
242
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
243 #ifdef HAVE_IWMMXT
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
244 dsputil_init_iwmmxt(c, avctx);
aeea63c97878 Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents: 1347
diff changeset
245 #endif
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 874
diff changeset
246 }