annotate vp3dsp.c @ 3904:24e73ad62e40 libavcodec

Original Commit: r105 | ods15 | 2006-10-01 18:09:55 +0200 (Sun, 01 Oct 2006) | 2 lines slight simplification for channel coupling
author ods15
date Mon, 02 Oct 2006 06:09:30 +0000
parents d8dabe4ca9be
children c8c591fe26f8
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
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
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] ) {
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
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
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
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
115 E = M(xC4S4, (ip[0*8] + ip[4*8])) + 8;
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
116 F = M(xC4S4, (ip[0*8] - ip[4*8])) + 8;
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
117
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
118 if(type==1){ //HACK
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
119 E += 16*128;
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
120 F += 16*128;
d8dabe4ca9be avoid 4 +
michael
parents: 3504
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
175 if(type==0){
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
176 ip[0*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
177 ip[1*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
178 ip[2*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
179 ip[3*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
180 ip[4*8] =
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
181 ip[5*8] =
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
182 ip[6*8] =
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
183 ip[7*8] = ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
184 }else if(type==1){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
185 dst[0*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
186 dst[1*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
187 dst[2*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
188 dst[3*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
189 dst[4*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
190 dst[5*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
191 dst[6*stride]=
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
192 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
193 }else{
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
194 if(ip[0*8]){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
195 int v= ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
196 dst[0*stride] = cm[dst[0*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
197 dst[1*stride] = cm[dst[1*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
198 dst[2*stride] = cm[dst[2*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
199 dst[3*stride] = cm[dst[3*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
200 dst[4*stride] = cm[dst[4*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
201 dst[5*stride] = cm[dst[5*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
202 dst[6*stride] = cm[dst[6*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
203 dst[7*stride] = cm[dst[7*stride] + v];
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
204 }
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
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
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
212
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
213 void ff_vp3_idct_c(DCTELEM *block/* align 16*/){
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
214 idct(NULL, 0, block, 0);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
215 }
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2864
diff changeset
216
2693
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
217 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
218 idct(dest, line_size, block, 1);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
219 }
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
220
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
221 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
222 idct(dest, line_size, block, 2);
02925a3903b6 porting vp3 idct over to lavc idct api
michael
parents: 2692
diff changeset
223 }