annotate vc1dsp.c @ 10674:f04468776158 libavcodec

indent
author michael
date Fri, 11 Dec 2009 21:50:08 +0000
parents 7a116de63777
children bf309c7ce615
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
1 /*
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
2 * VC-1 and WMV3 decoder - DSP functions
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
3 * Copyright (c) 2006 Konstantin Shishkov
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
4 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3665
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3665
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3665
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
9 * 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: 3665
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3665
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
15 * Lesser General Public License for more details.
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
16 *
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
17 * 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: 3665
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
20 */
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
21
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
22 /**
8718
e9d9d946f213 Use full internal pathname in doxygen @file directives.
diego
parents: 8686
diff changeset
23 * @file libavcodec/vc1dsp.c
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
24 * VC-1 and WMV3 decoder
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
25 *
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
26 */
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
27
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
28 #include "dsputil.h"
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
29
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
30
4210
6f6fe05712e4 Fix comments
kostya
parents: 3947
diff changeset
31 /** Apply overlap transform to horizontal edge
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
32 */
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
33 static void vc1_v_overlap_c(uint8_t* src, int stride)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
34 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
35 int i;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
36 int a, b, c, d;
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
37 int d1, d2;
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
38 int rnd = 1;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
39 for(i = 0; i < 8; i++) {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
40 a = src[-2*stride];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
41 b = src[-stride];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
42 c = src[0];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
43 d = src[stride];
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
44 d1 = (a - d + 3 + rnd) >> 3;
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
45 d2 = (a - d + b - c + 4 - rnd) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
46
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
47 src[-2*stride] = a - d1;
8686
674acd1e7e18 fix an overflow in vc1 intra overlap filter
lorenm
parents: 6158
diff changeset
48 src[-stride] = av_clip_uint8(b - d2);
674acd1e7e18 fix an overflow in vc1 intra overlap filter
lorenm
parents: 6158
diff changeset
49 src[0] = av_clip_uint8(c + d2);
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
50 src[stride] = d + d1;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
51 src++;
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
52 rnd = !rnd;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
53 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
54 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
55
4210
6f6fe05712e4 Fix comments
kostya
parents: 3947
diff changeset
56 /** Apply overlap transform to vertical edge
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
57 */
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
58 static void vc1_h_overlap_c(uint8_t* src, int stride)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
59 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
60 int i;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
61 int a, b, c, d;
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
62 int d1, d2;
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
63 int rnd = 1;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
64 for(i = 0; i < 8; i++) {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
65 a = src[-2];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
66 b = src[-1];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
67 c = src[0];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
68 d = src[1];
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
69 d1 = (a - d + 3 + rnd) >> 3;
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
70 d2 = (a - d + b - c + 4 - rnd) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
71
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
72 src[-2] = a - d1;
8686
674acd1e7e18 fix an overflow in vc1 intra overlap filter
lorenm
parents: 6158
diff changeset
73 src[-1] = av_clip_uint8(b - d2);
674acd1e7e18 fix an overflow in vc1 intra overlap filter
lorenm
parents: 6158
diff changeset
74 src[0] = av_clip_uint8(c + d2);
4211
ff9a94fce879 Optimize overlapping
kostya
parents: 4210
diff changeset
75 src[1] = d + d1;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
76 src += stride;
4239
30b14d0f2324 Correct rounding values in overlap filtering
kostya
parents: 4211
diff changeset
77 rnd = !rnd;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
78 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
79 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
80
9442
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
81 /**
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
82 * VC-1 in-loop deblocking filter for one line
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
83 * @param src source block type
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
84 * @param stride block stride
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
85 * @param pq block quantizer
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
86 * @return whether other 3 pairs should be filtered or not
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
87 * @see 8.6
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
88 */
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
89 static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
90 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
91
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
92 int a0 = (2*(src[-2*stride] - src[ 1*stride]) - 5*(src[-1*stride] - src[ 0*stride]) + 4) >> 3;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
93 int a0_sign = a0 >> 31; /* Store sign */
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
94 a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
95 if(a0 < pq){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
96 int a1 = FFABS((2*(src[-4*stride] - src[-1*stride]) - 5*(src[-3*stride] - src[-2*stride]) + 4) >> 3);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
97 int a2 = FFABS((2*(src[ 0*stride] - src[ 3*stride]) - 5*(src[ 1*stride] - src[ 2*stride]) + 4) >> 3);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
98 if(a1 < a0 || a2 < a0){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
99 int clip = src[-1*stride] - src[ 0*stride];
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
100 int clip_sign = clip >> 31;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
101 clip = ((clip ^ clip_sign) - clip_sign)>>1;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
102 if(clip){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
103 int a3 = FFMIN(a1, a2);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
104 int d = 5 * (a3 - a0);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
105 int d_sign = (d >> 31);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
106 d = ((d ^ d_sign) - d_sign) >> 3;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
107 d_sign ^= a0_sign;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
108
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
109 if( d_sign ^ clip_sign )
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
110 d = 0;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
111 else{
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
112 d = FFMIN(d, clip);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
113 d = (d ^ d_sign) - d_sign; /* Restore sign */
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
114 src[-1*stride] = cm[src[-1*stride] - d];
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
115 src[ 0*stride] = cm[src[ 0*stride] + d];
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
116 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
117 return 1;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
118 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
119 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
120 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
121 return 0;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
122 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
123
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
124 /**
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
125 * VC-1 in-loop deblocking filter
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
126 * @param src source block type
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
127 * @param step distance between horizontally adjacent elements
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
128 * @param stride distance between vertically adjacent elements
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
129 * @param len edge length to filter (4 or 8 pixels)
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
130 * @param pq block quantizer
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
131 * @see 8.6
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
132 */
9443
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
133 static inline void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq)
9442
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
134 {
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
135 int i;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
136 int filt3;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
137
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
138 for(i = 0; i < len; i += 4){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
139 filt3 = vc1_filter_line(src + 2*step, stride, pq);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
140 if(filt3){
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
141 vc1_filter_line(src + 0*step, stride, pq);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
142 vc1_filter_line(src + 1*step, stride, pq);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
143 vc1_filter_line(src + 3*step, stride, pq);
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
144 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
145 src += step * 4;
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
146 }
a91f60938763 Move VC1 loop filter to DSPContext
conrad
parents: 9437
diff changeset
147 }
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
148
9443
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
149 static void vc1_v_loop_filter4_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
150 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
151 vc1_loop_filter(src, 1, stride, 4, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
152 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
153
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
154 static void vc1_h_loop_filter4_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
155 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
156 vc1_loop_filter(src, stride, 1, 4, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
157 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
158
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
159 static void vc1_v_loop_filter8_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
160 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
161 vc1_loop_filter(src, 1, stride, 8, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
162 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
163
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
164 static void vc1_h_loop_filter8_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
165 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
166 vc1_loop_filter(src, stride, 1, 8, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
167 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
168
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
169 static void vc1_v_loop_filter16_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
170 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
171 vc1_loop_filter(src, 1, stride, 16, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
172 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
173
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
174 static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
175 {
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
176 vc1_loop_filter(src, stride, 1, 16, pq);
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
177 }
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
178
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
179 /** Do inverse transform on 8x8 block
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
180 */
9859
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
181 static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
182 {
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
183 int i;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
184 int dc = block[0];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
185 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
186 dc = (3 * dc + 1) >> 1;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
187 dc = (3 * dc + 16) >> 5;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
188 for(i = 0; i < 8; i++){
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
189 dest[0] = cm[dest[0]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
190 dest[1] = cm[dest[1]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
191 dest[2] = cm[dest[2]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
192 dest[3] = cm[dest[3]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
193 dest[4] = cm[dest[4]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
194 dest[5] = cm[dest[5]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
195 dest[6] = cm[dest[6]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
196 dest[7] = cm[dest[7]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
197 dest += linesize;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
198 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
199 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
200
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
201 static void vc1_inv_trans_8x8_c(DCTELEM block[64])
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
202 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
203 int i;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
204 register int t1,t2,t3,t4,t5,t6,t7,t8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
205 DCTELEM *src, *dst;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
206
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
207 src = block;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
208 dst = block;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
209 for(i = 0; i < 8; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
210 t1 = 12 * (src[0] + src[4]) + 4;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
211 t2 = 12 * (src[0] - src[4]) + 4;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
212 t3 = 16 * src[2] + 6 * src[6];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
213 t4 = 6 * src[2] - 16 * src[6];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
214
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
215 t5 = t1 + t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
216 t6 = t2 + t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
217 t7 = t2 - t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
218 t8 = t1 - t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
219
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
220 t1 = 16 * src[1] + 15 * src[3] + 9 * src[5] + 4 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
221 t2 = 15 * src[1] - 4 * src[3] - 16 * src[5] - 9 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
222 t3 = 9 * src[1] - 16 * src[3] + 4 * src[5] + 15 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
223 t4 = 4 * src[1] - 9 * src[3] + 15 * src[5] - 16 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
224
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
225 dst[0] = (t5 + t1) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
226 dst[1] = (t6 + t2) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
227 dst[2] = (t7 + t3) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
228 dst[3] = (t8 + t4) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
229 dst[4] = (t8 - t4) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
230 dst[5] = (t7 - t3) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
231 dst[6] = (t6 - t2) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
232 dst[7] = (t5 - t1) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
233
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
234 src += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
235 dst += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
236 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
237
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
238 src = block;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
239 dst = block;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
240 for(i = 0; i < 8; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
241 t1 = 12 * (src[ 0] + src[32]) + 64;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
242 t2 = 12 * (src[ 0] - src[32]) + 64;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
243 t3 = 16 * src[16] + 6 * src[48];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
244 t4 = 6 * src[16] - 16 * src[48];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
245
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
246 t5 = t1 + t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
247 t6 = t2 + t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
248 t7 = t2 - t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
249 t8 = t1 - t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
250
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
251 t1 = 16 * src[ 8] + 15 * src[24] + 9 * src[40] + 4 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
252 t2 = 15 * src[ 8] - 4 * src[24] - 16 * src[40] - 9 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
253 t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
254 t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
255
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
256 dst[ 0] = (t5 + t1) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
257 dst[ 8] = (t6 + t2) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
258 dst[16] = (t7 + t3) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
259 dst[24] = (t8 + t4) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
260 dst[32] = (t8 - t4 + 1) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
261 dst[40] = (t7 - t3 + 1) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
262 dst[48] = (t6 - t2 + 1) >> 7;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
263 dst[56] = (t5 - t1 + 1) >> 7;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
264
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
265 src++;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
266 dst++;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
267 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
268 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
269
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
270 /** Do inverse transform on 8x4 part of block
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
271 */
9859
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
272 static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
273 {
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
274 int i;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
275 int dc = block[0];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
276 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
277 dc = ( 3 * dc + 1) >> 1;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
278 dc = (17 * dc + 64) >> 7;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
279 for(i = 0; i < 4; i++){
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
280 dest[0] = cm[dest[0]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
281 dest[1] = cm[dest[1]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
282 dest[2] = cm[dest[2]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
283 dest[3] = cm[dest[3]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
284 dest[4] = cm[dest[4]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
285 dest[5] = cm[dest[5]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
286 dest[6] = cm[dest[6]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
287 dest[7] = cm[dest[7]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
288 dest += linesize;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
289 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
290 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
291
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
292 static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
293 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
294 int i;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
295 register int t1,t2,t3,t4,t5,t6,t7,t8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
296 DCTELEM *src, *dst;
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
297 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
298
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
299 src = block;
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
300 dst = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
301 for(i = 0; i < 4; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
302 t1 = 12 * (src[0] + src[4]) + 4;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
303 t2 = 12 * (src[0] - src[4]) + 4;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
304 t3 = 16 * src[2] + 6 * src[6];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
305 t4 = 6 * src[2] - 16 * src[6];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
306
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
307 t5 = t1 + t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
308 t6 = t2 + t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
309 t7 = t2 - t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
310 t8 = t1 - t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
311
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
312 t1 = 16 * src[1] + 15 * src[3] + 9 * src[5] + 4 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
313 t2 = 15 * src[1] - 4 * src[3] - 16 * src[5] - 9 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
314 t3 = 9 * src[1] - 16 * src[3] + 4 * src[5] + 15 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
315 t4 = 4 * src[1] - 9 * src[3] + 15 * src[5] - 16 * src[7];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
316
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
317 dst[0] = (t5 + t1) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
318 dst[1] = (t6 + t2) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
319 dst[2] = (t7 + t3) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
320 dst[3] = (t8 + t4) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
321 dst[4] = (t8 - t4) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
322 dst[5] = (t7 - t3) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
323 dst[6] = (t6 - t2) >> 3;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
324 dst[7] = (t5 - t1) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
325
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
326 src += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
327 dst += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
328 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
329
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
330 src = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
331 for(i = 0; i < 8; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
332 t1 = 17 * (src[ 0] + src[16]) + 64;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
333 t2 = 17 * (src[ 0] - src[16]) + 64;
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
334 t3 = 22 * src[ 8] + 10 * src[24];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
335 t4 = 22 * src[24] - 10 * src[ 8];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
336
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
337 dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
338 dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
339 dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
340 dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
341
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
342 src ++;
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
343 dest++;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
344 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
345 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
346
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
347 /** Do inverse transform on 4x8 parts of block
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
348 */
9859
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
349 static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
350 {
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
351 int i;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
352 int dc = block[0];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
353 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
354 dc = (17 * dc + 4) >> 3;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
355 dc = (12 * dc + 64) >> 7;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
356 for(i = 0; i < 8; i++){
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
357 dest[0] = cm[dest[0]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
358 dest[1] = cm[dest[1]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
359 dest[2] = cm[dest[2]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
360 dest[3] = cm[dest[3]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
361 dest += linesize;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
362 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
363 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
364
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
365 static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
366 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
367 int i;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
368 register int t1,t2,t3,t4,t5,t6,t7,t8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
369 DCTELEM *src, *dst;
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
370 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
371
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
372 src = block;
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
373 dst = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
374 for(i = 0; i < 8; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
375 t1 = 17 * (src[0] + src[2]) + 4;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
376 t2 = 17 * (src[0] - src[2]) + 4;
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
377 t3 = 22 * src[1] + 10 * src[3];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
378 t4 = 22 * src[3] - 10 * src[1];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
379
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
380 dst[0] = (t1 + t3) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
381 dst[1] = (t2 - t4) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
382 dst[2] = (t2 + t4) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
383 dst[3] = (t1 - t3) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
384
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
385 src += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
386 dst += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
387 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
388
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
389 src = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
390 for(i = 0; i < 4; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
391 t1 = 12 * (src[ 0] + src[32]) + 64;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
392 t2 = 12 * (src[ 0] - src[32]) + 64;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
393 t3 = 16 * src[16] + 6 * src[48];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
394 t4 = 6 * src[16] - 16 * src[48];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
395
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
396 t5 = t1 + t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
397 t6 = t2 + t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
398 t7 = t2 - t4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
399 t8 = t1 - t3;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
400
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
401 t1 = 16 * src[ 8] + 15 * src[24] + 9 * src[40] + 4 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
402 t2 = 15 * src[ 8] - 4 * src[24] - 16 * src[40] - 9 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
403 t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
404 t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
405
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
406 dest[0*linesize] = cm[dest[0*linesize] + ((t5 + t1) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
407 dest[1*linesize] = cm[dest[1*linesize] + ((t6 + t2) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
408 dest[2*linesize] = cm[dest[2*linesize] + ((t7 + t3) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
409 dest[3*linesize] = cm[dest[3*linesize] + ((t8 + t4) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
410 dest[4*linesize] = cm[dest[4*linesize] + ((t8 - t4 + 1) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
411 dest[5*linesize] = cm[dest[5*linesize] + ((t7 - t3 + 1) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
412 dest[6*linesize] = cm[dest[6*linesize] + ((t6 - t2 + 1) >> 7)];
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
413 dest[7*linesize] = cm[dest[7*linesize] + ((t5 - t1 + 1) >> 7)];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
414
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
415 src ++;
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
416 dest++;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
417 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
418 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
419
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
420 /** Do inverse transform on 4x4 part of block
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
421 */
9859
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
422 static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
423 {
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
424 int i;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
425 int dc = block[0];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
426 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
427 dc = (17 * dc + 4) >> 3;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
428 dc = (17 * dc + 64) >> 7;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
429 for(i = 0; i < 4; i++){
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
430 dest[0] = cm[dest[0]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
431 dest[1] = cm[dest[1]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
432 dest[2] = cm[dest[2]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
433 dest[3] = cm[dest[3]+dc];
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
434 dest += linesize;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
435 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
436 }
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
437
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
438 static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
439 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
440 int i;
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
441 register int t1,t2,t3,t4;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
442 DCTELEM *src, *dst;
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
443 const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
444
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
445 src = block;
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
446 dst = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
447 for(i = 0; i < 4; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
448 t1 = 17 * (src[0] + src[2]) + 4;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
449 t2 = 17 * (src[0] - src[2]) + 4;
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
450 t3 = 22 * src[1] + 10 * src[3];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
451 t4 = 22 * src[3] - 10 * src[1];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
452
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
453 dst[0] = (t1 + t3) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
454 dst[1] = (t2 - t4) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
455 dst[2] = (t2 + t4) >> 3;
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
456 dst[3] = (t1 - t3) >> 3;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
457
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
458 src += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
459 dst += 8;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
460 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
461
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
462 src = block;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
463 for(i = 0; i < 4; i++){
6157
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
464 t1 = 17 * (src[ 0] + src[16]) + 64;
953c8efd5298 Factor out constant addition
kostya
parents: 5997
diff changeset
465 t2 = 17 * (src[ 0] - src[16]) + 64;
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
466 t3 = 22 * src[ 8] + 10 * src[24];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
467 t4 = 22 * src[24] - 10 * src[ 8];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
468
6158
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
469 dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
470 dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
471 dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
2f43560f5dba simplify 4-point transform part a bit
kostya
parents: 6157
diff changeset
472 dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
473
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
474 src ++;
5997
90de28dfd8d6 Switch VC-1 decoder to output decoded residual immediately.
kostya
parents: 5416
diff changeset
475 dest++;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
476 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
477 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
478
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
479 /* motion compensation functions */
5416
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
480 /** Filter in case of 2 filters */
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
481 #define VC1_MSPEL_FILTER_16B(DIR, TYPE) \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
482 static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, int stride, int mode) \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
483 { \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
484 switch(mode){ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
485 case 0: /* no shift - should not occur */ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
486 return 0; \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
487 case 1: /* 1/4 shift */ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
488 return -4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2]; \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
489 case 2: /* 1/2 shift */ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
490 return -src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2]; \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
491 case 3: /* 3/4 shift */ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
492 return -3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2]; \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
493 } \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
494 return 0; /* should not occur */ \
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
495 }
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
496
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
497 VC1_MSPEL_FILTER_16B(ver, uint8_t);
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
498 VC1_MSPEL_FILTER_16B(hor, int16_t);
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
499
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
500
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
501 /** Filter used to interpolate fractional pel values
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
502 */
4283
d6f83e2f8804 rename always_inline to av_always_inline and move to common.h
mru
parents: 4239
diff changeset
503 static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
504 {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
505 switch(mode){
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
506 case 0: //no shift
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
507 return src[0];
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
508 case 1: // 1/4 shift
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
509 return (-4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2] + 32 - r) >> 6;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
510 case 2: // 1/2 shift
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
511 return (-src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2] + 8 - r) >> 4;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
512 case 3: // 3/4 shift
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
513 return (-3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2] + 32 - r) >> 6;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
514 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
515 return 0; //should not occur
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
516 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
517
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
518 /** Function used to do motion compensation with bicubic interpolation
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
519 */
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
520 #define VC1_MSPEL_MC(OP, OPNAME)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
521 static void OPNAME ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int hmode, int vmode, int rnd)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
522 {\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
523 int i, j;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
524 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
525 if (vmode) { /* Horizontal filter to apply */\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
526 int r;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
527 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
528 if (hmode) { /* Vertical filter to apply, output to tmp */\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
529 static const int shift_value[] = { 0, 5, 1, 5 };\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
530 int shift = (shift_value[hmode]+shift_value[vmode])>>1;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
531 int16_t tmp[11*8], *tptr = tmp;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
532 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
533 r = (1<<(shift-1)) + rnd-1;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
534 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
535 src -= 1;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
536 for(j = 0; j < 8; j++) {\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
537 for(i = 0; i < 11; i++)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
538 tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode)+r)>>shift;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
539 src += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
540 tptr += 11;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
541 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
542 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
543 r = 64-rnd;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
544 tptr = tmp+1;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
545 for(j = 0; j < 8; j++) {\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
546 for(i = 0; i < 8; i++)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
547 OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode)+r)>>7);\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
548 dst += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
549 tptr += 11;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
550 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
551 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
552 return;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
553 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
554 else { /* No horizontal filter, output 8 lines to dst */\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
555 r = 1-rnd;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
556 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
557 for(j = 0; j < 8; j++) {\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
558 for(i = 0; i < 8; i++)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
559 OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r));\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
560 src += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
561 dst += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
562 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
563 return;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
564 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
565 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
566 \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
567 /* Horizontal mode with no vertical mode */\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
568 for(j = 0; j < 8; j++) {\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
569 for(i = 0; i < 8; i++)\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
570 OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd));\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
571 dst += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
572 src += stride;\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
573 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
574 }
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
575
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
576 #define op_put(a, b) a = av_clip_uint8(b)
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
577 #define op_avg(a, b) a = (a + av_clip_uint8(b) + 1) >> 1
5416
90d90aecc83c Make bicubic interpolation standard compliant
kostya
parents: 5253
diff changeset
578
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
579 VC1_MSPEL_MC(op_put, put_)
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
580 VC1_MSPEL_MC(op_avg, avg_)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
581
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
582 /* pixel functions - really are entry points to vc1_mspel_mc */
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
583
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
584 /* this one is defined in dsputil.c */
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
585 void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
586 void ff_avg_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
587
5252
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
588 #define PUT_VC1_MSPEL(a, b)\
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
589 static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
590 put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
591 }\
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
592 static void avg_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
593 avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
594 }
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
595
5252
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
596 PUT_VC1_MSPEL(1, 0)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
597 PUT_VC1_MSPEL(2, 0)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
598 PUT_VC1_MSPEL(3, 0)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
599
5252
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
600 PUT_VC1_MSPEL(0, 1)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
601 PUT_VC1_MSPEL(1, 1)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
602 PUT_VC1_MSPEL(2, 1)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
603 PUT_VC1_MSPEL(3, 1)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
604
5252
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
605 PUT_VC1_MSPEL(0, 2)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
606 PUT_VC1_MSPEL(1, 2)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
607 PUT_VC1_MSPEL(2, 2)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
608 PUT_VC1_MSPEL(3, 2)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
609
5252
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
610 PUT_VC1_MSPEL(0, 3)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
611 PUT_VC1_MSPEL(1, 3)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
612 PUT_VC1_MSPEL(2, 3)
e4b9ca118ab1 Replace function declarations with macro
kostya
parents: 5251
diff changeset
613 PUT_VC1_MSPEL(3, 3)
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
614
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
615 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
616 dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
617 dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
618 dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
619 dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
9859
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
620 dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_c;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
621 dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_c;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
622 dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_c;
7a116de63777 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
darkshikari
parents: 9443
diff changeset
623 dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_c;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
624 dsp->vc1_h_overlap = vc1_h_overlap_c;
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
625 dsp->vc1_v_overlap = vc1_v_overlap_c;
9443
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
626 dsp->vc1_v_loop_filter4 = vc1_v_loop_filter4_c;
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
627 dsp->vc1_h_loop_filter4 = vc1_h_loop_filter4_c;
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
628 dsp->vc1_v_loop_filter8 = vc1_v_loop_filter8_c;
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
629 dsp->vc1_h_loop_filter8 = vc1_h_loop_filter8_c;
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
630 dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_c;
3970fe47fea3 Split VC1 loop filter into separate functions for h/v and size
conrad
parents: 9442
diff changeset
631 dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_c;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
632
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
633 dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c;
5251
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
634 dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
635 dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
636 dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
637 dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
638 dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
639 dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
640 dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
641 dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
642 dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
643 dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
644 dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
645 dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
646 dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
647 dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
f2a1fa269c12 Drop ff_ prefix for static functions
kostya
parents: 5215
diff changeset
648 dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
9437
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
649
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
650 dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
651 dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
652 dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
653 dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
654 dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
655 dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
656 dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
657 dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
658 dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
659 dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
660 dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
661 dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
662 dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
663 dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
664 dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
8aa2e86549cd VC1: Do qpel when needed for both MVs in a B frame
conrad
parents: 8718
diff changeset
665 dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
3526
7dc8e4a12105 New functions in DSPContext for VC-1 decoding
kostya
parents:
diff changeset
666 }