[SCM] libav/experimental: Another micro-optimization for unpack_vlcs(): Eliminate a possible branch and save around 45k-55k dezicycles per function run.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:51:41 UTC 2013


The following commit has been merged in the experimental branch:
commit 428984b041092de3fb1bde07bf8d32383808a0e9
Author: Mike Melanson <mike at multimedia.cx>
Date:   Wed Sep 23 05:38:12 2009 +0000

    Another micro-optimization for unpack_vlcs(): Eliminate a possible
    branch and save around 45k-55k dezicycles per function run.
    
    Originally committed as revision 19974 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index e2b1706..4d27a8a 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1070,10 +1070,9 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
                 coeff = zero_run = 0;
             } else {
                 bits_to_get = coeff_get_bits[token];
-                if (!bits_to_get)
-                    coeff = coeff_tables[token][0];
-                else
-                    coeff = coeff_tables[token][get_bits(gb, bits_to_get)];
+                if (bits_to_get)
+                    bits_to_get = get_bits(gb, bits_to_get);
+                coeff = coeff_tables[token][bits_to_get];
 
                 zero_run = zero_run_base[token];
                 if (zero_run_get_bits[token])

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list