Mercurial > libavcodec.hg
annotate armv4l/dsputil_arm.c @ 3912:f56e6d3a1d6e libavcodec
Original Commit: r113 | ods15 | 2006-10-01 21:35:47 +0200 (Sun, 01 Oct 2006) | 2 lines
some more static consts
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 06:09:49 +0000 |
parents | cf04e15a72ac |
children | c8c591fe26f8 |
rev | line source |
---|---|
61 | 1 /* |
2 * ARMv4L optimized DSP utils | |
3 * Copyright (c) 2001 Lionel Ulmer. | |
4 * | |
429 | 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. | |
61 | 9 * |
429 | 10 * This library is distributed in the hope that it will be useful, |
61 | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
429 | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | |
61 | 14 * |
429 | 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 | |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2979
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
61 | 18 */ |
19 | |
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 | 26 |
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 | 29 |
3769 | 30 extern void simple_idct_armv5te(DCTELEM *data); |
31 extern void simple_idct_put_armv5te(uint8_t *dest, int line_size, | |
32 DCTELEM *data); | |
33 extern void simple_idct_add_armv5te(uint8_t *dest, int line_size, | |
34 DCTELEM *data); | |
35 | |
1092 | 36 /* XXX: local hack */ |
37 static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | |
38 static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | |
39 | |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
40 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
|
41 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
|
42 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
|
43 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
|
44 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
49 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
|
50 |
2735 | 51 CALL_2X_PIXELS(put_pixels16_x2_arm , put_pixels8_x2_arm , 8) |
52 CALL_2X_PIXELS(put_pixels16_y2_arm , put_pixels8_y2_arm , 8) | |
53 CALL_2X_PIXELS(put_pixels16_xy2_arm, put_pixels8_xy2_arm, 8) | |
54 CALL_2X_PIXELS(put_no_rnd_pixels16_x2_arm , put_no_rnd_pixels8_x2_arm , 8) | |
55 CALL_2X_PIXELS(put_no_rnd_pixels16_y2_arm , put_no_rnd_pixels8_y2_arm , 8) | |
56 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
|
57 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
58 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
|
59 { |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
60 asm volatile ( |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
61 "mov r10, #8 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
62 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
63 "1: \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
64 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
65 /* load dest */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
66 "ldr r4, [%1] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
67 /* block[0] and block[1]*/ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
68 "ldrsh r5, [%0] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
69 "ldrsh r7, [%0, #2] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
70 "and r6, r4, #0xFF \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
71 "and r8, r4, #0xFF00 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
72 "add r6, r5, r6 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
73 "add r8, r7, r8, lsr #8 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
74 "mvn r5, r5 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
75 "mvn r7, r7 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
76 "tst r6, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
77 "movne r6, r5, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
78 "tst r8, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
79 "movne r8, r7, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
80 "mov r9, r6 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
81 "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
|
82 "orr r9, r9, r8, lsl #8 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
83 /* block[2] and block[3] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
84 /* [A] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
85 "ldrsh r7, [%0, #6] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
86 "and r6, r4, #0xFF0000 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
87 "and r8, r4, #0xFF000000 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
88 "add r6, r5, r6, lsr #16 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
89 "add r8, r7, r8, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
90 "mvn r5, r5 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
91 "mvn r7, r7 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
92 "tst r6, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
93 "movne r6, r5, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
94 "tst r8, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
95 "movne r8, r7, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
96 "orr r9, r9, r6, lsl #16 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
97 "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
|
98 "orr r9, r9, r8, lsl #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
99 /* store dest */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
100 "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
|
101 "str r9, [%1] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
102 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
103 /* load dest */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
104 /* [B] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
105 /* block[4] and block[5] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
106 /* [C] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
107 "ldrsh r7, [%0, #10] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
108 "and r6, r4, #0xFF \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
109 "and r8, r4, #0xFF00 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
110 "add r6, r5, r6 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
111 "add r8, r7, r8, lsr #8 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
112 "mvn r5, r5 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
113 "mvn r7, r7 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
114 "tst r6, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
115 "movne r6, r5, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
116 "tst r8, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
117 "movne r8, r7, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
118 "mov r9, r6 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
119 "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
|
120 "orr r9, r9, r8, lsl #8 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
121 /* block[6] and block[7] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
122 /* [D] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
123 "ldrsh r7, [%0, #14] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
124 "and r6, r4, #0xFF0000 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
125 "and r8, r4, #0xFF000000 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
126 "add r6, r5, r6, lsr #16 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
127 "add r8, r7, r8, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
128 "mvn r5, r5 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
129 "mvn r7, r7 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
130 "tst r6, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
131 "movne r6, r5, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
132 "tst r8, #0x100 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
133 "movne r8, r7, lsr #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
134 "orr r9, r9, r6, lsl #16 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
135 "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
|
136 "orr r9, r9, r8, lsl #24 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
137 "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
|
138 /* store dest */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
139 "str r9, [%1, #4] \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
140 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
141 /* [E] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
142 /* [F] */ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
143 "add %1, %1, %2 \n\t" |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
144 "bne 1b \n\t" |
2735 | 145 : "+r"(block), |
146 "+r"(dest) | |
147 : "r"(line_size) | |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
148 : "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
|
149 } |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
150 |
1092 | 151 /* XXX: those functions should be suppressed ASAP when all IDCTs are |
152 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
|
153 static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block) |
1092 | 154 { |
155 j_rev_dct_ARM (block); | |
156 ff_put_pixels_clamped(block, dest, line_size); | |
157 } | |
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
|
158 static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block) |
61 | 159 { |
1092 | 160 j_rev_dct_ARM (block); |
161 ff_add_pixels_clamped(block, dest, line_size); | |
61 | 162 } |
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
|
163 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
|
164 { |
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 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
|
166 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
|
167 } |
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
|
168 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
|
169 { |
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
|
170 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
|
171 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
|
172 } |
3726 | 173 |
174 #ifdef HAVE_IPP | |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
175 static void simple_idct_ipp(DCTELEM *block) |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
176 { |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
177 ippiDCT8x8Inv_Video_16s_C1I(block); |
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 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
|
180 { |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
181 ippiDCT8x8Inv_Video_16s8u_C1R(block, dest, line_size); |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
182 } |
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 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
|
185 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
186 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
|
187 { |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
188 ippiDCT8x8Inv_Video_16s_C1I(block); |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
189 #ifdef HAVE_IWMMXT |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
190 add_pixels_clamped_iwmmxt(block, dest, line_size); |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
191 #else |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
192 add_pixels_clamped_ARM(block, dest, line_size); |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
193 #endif |
3726 | 194 } |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
195 #endif |
1092 | 196 |
197 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx) | |
198 { | |
3726 | 199 int idct_algo= avctx->idct_algo; |
1092 | 200 |
201 ff_put_pixels_clamped = c->put_pixels_clamped; | |
202 ff_add_pixels_clamped = c->add_pixels_clamped; | |
203 | |
3726 | 204 if(idct_algo == FF_IDCT_AUTO){ |
3769 | 205 #if defined(HAVE_IPP) |
3726 | 206 idct_algo = FF_IDCT_IPP; |
3769 | 207 #elif defined(HAVE_ARMV5TE) |
208 idct_algo = FF_IDCT_SIMPLEARMV5TE; | |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
209 #else |
3726 | 210 idct_algo = FF_IDCT_ARM; |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
211 #endif |
3726 | 212 } |
213 | |
214 if(idct_algo==FF_IDCT_ARM){ | |
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
|
215 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
|
216 c->idct_add= j_rev_dct_ARM_add; |
2979 | 217 c->idct = j_rev_dct_ARM; |
1092 | 218 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
|
219 } else if (idct_algo==FF_IDCT_SIMPLEARM){ |
2979 | 220 c->idct_put= simple_idct_ARM_put; |
221 c->idct_add= simple_idct_ARM_add; | |
222 c->idct = simple_idct_ARM; | |
223 c->idct_permutation_type= FF_NO_IDCT_PERM; | |
3769 | 224 #ifdef HAVE_ARMV5TE |
225 } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){ | |
226 c->idct_put= simple_idct_put_armv5te; | |
227 c->idct_add= simple_idct_add_armv5te; | |
228 c->idct = simple_idct_armv5te; | |
229 c->idct_permutation_type = FF_NO_IDCT_PERM; | |
230 #endif | |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
231 #ifdef HAVE_IPP |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
232 } else if (idct_algo==FF_IDCT_IPP){ |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
233 c->idct_put= simple_idct_ipp_put; |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
234 c->idct_add= simple_idct_ipp_add; |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
235 c->idct = simple_idct_ipp; |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
236 c->idct_permutation_type= FF_NO_IDCT_PERM; |
3726 | 237 #endif |
1092 | 238 } |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
239 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
240 /* 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
|
241 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
|
242 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
|
243 /* c->put_pixels_tab[0][3] = put_pixels16_xy2_arm; /\* NG *\/ */ |
3727 | 244 /* c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm; */ |
2734
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
245 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
|
246 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
|
247 /* 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
|
248 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
|
249 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
|
250 /* 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
|
251 /* 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
|
252 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
|
253 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
|
254 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
|
255 /* 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
|
256 |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
257 #ifdef HAVE_IWMMXT |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
258 dsputil_init_iwmmxt(c, avctx); |
aeea63c97878
Better ARM support for mplayer/ffmpeg, ported from atty fork
michael
parents:
1347
diff
changeset
|
259 #endif |
1092 | 260 } |