Mercurial > libavcodec.hg
annotate vp3dsp.c @ 3914:ac5df84bc14c libavcodec
Add vorbis encoder to ffmpeg
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 06:18:02 +0000 |
parents | d8dabe4ca9be |
children | c8c591fe26f8 |
rev | line source |
---|---|
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
1 /* |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
2 * Copyright (C) 2004 the ffmpeg project |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
3 * |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
4 * This library is free software; you can redistribute it and/or |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
5 * modify it under the terms of the GNU Lesser General Public |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
6 * License as published by the Free Software Foundation; either |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
7 * version 2 of the License, or (at your option) any later version. |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
8 * |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
9 * This library is distributed in the hope that it will be useful, |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
12 * Lesser General Public License for more details. |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
13 * |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
14 * You should have received a copy of the GNU Lesser General Public |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
15 * License along with this library; if not, write to the Free Software |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2967
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
17 */ |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
18 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
19 /** |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
20 * @file vp3dsp.c |
2967 | 21 * Standard C DSP-oriented functions cribbed from the original VP3 |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
22 * source code. |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
23 */ |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
24 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
25 #include "common.h" |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
26 #include "avcodec.h" |
2024
f65d87bfdd5a
some of the warning fixes by (Michael Roitzsch <mroi at users dot sourceforge dot net>)
michael
parents:
1977
diff
changeset
|
27 #include "dsputil.h" |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
28 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
29 #define IdctAdjustBeforeShift 8 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
30 #define xC1S7 64277 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
31 #define xC2S6 60547 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
32 #define xC3S5 54491 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
33 #define xC4S4 46341 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
34 #define xC5S3 36410 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
35 #define xC6S2 25080 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
36 #define xC7S1 12785 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
37 |
3503
074c9f3d8e62
remove a few useless casts and avoid the useless t1/t2 variables
michael
parents:
3036
diff
changeset
|
38 #define M(a,b) (((a) * (b))>>16) |
074c9f3d8e62
remove a few useless casts and avoid the useless t1/t2 variables
michael
parents:
3036
diff
changeset
|
39 |
2693 | 40 static always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type) |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
41 { |
2693 | 42 int16_t *ip = input; |
43 uint8_t *cm = cropTbl + MAX_NEG_CROP; | |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
44 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
45 int A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
46 int Ed, Gd, Add, Bdd, Fd, Hd; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
47 |
2834 | 48 int i; |
2967 | 49 |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
50 /* Inverse DCT on the rows now */ |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
51 for (i = 0; i < 8; i++) { |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
52 /* Check for non-zero values */ |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
53 if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | ip[7] ) { |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
54 A = M(xC1S7, ip[1]) + M(xC7S1, ip[7]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
55 B = M(xC7S1, ip[1]) - M(xC1S7, ip[7]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
56 C = M(xC3S5, ip[3]) + M(xC5S3, ip[5]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
57 D = M(xC3S5, ip[5]) - M(xC5S3, ip[3]); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
58 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
59 Ad = M(xC4S4, (A - C)); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
60 Bd = M(xC4S4, (B - D)); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
61 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
62 Cd = A + C; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
63 Dd = B + D; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
64 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
65 E = M(xC4S4, (ip[0] + ip[4])); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
66 F = M(xC4S4, (ip[0] - ip[4])); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
67 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
68 G = M(xC2S6, ip[2]) + M(xC6S2, ip[6]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
69 H = M(xC6S2, ip[2]) - M(xC2S6, ip[6]); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
70 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
71 Ed = E - G; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
72 Gd = E + G; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
73 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
74 Add = F + Ad; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
75 Bdd = Bd - H; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
76 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
77 Fd = F - Ad; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
78 Hd = Bd + H; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
79 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
80 /* Final sequence of operations over-write original inputs. */ |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
81 ip[0] = Gd + Cd ; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
82 ip[7] = Gd - Cd ; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
83 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
84 ip[1] = Add + Hd; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
85 ip[2] = Add - Hd; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
86 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
87 ip[3] = Ed + Dd ; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
88 ip[4] = Ed - Dd ; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
89 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
90 ip[5] = Fd + Bdd; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
91 ip[6] = Fd - Bdd; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
92 } |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
93 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
94 ip += 8; /* next row */ |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
95 } |
2967 | 96 |
2693 | 97 ip = input; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
98 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
99 for ( i = 0; i < 8; i++) { |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
100 /* Check for non-zero values (bitwise or faster than ||) */ |
2693 | 101 if ( ip[1 * 8] | ip[2 * 8] | ip[3 * 8] | |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
102 ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) { |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
103 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
104 A = M(xC1S7, ip[1*8]) + M(xC7S1, ip[7*8]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
105 B = M(xC7S1, ip[1*8]) - M(xC1S7, ip[7*8]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
106 C = M(xC3S5, ip[3*8]) + M(xC5S3, ip[5*8]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
107 D = M(xC3S5, ip[5*8]) - M(xC5S3, ip[3*8]); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
108 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
109 Ad = M(xC4S4, (A - C)); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
110 Bd = M(xC4S4, (B - D)); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
111 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
112 Cd = A + C; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
113 Dd = B + D; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
114 |
3505 | 115 E = M(xC4S4, (ip[0*8] + ip[4*8])) + 8; |
116 F = M(xC4S4, (ip[0*8] - ip[4*8])) + 8; | |
117 | |
118 if(type==1){ //HACK | |
119 E += 16*128; | |
120 F += 16*128; | |
121 } | |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
122 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
123 G = M(xC2S6, ip[2*8]) + M(xC6S2, ip[6*8]); |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
124 H = M(xC6S2, ip[2*8]) - M(xC2S6, ip[6*8]); |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
125 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
126 Ed = E - G; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
127 Gd = E + G; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
128 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
129 Add = F + Ad; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
130 Bdd = Bd - H; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
131 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
132 Fd = F - Ad; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
133 Hd = Bd + H; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
134 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
135 /* Final sequence of operations over-write original inputs. */ |
2693 | 136 if(type==0){ |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
137 ip[0*8] = (Gd + Cd ) >> 4; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
138 ip[7*8] = (Gd - Cd ) >> 4; |
2967 | 139 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
140 ip[1*8] = (Add + Hd ) >> 4; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
141 ip[2*8] = (Add - Hd ) >> 4; |
2967 | 142 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
143 ip[3*8] = (Ed + Dd ) >> 4; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
144 ip[4*8] = (Ed - Dd ) >> 4; |
2967 | 145 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
146 ip[5*8] = (Fd + Bdd ) >> 4; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
147 ip[6*8] = (Fd - Bdd ) >> 4; |
2693 | 148 }else if(type==1){ |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
149 dst[0*stride] = cm[(Gd + Cd ) >> 4]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
150 dst[7*stride] = cm[(Gd - Cd ) >> 4]; |
2967 | 151 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
152 dst[1*stride] = cm[(Add + Hd ) >> 4]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
153 dst[2*stride] = cm[(Add - Hd ) >> 4]; |
2967 | 154 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
155 dst[3*stride] = cm[(Ed + Dd ) >> 4]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
156 dst[4*stride] = cm[(Ed - Dd ) >> 4]; |
2967 | 157 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
158 dst[5*stride] = cm[(Fd + Bdd ) >> 4]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
159 dst[6*stride] = cm[(Fd - Bdd ) >> 4]; |
2693 | 160 }else{ |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
161 dst[0*stride] = cm[dst[0*stride] + ((Gd + Cd ) >> 4)]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
162 dst[7*stride] = cm[dst[7*stride] + ((Gd - Cd ) >> 4)]; |
2967 | 163 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
164 dst[1*stride] = cm[dst[1*stride] + ((Add + Hd ) >> 4)]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
165 dst[2*stride] = cm[dst[2*stride] + ((Add - Hd ) >> 4)]; |
2967 | 166 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
167 dst[3*stride] = cm[dst[3*stride] + ((Ed + Dd ) >> 4)]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
168 dst[4*stride] = cm[dst[4*stride] + ((Ed - Dd ) >> 4)]; |
2967 | 169 |
3504
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
170 dst[5*stride] = cm[dst[5*stride] + ((Fd + Bdd ) >> 4)]; |
40d83cd39561
remove 166 useless underscores, and make this file valid c code as a result
michael
parents:
3503
diff
changeset
|
171 dst[6*stride] = cm[dst[6*stride] + ((Fd - Bdd ) >> 4)]; |
2693 | 172 } |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
173 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
174 } else { |
2693 | 175 if(type==0){ |
2967 | 176 ip[0*8] = |
177 ip[1*8] = | |
178 ip[2*8] = | |
179 ip[3*8] = | |
180 ip[4*8] = | |
181 ip[5*8] = | |
2693 | 182 ip[6*8] = |
183 ip[7*8] = ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20); | |
184 }else if(type==1){ | |
185 dst[0*stride]= | |
186 dst[1*stride]= | |
187 dst[2*stride]= | |
188 dst[3*stride]= | |
189 dst[4*stride]= | |
190 dst[5*stride]= | |
191 dst[6*stride]= | |
192 dst[7*stride]= 128 + ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20); | |
193 }else{ | |
194 if(ip[0*8]){ | |
195 int v= ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20); | |
196 dst[0*stride] = cm[dst[0*stride] + v]; | |
197 dst[1*stride] = cm[dst[1*stride] + v]; | |
198 dst[2*stride] = cm[dst[2*stride] + v]; | |
199 dst[3*stride] = cm[dst[3*stride] + v]; | |
200 dst[4*stride] = cm[dst[4*stride] + v]; | |
201 dst[5*stride] = cm[dst[5*stride] + v]; | |
202 dst[6*stride] = cm[dst[6*stride] + v]; | |
203 dst[7*stride] = cm[dst[7*stride] + v]; | |
204 } | |
205 } | |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
206 } |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
207 |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
208 ip++; /* next column */ |
2693 | 209 dst++; |
1866
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
210 } |
1755f959ab7f
seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff
changeset
|
211 } |
2693 | 212 |
213 void ff_vp3_idct_c(DCTELEM *block/* align 16*/){ | |
214 idct(NULL, 0, block, 0); | |
215 } | |
2967 | 216 |
2693 | 217 void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ |
218 idct(dest, line_size, block, 1); | |
219 } | |
220 | |
221 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ | |
222 idct(dest, line_size, block, 2); | |
223 } |