From 8683b6d65d8ad064b1f5af4a9f83904827f93151 Mon Sep 17 00:00:00 2001 From: darkshikari Date: Mon, 28 Jul 2008 15:42:49 +0000 Subject: [PATCH] Small h264 decoding speed optimization: while->do/while git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14459 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- libavcodec/h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 2c24787e4..62bc05e28 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -5356,10 +5356,10 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT } } - while( coeff_count-- ) { + do { uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base; - int j= scantable[index[coeff_count]]; + int j= scantable[index[--coeff_count]]; if( get_cabac( CC, ctx ) == 0 ) { node_ctx = coeff_abs_level_transition[0][node_ctx]; @@ -5396,7 +5396,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT block[j] = (get_cabac_bypass_sign( CC, -coeff_abs ) * qmul[j] + 32) >> 6; } } - } + } while( coeff_count ); #ifdef CABAC_ON_STACK h->cabac.range = cc.range ; h->cabac.low = cc.low ; -- 2.39.2