comparison h264.c @ 3005:6f6f307cffac libavcodec

fix asymmetric CQMs with pre-transposed DCT.
author lorenm
date Sat, 31 Dec 2005 14:14:38 +0000
parents a22cf6e46b0e
children 1fadd4c26175
comparison
equal deleted inserted replaced
3004:a22cf6e46b0e 3005:6f6f307cffac
2971 } 2971 }
2972 } 2972 }
2973 2973
2974 static void init_dequant4_coeff_table(H264Context *h){ 2974 static void init_dequant4_coeff_table(H264Context *h){
2975 int i,j,q,x; 2975 int i,j,q,x;
2976 const int transpose = (h->s.dsp.h264_idct_add != ff_h264_idct_add_c); //FIXME ugly
2976 for(i=0; i<6; i++ ){ 2977 for(i=0; i<6; i++ ){
2977 h->dequant4_coeff[i] = h->dequant4_buffer[i]; 2978 h->dequant4_coeff[i] = h->dequant4_buffer[i];
2978 for(j=0; j<i; j++){ 2979 for(j=0; j<i; j++){
2979 if(!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i], 16*sizeof(uint8_t))){ 2980 if(!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i], 16*sizeof(uint8_t))){
2980 h->dequant4_coeff[i] = h->dequant4_buffer[j]; 2981 h->dequant4_coeff[i] = h->dequant4_buffer[j];
2986 2987
2987 for(q=0; q<52; q++){ 2988 for(q=0; q<52; q++){
2988 int shift = div6[q] + 2; 2989 int shift = div6[q] + 2;
2989 int idx = rem6[q]; 2990 int idx = rem6[q];
2990 for(x=0; x<16; x++) 2991 for(x=0; x<16; x++)
2991 h->dequant4_coeff[i][q][x] = ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] * 2992 h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] =
2993 ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] *
2992 h->pps.scaling_matrix4[i][x]) << shift; 2994 h->pps.scaling_matrix4[i][x]) << shift;
2993 } 2995 }
2994 } 2996 }
2995 } 2997 }
2996 2998