[FFmpeg-devel] [RFC] pointless assignment in show_bits_long ?

Reimar Döffinger Reimar.Doeffinger
Mon Mar 2 19:34:31 CET 2009


Hello,
show_bits_long currently makes a "backup" of the GetBitContext, calls
get_bits_long and then restores the backup.
Am I missing something or would it be more efficient to just use
get_bits_long on the backup instead?
As a diff:
Index: libavcodec/bitstream.h
===================================================================
--- libavcodec/bitstream.h      (revision 17735)
+++ libavcodec/bitstream.h      (working copy)
@@ -713,8 +713,7 @@
     if(n<=17) return show_bits(s, n);
     else{
         GetBitContext gb= *s;
-        int ret= get_bits_long(s, n);
-        *s= gb;
+        int ret= get_bits_long(&gb, n);
         return ret;
     }
 }





More information about the ffmpeg-devel mailing list