annotate vp3dsp.c @ 3503:074c9f3d8e62 libavcodec

remove a few useless casts and avoid the useless t1/t2 variables
author michael
date Wed, 19 Jul 2006 23:17:18 +0000
parents 0b546eab515d
children 40d83cd39561
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
42 int16_t *ip = input;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
45 int A_, B_, C_, D_, _Ad, _Bd, _Cd, _Dd, E_, F_, G_, H_;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
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
fd5d7c732c6b kill a bunch of compiler warnings
mru
parents: 2693
diff changeset
48 int i;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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] ) {
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
54 A_ = M(xC1S7, ip[1]) + M(xC7S1, ip[7]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
55 B_ = M(xC7S1, ip[1]) - M(xC1S7, ip[7]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
56 C_ = M(xC3S5, ip[3]) + M(xC5S3, ip[5]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
59 _Ad = M(xC4S4, (A_ - C_));
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
62 _Cd = A_ + C_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
63 _Dd = B_ + D_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
64
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
65 E_ = M(xC4S4, (ip[0] + ip[4]));
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
68 G_ = M(xC2S6, ip[2]) + M(xC6S2, ip[6]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
71 _Ed = E_ - G_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
72 _Gd = E_ + G_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
73
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
74 _Add = F_ + _Ad;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
75 _Bdd = _Bd - H_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
76
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
77 _Fd = F_ - _Ad;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
78 _Hd = _Bd + H_;
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. */
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
81 ip[0] = _Gd + _Cd ;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
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
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
84 ip[1] = _Add + _Hd;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
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
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
87 ip[3] = _Ed + _Dd ;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
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
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
90 ip[5] = _Fd + _Bdd;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
96
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
104 A_ = M(xC1S7, ip[1*8]) + M(xC7S1, ip[7*8]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
105 B_ = M(xC7S1, ip[1*8]) - M(xC1S7, ip[7*8]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
106 C_ = M(xC3S5, ip[3*8]) + M(xC5S3, ip[5*8]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
109 _Ad = M(xC4S4, (A_ - C_));
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
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
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
112 _Cd = A_ + C_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
113 _Dd = B_ + D_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
114
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
115 E_ = M(xC4S4, (ip[0*8] + ip[4*8]));
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
116 F_ = M(xC4S4, (ip[0*8] - ip[4*8]));
1866
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
117
3503
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
118 G_ = M(xC2S6, ip[2*8]) + M(xC6S2, ip[6*8]);
074c9f3d8e62 remove a few useless casts and avoid the useless t1/t2 variables
michael
parents: 3036
diff changeset
119 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
120
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
121 _Ed = E_ - G_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
122 _Gd = E_ + G_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
123
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
124 _Add = F_ + _Ad;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
125 _Bdd = _Bd - H_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
126
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
127 _Fd = F_ - _Ad;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
128 _Hd = _Bd + H_;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
129
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
130 if(type==1){ //HACK
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
131 _Gd += 16*128;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
132 _Add+= 16*128;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
133 _Ed += 16*128;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
134 _Fd += 16*128;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
135 }
1866
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
136 _Gd += IdctAdjustBeforeShift;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
137 _Add += IdctAdjustBeforeShift;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
138 _Ed += IdctAdjustBeforeShift;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
139 _Fd += IdctAdjustBeforeShift;
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
140
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
141 /* Final sequence of operations over-write original inputs. */
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
142 if(type==0){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
143 ip[0*8] = (_Gd + _Cd ) >> 4;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
144 ip[7*8] = (_Gd - _Cd ) >> 4;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
145
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
146 ip[1*8] = (_Add + _Hd ) >> 4;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
147 ip[2*8] = (_Add - _Hd ) >> 4;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
148
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
149 ip[3*8] = (_Ed + _Dd ) >> 4;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
150 ip[4*8] = (_Ed - _Dd ) >> 4;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
151
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
152 ip[5*8] = (_Fd + _Bdd ) >> 4;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
153 ip[6*8] = (_Fd - _Bdd ) >> 4;
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
154 }else if(type==1){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
155 dst[0*stride] = cm[(_Gd + _Cd ) >> 4];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
156 dst[7*stride] = cm[(_Gd - _Cd ) >> 4];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
157
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
158 dst[1*stride] = cm[(_Add + _Hd ) >> 4];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
159 dst[2*stride] = cm[(_Add - _Hd ) >> 4];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
160
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
161 dst[3*stride] = cm[(_Ed + _Dd ) >> 4];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
162 dst[4*stride] = cm[(_Ed - _Dd ) >> 4];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
163
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
164 dst[5*stride] = cm[(_Fd + _Bdd ) >> 4];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
165 dst[6*stride] = cm[(_Fd - _Bdd ) >> 4];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
166 }else{
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
167 dst[0*stride] = cm[dst[0*stride] + ((_Gd + _Cd ) >> 4)];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
168 dst[7*stride] = cm[dst[7*stride] + ((_Gd - _Cd ) >> 4)];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
169
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
170 dst[1*stride] = cm[dst[1*stride] + ((_Add + _Hd ) >> 4)];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
171 dst[2*stride] = cm[dst[2*stride] + ((_Add - _Hd ) >> 4)];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
172
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
173 dst[3*stride] = cm[dst[3*stride] + ((_Ed + _Dd ) >> 4)];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
174 dst[4*stride] = cm[dst[4*stride] + ((_Ed - _Dd ) >> 4)];
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
175
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
176 dst[5*stride] = cm[dst[5*stride] + ((_Fd + _Bdd ) >> 4)];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
177 dst[6*stride] = cm[dst[6*stride] + ((_Fd - _Bdd ) >> 4)];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
178 }
1866
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
179
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
180 } else {
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
181 if(type==0){
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
182 ip[0*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
183 ip[1*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
184 ip[2*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
185 ip[3*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
186 ip[4*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
187 ip[5*8] =
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
188 ip[6*8] =
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
189 ip[7*8] = ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
190 }else if(type==1){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
191 dst[0*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
192 dst[1*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
193 dst[2*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
194 dst[3*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
195 dst[4*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
196 dst[5*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
197 dst[6*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
198 dst[7*stride]= 128 + ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
199 }else{
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
200 if(ip[0*8]){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
201 int v= ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
202 dst[0*stride] = cm[dst[0*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
203 dst[1*stride] = cm[dst[1*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
204 dst[2*stride] = cm[dst[2*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
205 dst[3*stride] = cm[dst[3*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
206 dst[4*stride] = cm[dst[4*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
207 dst[5*stride] = cm[dst[5*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
208 dst[6*stride] = cm[dst[6*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
209 dst[7*stride] = cm[dst[7*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
210 }
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
211 }
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
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
214 ip++; /* next column */
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
215 dst++;
1866
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
216 }
1755f959ab7f seperated out the C-based VP3 DSP functions into a different file; also
melanson
parents:
diff changeset
217 }
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
218
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
219 void ff_vp3_idct_c(DCTELEM *block/* align 16*/){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
220 idct(NULL, 0, block, 0);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
221 }
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
222
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
223 void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
224 idct(dest, line_size, block, 1);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
225 }
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
226
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
227 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
228 idct(dest, line_size, block, 2);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
229 }