changeset 10230:afaf58d1e894 libavcodec

Another micro-optimization for unpack_vlcs(): Eliminate a possible branch and save around 45k-55k dezicycles per function run.
author melanson
date Wed, 23 Sep 2009 05:38:12 +0000
parents bd1c4a438c7f
children e99054a89bfe
files vp3.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vp3.c	Tue Sep 22 22:44:56 2009 +0000
+++ b/vp3.c	Wed Sep 23 05:38:12 2009 +0000
@@ -1070,10 +1070,9 @@
                 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])