Deobfuscate LE SHOW_[SU]BITS; these are simple sign/zero-extend
authorMåns Rullgård <mans@mansr.com>
Sun, 21 Feb 2010 21:48:40 +0000 (21:48 +0000)
committerMåns Rullgård <mans@mansr.com>
Sun, 21 Feb 2010 21:48:40 +0000 (21:48 +0000)
Originally committed as revision 21948 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/get_bits.h

index bb40ff4..7c4ee43 100644 (file)
@@ -166,10 +166,10 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
 
 # ifdef ALT_BITSTREAM_READER_LE
 #   define SHOW_UBITS(name, gb, num)\
 
 # ifdef ALT_BITSTREAM_READER_LE
 #   define SHOW_UBITS(name, gb, num)\
-        ((name##_cache) & (NEG_USR32(0xffffffff,num)))
+        zero_extend(name##_cache, num)
 
 #   define SHOW_SBITS(name, gb, num)\
 
 #   define SHOW_SBITS(name, gb, num)\
-        NEG_SSR32((name##_cache)<<(32-(num)), num)
+        sign_extend(name##_cache, num)
 # else
 #   define SHOW_UBITS(name, gb, num)\
         NEG_USR32(name##_cache, num)
 # else
 #   define SHOW_UBITS(name, gb, num)\
         NEG_USR32(name##_cache, num)