Mercurial > libavcodec.hg
comparison rv34.c @ 8046:6df5221c3e26 libavcodec
Choose RV3/4 DC quantizer correctly
author | kostya |
---|---|
date | Fri, 24 Oct 2008 06:17:18 +0000 |
parents | efc935702bce |
children | 31e90d4abe28 |
comparison
equal
deleted
inserted
replaced
8045:444659c2b8a6 | 8046:6df5221c3e26 |
---|---|
1044 s->current_picture.qscale_table[s->mb_x + s->mb_y * s->mb_stride] = s->qscale; | 1044 s->current_picture.qscale_table[s->mb_x + s->mb_y * s->mb_stride] = s->qscale; |
1045 | 1045 |
1046 if(cbp == -1) | 1046 if(cbp == -1) |
1047 return -1; | 1047 return -1; |
1048 | 1048 |
1049 luma_dc_quant = r->si.type ? r->luma_dc_quant_p[s->qscale] : r->luma_dc_quant_i[s->qscale]; | 1049 luma_dc_quant = r->block_type == RV34_MB_P_MIX16x16 ? r->luma_dc_quant_p[s->qscale] : r->luma_dc_quant_i[s->qscale]; |
1050 if(r->is16){ | 1050 if(r->is16){ |
1051 memset(block16, 0, sizeof(block16)); | 1051 memset(block16, 0, sizeof(block16)); |
1052 rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0); | 1052 rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0); |
1053 rv34_dequant4x4_16x16(block16, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]); | 1053 rv34_dequant4x4_16x16(block16, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]); |
1054 rv34_inv_transform_noround(block16); | 1054 rv34_inv_transform_noround(block16); |
1058 if(!r->is16 && !(cbp & 1)) continue; | 1058 if(!r->is16 && !(cbp & 1)) continue; |
1059 blknum = ((i & 2) >> 1) + ((i & 8) >> 2); | 1059 blknum = ((i & 2) >> 1) + ((i & 8) >> 2); |
1060 blkoff = ((i & 1) << 2) + ((i & 4) << 3); | 1060 blkoff = ((i & 1) << 2) + ((i & 4) << 3); |
1061 if(cbp & 1) | 1061 if(cbp & 1) |
1062 rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->luma_vlc, 0); | 1062 rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->luma_vlc, 0); |
1063 rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]); | 1063 rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[s->qscale],rv34_qscale_tab[s->qscale]); |
1064 if(r->is16) //FIXME: optimize | 1064 if(r->is16) //FIXME: optimize |
1065 s->block[blknum][blkoff] = block16[(i & 3) | ((i & 0xC) << 1)]; | 1065 s->block[blknum][blkoff] = block16[(i & 3) | ((i & 0xC) << 1)]; |
1066 rv34_inv_transform(s->block[blknum] + blkoff); | 1066 rv34_inv_transform(s->block[blknum] + blkoff); |
1067 } | 1067 } |
1068 if(r->block_type == RV34_MB_P_MIX16x16) | 1068 if(r->block_type == RV34_MB_P_MIX16x16) |