aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-10-19 01:19:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-10-19 01:19:03 +0000
commitebd624b66256c93f66fa8d86a22fa50a3566ffd2 (patch)
treea448a634dd66bfeb23a9166ca40cc9441d2b49a5 /libavcodec/h264.c
parent99fd05cbdd0460b3f0afc88532f1cf45815d18e2 (diff)
downloadffmpeg-ebd624b66256c93f66fa8d86a22fa50a3566ffd2.tar.gz
optimize sign decoding code in decode_residual()
x86 is 4% faster on P3 C sign stuff + x86 code for everything else is also faster then before (sorry forgot to test pure C) ... and if i replace the second occurance of the sign decoding in decode_residual by the asm too then everything gets slower iam starting to think that it might be best to write the whole function in asm, playing this avoid random deoptimizations game with gcc is not fun at all Originally committed as revision 6732 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d99ceb2de3..26382cb7f6 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -6168,11 +6168,9 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n
if( get_cabac( CC, ctx ) == 0 ) {
if( !qmul ) {
- if( get_cabac_bypass( CC ) ) block[j] = -1;
- else block[j] = 1;
+ block[j] = get_cabac_bypass_sign( CC, -1);
}else{
- if( get_cabac_bypass( CC ) ) block[j] = (-qmul[j] + 32) >> 6;
- else block[j] = ( qmul[j] + 32) >> 6;
+ block[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6;;
}
abslevel1++;