summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2005-12-31 14:14:38 +0000
committerLoren Merritt <lorenm@u.washington.edu>2005-12-31 14:14:38 +0000
commitab2e3e2c80f06776e836da4b8b17a18fc988332a (patch)
tree82e0c234cabf6c9061940090280203709d19d134 /libavcodec/h264.c
parentf23af3d8258f0a19ac00991dee6491292d93fd82 (diff)
fix asymmetric CQMs with pre-transposed DCT.
Originally committed as revision 4799 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8d05229f55..42e7a5bc8c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2973,6 +2973,7 @@ static void init_dequant8_coeff_table(H264Context *h){
static void init_dequant4_coeff_table(H264Context *h){
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++ ){
h->dequant4_coeff[i] = h->dequant4_buffer[i];
for(j=0; j<i; j++){
@@ -2988,7 +2989,8 @@ static void init_dequant4_coeff_table(H264Context *h){
int shift = div6[q] + 2;
int idx = rem6[q];
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;
}
}