comparison mpegvideo.c @ 768:c3fc09466f92 libavcodec

idct_permutation_type variable, so the permutation type can quickly be identified
author michaelni
date Fri, 25 Oct 2002 13:39:47 +0000
parents c75c3f1bef4b
children d4cc92144266
comparison
equal deleted inserted replaced
767:c75c3f1bef4b 768:c3fc09466f92
67 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, 67 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
68 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, 68 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
69 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 69 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
70 }; 70 };
71 71
72 /* Input permutation for the simple_idct_mmx */
73 static const UINT8 simple_mmx_permutation[64]={
74 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
75 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
76 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
77 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
78 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
79 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
80 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
81 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
82 };
83
72 static UINT8 h263_chroma_roundtab[16] = { 84 static UINT8 h263_chroma_roundtab[16] = {
73 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 85 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
74 }; 86 };
75 87
76 static UINT16 default_mv_penalty[MAX_FCODE+1][MAX_MV*2+1]; 88 static UINT16 default_mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
185 s->fdct = ff_jpeg_fdct_islow; //slow/accurate/default 197 s->fdct = ff_jpeg_fdct_islow; //slow/accurate/default
186 198
187 if(s->avctx->idct_algo==FF_IDCT_INT){ 199 if(s->avctx->idct_algo==FF_IDCT_INT){
188 s->idct_put= ff_jref_idct_put; 200 s->idct_put= ff_jref_idct_put;
189 s->idct_add= ff_jref_idct_add; 201 s->idct_add= ff_jref_idct_add;
190 for(i=0; i<64; i++) 202 s->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
191 s->idct_permutation[i]= (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
192 }else{ //accurate/default 203 }else{ //accurate/default
193 s->idct_put= simple_idct_put; 204 s->idct_put= simple_idct_put;
194 s->idct_add= simple_idct_add; 205 s->idct_add= simple_idct_add;
195 for(i=0; i<64; i++) 206 s->idct_permutation_type= FF_NO_IDCT_PERM;
196 s->idct_permutation[i]= i;
197 } 207 }
198 208
199 #ifdef HAVE_MMX 209 #ifdef HAVE_MMX
200 MPV_common_init_mmx(s); 210 MPV_common_init_mmx(s);
201 #endif 211 #endif
209 MPV_common_init_mmi(s); 219 MPV_common_init_mmi(s);
210 #endif 220 #endif
211 #ifdef ARCH_ARMV4L 221 #ifdef ARCH_ARMV4L
212 MPV_common_init_armv4l(); 222 MPV_common_init_armv4l();
213 #endif 223 #endif
224
225 switch(s->idct_permutation_type){
226 case FF_NO_IDCT_PERM:
227 for(i=0; i<64; i++)
228 s->idct_permutation[i]= i;
229 break;
230 case FF_LIBMPEG2_IDCT_PERM:
231 for(i=0; i<64; i++)
232 s->idct_permutation[i]= (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
233 break;
234 case FF_SIMPLE_IDCT_PERM:
235 for(i=0; i<64; i++)
236 s->idct_permutation[i]= simple_mmx_permutation[i];
237 break;
238 case FF_TRANSPOSE_IDCT_PERM:
239 for(i=0; i<64; i++)
240 s->idct_permutation[i]= ((i&7)<<3) | (i>>3);
241 break;
242 default:
243 fprintf(stderr, "Internal error, IDCT permutation not set\n");
244 return -1;
245 }
214 246
215 247
216 /* load & permutate scantables 248 /* load & permutate scantables
217 note: only wmv uses differnt ones 249 note: only wmv uses differnt ones
218 */ 250 */