Author: kostya Date: Mon Sep 17 18:53:17 2007 New Revision: 1366 Log: Move get_omega() to the position before its first call Modified: rv40/rv40.c Modified: rv40/rv40.c ============================================================================== --- rv40/rv40.c (original) +++ rv40/rv40.c Mon Sep 17 18:53:17 2007 @@ -599,7 +599,43 @@ static int rv40_parse_slice_header(RV40D return 0; } -static inline int get_omega(GetBitContext *gb); +/** + * Decode variable-length code constructed from variable-length codes + * similar to Even-Rodeh and Elias Omega codes + * + * Code is constructed from bit chunks of even length (odd length means end of code) + * and chunks are coded with variable-length codes too + */ +static inline int get_omega(GetBitContext *gb) +{ + int code = 1, t, tb; + + for(;;){ + t = get_vlc2(gb, mbinfo_vlc.table, MBINFO_BITS, 1); + tb = t >> 5; + code = (code << tb) | (t & 0xF); + if(t & 0x10) break; + } + return code; +} + +/** + * Decode signed integer variable-length code constructed from variable-length codes + * similar to Even-Rodeh and Elias Omega codes + * + * Code is constructed from bit chunks of even length (odd length means end of code) + * and chunks are coded with variable-length codes too + */ +static inline int get_omega_signed(GetBitContext *gb) +{ + int code; + + code = get_omega(gb); + if(code & 1) + return -(code >> 1); + else + return code >> 1; +} /** * Decode 4x4 intra types array @@ -708,44 +744,6 @@ static inline int rv40_decode_dquant(Get } /** - * Decode variable-length code constructed from variable-length codes - * similar to Even-Rodeh and Elias Omega codes - * - * Code is constructed from bit chunks of even length (odd length means end of code) - * and chunks are coded with variable-length codes too - */ -static inline int get_omega(GetBitContext *gb) -{ - int code = 1, t, tb; - - for(;;){ - t = get_vlc2(gb, mbinfo_vlc.table, MBINFO_BITS, 1); - tb = t >> 5; - code = (code << tb) | (t & 0xF); - if(t & 0x10) break; - } - return code; -} - -/** - * Decode signed integer variable-length code constructed from variable-length codes - * similar to Even-Rodeh and Elias Omega codes - * - * Code is constructed from bit chunks of even length (odd length means end of code) - * and chunks are coded with variable-length codes too - */ -static inline int get_omega_signed(GetBitContext *gb) -{ - int code; - - code = get_omega(gb); - if(code & 1) - return -(code >> 1); - else - return code >> 1; -} - -/** * Decode macroblock information */ static int rv30_decode_mb_info(RV40DecContext *r)
participants (1)
-
kostya