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