Commit a6967425 authored by lorenm's avatar lorenm

fix asymmetric CQMs with pre-transposed DCT.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4799 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 35e55b78
...@@ -2973,6 +2973,7 @@ static void init_dequant8_coeff_table(H264Context *h){ ...@@ -2973,6 +2973,7 @@ static void init_dequant8_coeff_table(H264Context *h){
static void init_dequant4_coeff_table(H264Context *h){ static void init_dequant4_coeff_table(H264Context *h){
int i,j,q,x; int i,j,q,x;
const int transpose = (h->s.dsp.h264_idct_add != ff_h264_idct_add_c); //FIXME ugly
for(i=0; i<6; i++ ){ for(i=0; i<6; i++ ){
h->dequant4_coeff[i] = h->dequant4_buffer[i]; h->dequant4_coeff[i] = h->dequant4_buffer[i];
for(j=0; j<i; j++){ for(j=0; j<i; j++){
...@@ -2988,7 +2989,8 @@ static void init_dequant4_coeff_table(H264Context *h){ ...@@ -2988,7 +2989,8 @@ static void init_dequant4_coeff_table(H264Context *h){
int shift = div6[q] + 2; int shift = div6[q] + 2;
int idx = rem6[q]; int idx = rem6[q];
for(x=0; x<16; x++) for(x=0; x<16; x++)
h->dequant4_coeff[i][q][x] = ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] * h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] =
((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] *
h->pps.scaling_matrix4[i][x]) << shift; h->pps.scaling_matrix4[i][x]) << shift;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment