From 4bbdf13f9ed655b152677230a760aa2304c01957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Fri, 6 Jul 2007 07:55:37 +0000 Subject: [PATCH] =?UTF-8?q?Compute=20the=20dequant=20coefficient=20table?= =?UTF-8?q?=20ptr=20outside=20the=20loop,=20this=20saves=20speed=20for=20t?= =?UTF-8?q?he=20upcoming=20secondqp=20fix.=20Patch=20by=20Andreas=20=C3=96?= =?UTF-8?q?man=20%=20andreas=20A=20olebyn=20P=20nu=20%=20Original=20thread?= =?UTF-8?q?:=20Date:=20Jun=2026,=202007=208:48=20PM=20subject:=20[FFmpeg-d?= =?UTF-8?q?evel]=20Color=20corruption=20and=20seeking=20errors=20with=20H2?= =?UTF-8?q?64=20disc=20sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 9497 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 8826e0b0e7..6c7fcf92d5 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -5222,9 +5222,10 @@ decode_intra_mb: if(cbp&0x20){ for(chroma_idx=0; chroma_idx<2; chroma_idx++){ + const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][chroma_qp]; for(i4x4=0; i4x4<4; i4x4++){ const int index= 16 + 4*chroma_idx + i4x4; - if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][chroma_qp], 15) < 0){ + if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, qmul, 15) < 0){ return -1; } } @@ -6341,10 +6342,11 @@ decode_intra_mb: if( cbp&0x20 ) { int c, i; for( c = 0; c < 2; c++ ) { + const uint32_t *qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp]; for( i = 0; i < 4; i++ ) { const int index = 16 + 4 * c + i; //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 ); - if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp], 15) < 0) + if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, qmul, 15) < 0) return -1; } }