]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blob - libavcodec/vc1dsp.c
Move VC1 loop filter to DSPContext
[frescor/ffmpeg.git] / libavcodec / vc1dsp.c
1 /*
2  * VC-1 and WMV3 decoder - DSP functions
3  * Copyright (c) 2006 Konstantin Shishkov
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21
22 /**
23 * @file libavcodec/vc1dsp.c
24  * VC-1 and WMV3 decoder
25  *
26  */
27
28 #include "dsputil.h"
29
30
31 /** Apply overlap transform to horizontal edge
32 */
33 static void vc1_v_overlap_c(uint8_t* src, int stride)
34 {
35     int i;
36     int a, b, c, d;
37     int d1, d2;
38     int rnd = 1;
39     for(i = 0; i < 8; i++) {
40         a = src[-2*stride];
41         b = src[-stride];
42         c = src[0];
43         d = src[stride];
44         d1 = (a - d + 3 + rnd) >> 3;
45         d2 = (a - d + b - c + 4 - rnd) >> 3;
46
47         src[-2*stride] = a - d1;
48         src[-stride] = av_clip_uint8(b - d2);
49         src[0] = av_clip_uint8(c + d2);
50         src[stride] = d + d1;
51         src++;
52         rnd = !rnd;
53     }
54 }
55
56 /** Apply overlap transform to vertical edge
57 */
58 static void vc1_h_overlap_c(uint8_t* src, int stride)
59 {
60     int i;
61     int a, b, c, d;
62     int d1, d2;
63     int rnd = 1;
64     for(i = 0; i < 8; i++) {
65         a = src[-2];
66         b = src[-1];
67         c = src[0];
68         d = src[1];
69         d1 = (a - d + 3 + rnd) >> 3;
70         d2 = (a - d + b - c + 4 - rnd) >> 3;
71
72         src[-2] = a - d1;
73         src[-1] = av_clip_uint8(b - d2);
74         src[0] = av_clip_uint8(c + d2);
75         src[1] = d + d1;
76         src += stride;
77         rnd = !rnd;
78     }
79 }
80
81 /**
82  * VC-1 in-loop deblocking filter for one line
83  * @param src source block type
84  * @param stride block stride
85  * @param pq block quantizer
86  * @return whether other 3 pairs should be filtered or not
87  * @see 8.6
88  */
89 static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){
90     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
91
92     int a0 = (2*(src[-2*stride] - src[ 1*stride]) - 5*(src[-1*stride] - src[ 0*stride]) + 4) >> 3;
93     int a0_sign = a0 >> 31;        /* Store sign */
94     a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */
95     if(a0 < pq){
96         int a1 = FFABS((2*(src[-4*stride] - src[-1*stride]) - 5*(src[-3*stride] - src[-2*stride]) + 4) >> 3);
97         int a2 = FFABS((2*(src[ 0*stride] - src[ 3*stride]) - 5*(src[ 1*stride] - src[ 2*stride]) + 4) >> 3);
98         if(a1 < a0 || a2 < a0){
99             int clip = src[-1*stride] - src[ 0*stride];
100             int clip_sign = clip >> 31;
101             clip = ((clip ^ clip_sign) - clip_sign)>>1;
102             if(clip){
103                 int a3 = FFMIN(a1, a2);
104                 int d = 5 * (a3 - a0);
105                 int d_sign = (d >> 31);
106                 d = ((d ^ d_sign) - d_sign) >> 3;
107                 d_sign ^= a0_sign;
108
109                 if( d_sign ^ clip_sign )
110                     d = 0;
111                 else{
112                     d = FFMIN(d, clip);
113                     d = (d ^ d_sign) - d_sign;          /* Restore sign */
114                     src[-1*stride] = cm[src[-1*stride] - d];
115                     src[ 0*stride] = cm[src[ 0*stride] + d];
116                 }
117                 return 1;
118             }
119         }
120     }
121     return 0;
122 }
123
124 /**
125  * VC-1 in-loop deblocking filter
126  * @param src source block type
127  * @param step distance between horizontally adjacent elements
128  * @param stride distance between vertically adjacent elements
129  * @param len edge length to filter (4 or 8 pixels)
130  * @param pq block quantizer
131  * @see 8.6
132  */
133 static void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq)
134 {
135     int i;
136     int filt3;
137
138     for(i = 0; i < len; i += 4){
139         filt3 = vc1_filter_line(src + 2*step, stride, pq);
140         if(filt3){
141             vc1_filter_line(src + 0*step, stride, pq);
142             vc1_filter_line(src + 1*step, stride, pq);
143             vc1_filter_line(src + 3*step, stride, pq);
144         }
145         src += step * 4;
146     }
147 }
148
149 /** Do inverse transform on 8x8 block
150 */
151 static void vc1_inv_trans_8x8_c(DCTELEM block[64])
152 {
153     int i;
154     register int t1,t2,t3,t4,t5,t6,t7,t8;
155     DCTELEM *src, *dst;
156
157     src = block;
158     dst = block;
159     for(i = 0; i < 8; i++){
160         t1 = 12 * (src[0] + src[4]) + 4;
161         t2 = 12 * (src[0] - src[4]) + 4;
162         t3 = 16 * src[2] +  6 * src[6];
163         t4 =  6 * src[2] - 16 * src[6];
164
165         t5 = t1 + t3;
166         t6 = t2 + t4;
167         t7 = t2 - t4;
168         t8 = t1 - t3;
169
170         t1 = 16 * src[1] + 15 * src[3] +  9 * src[5] +  4 * src[7];
171         t2 = 15 * src[1] -  4 * src[3] - 16 * src[5] -  9 * src[7];
172         t3 =  9 * src[1] - 16 * src[3] +  4 * src[5] + 15 * src[7];
173         t4 =  4 * src[1] -  9 * src[3] + 15 * src[5] - 16 * src[7];
174
175         dst[0] = (t5 + t1) >> 3;
176         dst[1] = (t6 + t2) >> 3;
177         dst[2] = (t7 + t3) >> 3;
178         dst[3] = (t8 + t4) >> 3;
179         dst[4] = (t8 - t4) >> 3;
180         dst[5] = (t7 - t3) >> 3;
181         dst[6] = (t6 - t2) >> 3;
182         dst[7] = (t5 - t1) >> 3;
183
184         src += 8;
185         dst += 8;
186     }
187
188     src = block;
189     dst = block;
190     for(i = 0; i < 8; i++){
191         t1 = 12 * (src[ 0] + src[32]) + 64;
192         t2 = 12 * (src[ 0] - src[32]) + 64;
193         t3 = 16 * src[16] +  6 * src[48];
194         t4 =  6 * src[16] - 16 * src[48];
195
196         t5 = t1 + t3;
197         t6 = t2 + t4;
198         t7 = t2 - t4;
199         t8 = t1 - t3;
200
201         t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
202         t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
203         t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
204         t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
205
206         dst[ 0] = (t5 + t1) >> 7;
207         dst[ 8] = (t6 + t2) >> 7;
208         dst[16] = (t7 + t3) >> 7;
209         dst[24] = (t8 + t4) >> 7;
210         dst[32] = (t8 - t4 + 1) >> 7;
211         dst[40] = (t7 - t3 + 1) >> 7;
212         dst[48] = (t6 - t2 + 1) >> 7;
213         dst[56] = (t5 - t1 + 1) >> 7;
214
215         src++;
216         dst++;
217     }
218 }
219
220 /** Do inverse transform on 8x4 part of block
221 */
222 static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block)
223 {
224     int i;
225     register int t1,t2,t3,t4,t5,t6,t7,t8;
226     DCTELEM *src, *dst;
227     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
228
229     src = block;
230     dst = block;
231     for(i = 0; i < 4; i++){
232         t1 = 12 * (src[0] + src[4]) + 4;
233         t2 = 12 * (src[0] - src[4]) + 4;
234         t3 = 16 * src[2] +  6 * src[6];
235         t4 =  6 * src[2] - 16 * src[6];
236
237         t5 = t1 + t3;
238         t6 = t2 + t4;
239         t7 = t2 - t4;
240         t8 = t1 - t3;
241
242         t1 = 16 * src[1] + 15 * src[3] +  9 * src[5] +  4 * src[7];
243         t2 = 15 * src[1] -  4 * src[3] - 16 * src[5] -  9 * src[7];
244         t3 =  9 * src[1] - 16 * src[3] +  4 * src[5] + 15 * src[7];
245         t4 =  4 * src[1] -  9 * src[3] + 15 * src[5] - 16 * src[7];
246
247         dst[0] = (t5 + t1) >> 3;
248         dst[1] = (t6 + t2) >> 3;
249         dst[2] = (t7 + t3) >> 3;
250         dst[3] = (t8 + t4) >> 3;
251         dst[4] = (t8 - t4) >> 3;
252         dst[5] = (t7 - t3) >> 3;
253         dst[6] = (t6 - t2) >> 3;
254         dst[7] = (t5 - t1) >> 3;
255
256         src += 8;
257         dst += 8;
258     }
259
260     src = block;
261     for(i = 0; i < 8; i++){
262         t1 = 17 * (src[ 0] + src[16]) + 64;
263         t2 = 17 * (src[ 0] - src[16]) + 64;
264         t3 = 22 * src[ 8] + 10 * src[24];
265         t4 = 22 * src[24] - 10 * src[ 8];
266
267         dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
268         dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
269         dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
270         dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
271
272         src ++;
273         dest++;
274     }
275 }
276
277 /** Do inverse transform on 4x8 parts of block
278 */
279 static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
280 {
281     int i;
282     register int t1,t2,t3,t4,t5,t6,t7,t8;
283     DCTELEM *src, *dst;
284     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
285
286     src = block;
287     dst = block;
288     for(i = 0; i < 8; i++){
289         t1 = 17 * (src[0] + src[2]) + 4;
290         t2 = 17 * (src[0] - src[2]) + 4;
291         t3 = 22 * src[1] + 10 * src[3];
292         t4 = 22 * src[3] - 10 * src[1];
293
294         dst[0] = (t1 + t3) >> 3;
295         dst[1] = (t2 - t4) >> 3;
296         dst[2] = (t2 + t4) >> 3;
297         dst[3] = (t1 - t3) >> 3;
298
299         src += 8;
300         dst += 8;
301     }
302
303     src = block;
304     for(i = 0; i < 4; i++){
305         t1 = 12 * (src[ 0] + src[32]) + 64;
306         t2 = 12 * (src[ 0] - src[32]) + 64;
307         t3 = 16 * src[16] +  6 * src[48];
308         t4 =  6 * src[16] - 16 * src[48];
309
310         t5 = t1 + t3;
311         t6 = t2 + t4;
312         t7 = t2 - t4;
313         t8 = t1 - t3;
314
315         t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
316         t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
317         t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
318         t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
319
320         dest[0*linesize] = cm[dest[0*linesize] + ((t5 + t1) >> 7)];
321         dest[1*linesize] = cm[dest[1*linesize] + ((t6 + t2) >> 7)];
322         dest[2*linesize] = cm[dest[2*linesize] + ((t7 + t3) >> 7)];
323         dest[3*linesize] = cm[dest[3*linesize] + ((t8 + t4) >> 7)];
324         dest[4*linesize] = cm[dest[4*linesize] + ((t8 - t4 + 1) >> 7)];
325         dest[5*linesize] = cm[dest[5*linesize] + ((t7 - t3 + 1) >> 7)];
326         dest[6*linesize] = cm[dest[6*linesize] + ((t6 - t2 + 1) >> 7)];
327         dest[7*linesize] = cm[dest[7*linesize] + ((t5 - t1 + 1) >> 7)];
328
329         src ++;
330         dest++;
331     }
332 }
333
334 /** Do inverse transform on 4x4 part of block
335 */
336 static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
337 {
338     int i;
339     register int t1,t2,t3,t4;
340     DCTELEM *src, *dst;
341     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
342
343     src = block;
344     dst = block;
345     for(i = 0; i < 4; i++){
346         t1 = 17 * (src[0] + src[2]) + 4;
347         t2 = 17 * (src[0] - src[2]) + 4;
348         t3 = 22 * src[1] + 10 * src[3];
349         t4 = 22 * src[3] - 10 * src[1];
350
351         dst[0] = (t1 + t3) >> 3;
352         dst[1] = (t2 - t4) >> 3;
353         dst[2] = (t2 + t4) >> 3;
354         dst[3] = (t1 - t3) >> 3;
355
356         src += 8;
357         dst += 8;
358     }
359
360     src = block;
361     for(i = 0; i < 4; i++){
362         t1 = 17 * (src[ 0] + src[16]) + 64;
363         t2 = 17 * (src[ 0] - src[16]) + 64;
364         t3 = 22 * src[ 8] + 10 * src[24];
365         t4 = 22 * src[24] - 10 * src[ 8];
366
367         dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
368         dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
369         dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
370         dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
371
372         src ++;
373         dest++;
374     }
375 }
376
377 /* motion compensation functions */
378 /** Filter in case of 2 filters */
379 #define VC1_MSPEL_FILTER_16B(DIR, TYPE)                                 \
380 static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, int stride, int mode) \
381 {                                                                       \
382     switch(mode){                                                       \
383     case 0: /* no shift - should not occur */                           \
384         return 0;                                                       \
385     case 1: /* 1/4 shift */                                             \
386         return -4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2]; \
387     case 2: /* 1/2 shift */                                             \
388         return -src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2]; \
389     case 3: /* 3/4 shift */                                             \
390         return -3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2]; \
391     }                                                                   \
392     return 0; /* should not occur */                                    \
393 }
394
395 VC1_MSPEL_FILTER_16B(ver, uint8_t);
396 VC1_MSPEL_FILTER_16B(hor, int16_t);
397
398
399 /** Filter used to interpolate fractional pel values
400  */
401 static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r)
402 {
403     switch(mode){
404     case 0: //no shift
405         return src[0];
406     case 1: // 1/4 shift
407         return (-4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2] + 32 - r) >> 6;
408     case 2: // 1/2 shift
409         return (-src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2] + 8 - r) >> 4;
410     case 3: // 3/4 shift
411         return (-3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2] + 32 - r) >> 6;
412     }
413     return 0; //should not occur
414 }
415
416 /** Function used to do motion compensation with bicubic interpolation
417  */
418 #define VC1_MSPEL_MC(OP, OPNAME)\
419 static void OPNAME ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int hmode, int vmode, int rnd)\
420 {\
421     int     i, j;\
422 \
423     if (vmode) { /* Horizontal filter to apply */\
424         int r;\
425 \
426         if (hmode) { /* Vertical filter to apply, output to tmp */\
427             static const int shift_value[] = { 0, 5, 1, 5 };\
428             int              shift = (shift_value[hmode]+shift_value[vmode])>>1;\
429             int16_t          tmp[11*8], *tptr = tmp;\
430 \
431             r = (1<<(shift-1)) + rnd-1;\
432 \
433             src -= 1;\
434             for(j = 0; j < 8; j++) {\
435                 for(i = 0; i < 11; i++)\
436                     tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode)+r)>>shift;\
437                 src += stride;\
438                 tptr += 11;\
439             }\
440 \
441             r = 64-rnd;\
442             tptr = tmp+1;\
443             for(j = 0; j < 8; j++) {\
444                 for(i = 0; i < 8; i++)\
445                     OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode)+r)>>7);\
446                 dst += stride;\
447                 tptr += 11;\
448             }\
449 \
450             return;\
451         }\
452         else { /* No horizontal filter, output 8 lines to dst */\
453             r = 1-rnd;\
454 \
455             for(j = 0; j < 8; j++) {\
456                 for(i = 0; i < 8; i++)\
457                     OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r));\
458                 src += stride;\
459                 dst += stride;\
460             }\
461             return;\
462         }\
463     }\
464 \
465     /* Horizontal mode with no vertical mode */\
466     for(j = 0; j < 8; j++) {\
467         for(i = 0; i < 8; i++)\
468             OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd));\
469         dst += stride;\
470         src += stride;\
471     }\
472 }
473
474 #define op_put(a, b) a = av_clip_uint8(b)
475 #define op_avg(a, b) a = (a + av_clip_uint8(b) + 1) >> 1
476
477 VC1_MSPEL_MC(op_put, put_)
478 VC1_MSPEL_MC(op_avg, avg_)
479
480 /* pixel functions - really are entry points to vc1_mspel_mc */
481
482 /* this one is defined in dsputil.c */
483 void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
484 void ff_avg_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
485
486 #define PUT_VC1_MSPEL(a, b)\
487 static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
488      put_vc1_mspel_mc(dst, src, stride, a, b, rnd);                         \
489 }\
490 static void avg_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
491      avg_vc1_mspel_mc(dst, src, stride, a, b, rnd);                         \
492 }
493
494 PUT_VC1_MSPEL(1, 0)
495 PUT_VC1_MSPEL(2, 0)
496 PUT_VC1_MSPEL(3, 0)
497
498 PUT_VC1_MSPEL(0, 1)
499 PUT_VC1_MSPEL(1, 1)
500 PUT_VC1_MSPEL(2, 1)
501 PUT_VC1_MSPEL(3, 1)
502
503 PUT_VC1_MSPEL(0, 2)
504 PUT_VC1_MSPEL(1, 2)
505 PUT_VC1_MSPEL(2, 2)
506 PUT_VC1_MSPEL(3, 2)
507
508 PUT_VC1_MSPEL(0, 3)
509 PUT_VC1_MSPEL(1, 3)
510 PUT_VC1_MSPEL(2, 3)
511 PUT_VC1_MSPEL(3, 3)
512
513 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
514     dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
515     dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
516     dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
517     dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
518     dsp->vc1_h_overlap = vc1_h_overlap_c;
519     dsp->vc1_v_overlap = vc1_v_overlap_c;
520     dsp->vc1_loop_filter = vc1_loop_filter;
521
522     dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c;
523     dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;
524     dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_c;
525     dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_c;
526     dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_c;
527     dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_c;
528     dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_c;
529     dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_c;
530     dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_c;
531     dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_c;
532     dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
533     dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
534     dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
535     dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
536     dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
537     dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
538
539     dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_c;
540     dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_c;
541     dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_c;
542     dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_c;
543     dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_c;
544     dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_c;
545     dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_c;
546     dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_c;
547     dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_c;
548     dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_c;
549     dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
550     dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
551     dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
552     dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
553     dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
554     dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
555 }