]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blob - libavcodec/vc1dsp.c
frsh: Export information about the last RTP contract and VRES
[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 inline 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 static void vc1_v_loop_filter4_c(uint8_t *src, int stride, int pq)
150 {
151     vc1_loop_filter(src, 1, stride, 4, pq);
152 }
153
154 static void vc1_h_loop_filter4_c(uint8_t *src, int stride, int pq)
155 {
156     vc1_loop_filter(src, stride, 1, 4, pq);
157 }
158
159 static void vc1_v_loop_filter8_c(uint8_t *src, int stride, int pq)
160 {
161     vc1_loop_filter(src, 1, stride, 8, pq);
162 }
163
164 static void vc1_h_loop_filter8_c(uint8_t *src, int stride, int pq)
165 {
166     vc1_loop_filter(src, stride, 1, 8, pq);
167 }
168
169 static void vc1_v_loop_filter16_c(uint8_t *src, int stride, int pq)
170 {
171     vc1_loop_filter(src, 1, stride, 16, pq);
172 }
173
174 static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
175 {
176     vc1_loop_filter(src, stride, 1, 16, pq);
177 }
178
179 /** Do inverse transform on 8x8 block
180 */
181 static void vc1_inv_trans_8x8_c(DCTELEM block[64])
182 {
183     int i;
184     register int t1,t2,t3,t4,t5,t6,t7,t8;
185     DCTELEM *src, *dst;
186
187     src = block;
188     dst = block;
189     for(i = 0; i < 8; i++){
190         t1 = 12 * (src[0] + src[4]) + 4;
191         t2 = 12 * (src[0] - src[4]) + 4;
192         t3 = 16 * src[2] +  6 * src[6];
193         t4 =  6 * src[2] - 16 * src[6];
194
195         t5 = t1 + t3;
196         t6 = t2 + t4;
197         t7 = t2 - t4;
198         t8 = t1 - t3;
199
200         t1 = 16 * src[1] + 15 * src[3] +  9 * src[5] +  4 * src[7];
201         t2 = 15 * src[1] -  4 * src[3] - 16 * src[5] -  9 * src[7];
202         t3 =  9 * src[1] - 16 * src[3] +  4 * src[5] + 15 * src[7];
203         t4 =  4 * src[1] -  9 * src[3] + 15 * src[5] - 16 * src[7];
204
205         dst[0] = (t5 + t1) >> 3;
206         dst[1] = (t6 + t2) >> 3;
207         dst[2] = (t7 + t3) >> 3;
208         dst[3] = (t8 + t4) >> 3;
209         dst[4] = (t8 - t4) >> 3;
210         dst[5] = (t7 - t3) >> 3;
211         dst[6] = (t6 - t2) >> 3;
212         dst[7] = (t5 - t1) >> 3;
213
214         src += 8;
215         dst += 8;
216     }
217
218     src = block;
219     dst = block;
220     for(i = 0; i < 8; i++){
221         t1 = 12 * (src[ 0] + src[32]) + 64;
222         t2 = 12 * (src[ 0] - src[32]) + 64;
223         t3 = 16 * src[16] +  6 * src[48];
224         t4 =  6 * src[16] - 16 * src[48];
225
226         t5 = t1 + t3;
227         t6 = t2 + t4;
228         t7 = t2 - t4;
229         t8 = t1 - t3;
230
231         t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
232         t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
233         t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
234         t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
235
236         dst[ 0] = (t5 + t1) >> 7;
237         dst[ 8] = (t6 + t2) >> 7;
238         dst[16] = (t7 + t3) >> 7;
239         dst[24] = (t8 + t4) >> 7;
240         dst[32] = (t8 - t4 + 1) >> 7;
241         dst[40] = (t7 - t3 + 1) >> 7;
242         dst[48] = (t6 - t2 + 1) >> 7;
243         dst[56] = (t5 - t1 + 1) >> 7;
244
245         src++;
246         dst++;
247     }
248 }
249
250 /** Do inverse transform on 8x4 part of block
251 */
252 static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block)
253 {
254     int i;
255     register int t1,t2,t3,t4,t5,t6,t7,t8;
256     DCTELEM *src, *dst;
257     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
258
259     src = block;
260     dst = block;
261     for(i = 0; i < 4; i++){
262         t1 = 12 * (src[0] + src[4]) + 4;
263         t2 = 12 * (src[0] - src[4]) + 4;
264         t3 = 16 * src[2] +  6 * src[6];
265         t4 =  6 * src[2] - 16 * src[6];
266
267         t5 = t1 + t3;
268         t6 = t2 + t4;
269         t7 = t2 - t4;
270         t8 = t1 - t3;
271
272         t1 = 16 * src[1] + 15 * src[3] +  9 * src[5] +  4 * src[7];
273         t2 = 15 * src[1] -  4 * src[3] - 16 * src[5] -  9 * src[7];
274         t3 =  9 * src[1] - 16 * src[3] +  4 * src[5] + 15 * src[7];
275         t4 =  4 * src[1] -  9 * src[3] + 15 * src[5] - 16 * src[7];
276
277         dst[0] = (t5 + t1) >> 3;
278         dst[1] = (t6 + t2) >> 3;
279         dst[2] = (t7 + t3) >> 3;
280         dst[3] = (t8 + t4) >> 3;
281         dst[4] = (t8 - t4) >> 3;
282         dst[5] = (t7 - t3) >> 3;
283         dst[6] = (t6 - t2) >> 3;
284         dst[7] = (t5 - t1) >> 3;
285
286         src += 8;
287         dst += 8;
288     }
289
290     src = block;
291     for(i = 0; i < 8; i++){
292         t1 = 17 * (src[ 0] + src[16]) + 64;
293         t2 = 17 * (src[ 0] - src[16]) + 64;
294         t3 = 22 * src[ 8] + 10 * src[24];
295         t4 = 22 * src[24] - 10 * src[ 8];
296
297         dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
298         dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
299         dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
300         dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
301
302         src ++;
303         dest++;
304     }
305 }
306
307 /** Do inverse transform on 4x8 parts of block
308 */
309 static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
310 {
311     int i;
312     register int t1,t2,t3,t4,t5,t6,t7,t8;
313     DCTELEM *src, *dst;
314     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
315
316     src = block;
317     dst = block;
318     for(i = 0; i < 8; i++){
319         t1 = 17 * (src[0] + src[2]) + 4;
320         t2 = 17 * (src[0] - src[2]) + 4;
321         t3 = 22 * src[1] + 10 * src[3];
322         t4 = 22 * src[3] - 10 * src[1];
323
324         dst[0] = (t1 + t3) >> 3;
325         dst[1] = (t2 - t4) >> 3;
326         dst[2] = (t2 + t4) >> 3;
327         dst[3] = (t1 - t3) >> 3;
328
329         src += 8;
330         dst += 8;
331     }
332
333     src = block;
334     for(i = 0; i < 4; i++){
335         t1 = 12 * (src[ 0] + src[32]) + 64;
336         t2 = 12 * (src[ 0] - src[32]) + 64;
337         t3 = 16 * src[16] +  6 * src[48];
338         t4 =  6 * src[16] - 16 * src[48];
339
340         t5 = t1 + t3;
341         t6 = t2 + t4;
342         t7 = t2 - t4;
343         t8 = t1 - t3;
344
345         t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
346         t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
347         t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
348         t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
349
350         dest[0*linesize] = cm[dest[0*linesize] + ((t5 + t1) >> 7)];
351         dest[1*linesize] = cm[dest[1*linesize] + ((t6 + t2) >> 7)];
352         dest[2*linesize] = cm[dest[2*linesize] + ((t7 + t3) >> 7)];
353         dest[3*linesize] = cm[dest[3*linesize] + ((t8 + t4) >> 7)];
354         dest[4*linesize] = cm[dest[4*linesize] + ((t8 - t4 + 1) >> 7)];
355         dest[5*linesize] = cm[dest[5*linesize] + ((t7 - t3 + 1) >> 7)];
356         dest[6*linesize] = cm[dest[6*linesize] + ((t6 - t2 + 1) >> 7)];
357         dest[7*linesize] = cm[dest[7*linesize] + ((t5 - t1 + 1) >> 7)];
358
359         src ++;
360         dest++;
361     }
362 }
363
364 /** Do inverse transform on 4x4 part of block
365 */
366 static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
367 {
368     int i;
369     register int t1,t2,t3,t4;
370     DCTELEM *src, *dst;
371     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
372
373     src = block;
374     dst = block;
375     for(i = 0; i < 4; i++){
376         t1 = 17 * (src[0] + src[2]) + 4;
377         t2 = 17 * (src[0] - src[2]) + 4;
378         t3 = 22 * src[1] + 10 * src[3];
379         t4 = 22 * src[3] - 10 * src[1];
380
381         dst[0] = (t1 + t3) >> 3;
382         dst[1] = (t2 - t4) >> 3;
383         dst[2] = (t2 + t4) >> 3;
384         dst[3] = (t1 - t3) >> 3;
385
386         src += 8;
387         dst += 8;
388     }
389
390     src = block;
391     for(i = 0; i < 4; i++){
392         t1 = 17 * (src[ 0] + src[16]) + 64;
393         t2 = 17 * (src[ 0] - src[16]) + 64;
394         t3 = 22 * src[ 8] + 10 * src[24];
395         t4 = 22 * src[24] - 10 * src[ 8];
396
397         dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
398         dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
399         dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
400         dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
401
402         src ++;
403         dest++;
404     }
405 }
406
407 /* motion compensation functions */
408 /** Filter in case of 2 filters */
409 #define VC1_MSPEL_FILTER_16B(DIR, TYPE)                                 \
410 static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, int stride, int mode) \
411 {                                                                       \
412     switch(mode){                                                       \
413     case 0: /* no shift - should not occur */                           \
414         return 0;                                                       \
415     case 1: /* 1/4 shift */                                             \
416         return -4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2]; \
417     case 2: /* 1/2 shift */                                             \
418         return -src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2]; \
419     case 3: /* 3/4 shift */                                             \
420         return -3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2]; \
421     }                                                                   \
422     return 0; /* should not occur */                                    \
423 }
424
425 VC1_MSPEL_FILTER_16B(ver, uint8_t);
426 VC1_MSPEL_FILTER_16B(hor, int16_t);
427
428
429 /** Filter used to interpolate fractional pel values
430  */
431 static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r)
432 {
433     switch(mode){
434     case 0: //no shift
435         return src[0];
436     case 1: // 1/4 shift
437         return (-4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2] + 32 - r) >> 6;
438     case 2: // 1/2 shift
439         return (-src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2] + 8 - r) >> 4;
440     case 3: // 3/4 shift
441         return (-3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2] + 32 - r) >> 6;
442     }
443     return 0; //should not occur
444 }
445
446 /** Function used to do motion compensation with bicubic interpolation
447  */
448 #define VC1_MSPEL_MC(OP, OPNAME)\
449 static void OPNAME ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int hmode, int vmode, int rnd)\
450 {\
451     int     i, j;\
452 \
453     if (vmode) { /* Horizontal filter to apply */\
454         int r;\
455 \
456         if (hmode) { /* Vertical filter to apply, output to tmp */\
457             static const int shift_value[] = { 0, 5, 1, 5 };\
458             int              shift = (shift_value[hmode]+shift_value[vmode])>>1;\
459             int16_t          tmp[11*8], *tptr = tmp;\
460 \
461             r = (1<<(shift-1)) + rnd-1;\
462 \
463             src -= 1;\
464             for(j = 0; j < 8; j++) {\
465                 for(i = 0; i < 11; i++)\
466                     tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode)+r)>>shift;\
467                 src += stride;\
468                 tptr += 11;\
469             }\
470 \
471             r = 64-rnd;\
472             tptr = tmp+1;\
473             for(j = 0; j < 8; j++) {\
474                 for(i = 0; i < 8; i++)\
475                     OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode)+r)>>7);\
476                 dst += stride;\
477                 tptr += 11;\
478             }\
479 \
480             return;\
481         }\
482         else { /* No horizontal filter, output 8 lines to dst */\
483             r = 1-rnd;\
484 \
485             for(j = 0; j < 8; j++) {\
486                 for(i = 0; i < 8; i++)\
487                     OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r));\
488                 src += stride;\
489                 dst += stride;\
490             }\
491             return;\
492         }\
493     }\
494 \
495     /* Horizontal mode with no vertical mode */\
496     for(j = 0; j < 8; j++) {\
497         for(i = 0; i < 8; i++)\
498             OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd));\
499         dst += stride;\
500         src += stride;\
501     }\
502 }
503
504 #define op_put(a, b) a = av_clip_uint8(b)
505 #define op_avg(a, b) a = (a + av_clip_uint8(b) + 1) >> 1
506
507 VC1_MSPEL_MC(op_put, put_)
508 VC1_MSPEL_MC(op_avg, avg_)
509
510 /* pixel functions - really are entry points to vc1_mspel_mc */
511
512 /* this one is defined in dsputil.c */
513 void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
514 void ff_avg_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
515
516 #define PUT_VC1_MSPEL(a, b)\
517 static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
518      put_vc1_mspel_mc(dst, src, stride, a, b, rnd);                         \
519 }\
520 static void avg_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
521      avg_vc1_mspel_mc(dst, src, stride, a, b, rnd);                         \
522 }
523
524 PUT_VC1_MSPEL(1, 0)
525 PUT_VC1_MSPEL(2, 0)
526 PUT_VC1_MSPEL(3, 0)
527
528 PUT_VC1_MSPEL(0, 1)
529 PUT_VC1_MSPEL(1, 1)
530 PUT_VC1_MSPEL(2, 1)
531 PUT_VC1_MSPEL(3, 1)
532
533 PUT_VC1_MSPEL(0, 2)
534 PUT_VC1_MSPEL(1, 2)
535 PUT_VC1_MSPEL(2, 2)
536 PUT_VC1_MSPEL(3, 2)
537
538 PUT_VC1_MSPEL(0, 3)
539 PUT_VC1_MSPEL(1, 3)
540 PUT_VC1_MSPEL(2, 3)
541 PUT_VC1_MSPEL(3, 3)
542
543 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
544     dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
545     dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
546     dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
547     dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
548     dsp->vc1_h_overlap = vc1_h_overlap_c;
549     dsp->vc1_v_overlap = vc1_v_overlap_c;
550     dsp->vc1_v_loop_filter4 = vc1_v_loop_filter4_c;
551     dsp->vc1_h_loop_filter4 = vc1_h_loop_filter4_c;
552     dsp->vc1_v_loop_filter8 = vc1_v_loop_filter8_c;
553     dsp->vc1_h_loop_filter8 = vc1_h_loop_filter8_c;
554     dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_c;
555     dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_c;
556
557     dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c;
558     dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;
559     dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_c;
560     dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_c;
561     dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_c;
562     dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_c;
563     dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_c;
564     dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_c;
565     dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_c;
566     dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_c;
567     dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
568     dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
569     dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
570     dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
571     dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
572     dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
573
574     dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_c;
575     dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_c;
576     dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_c;
577     dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_c;
578     dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_c;
579     dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_c;
580     dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_c;
581     dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_c;
582     dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_c;
583     dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_c;
584     dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
585     dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
586     dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
587     dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
588     dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
589     dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
590 }