Commit c55fa054 authored by vitor's avatar vitor

Remove wrapper around av_log2()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12881 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 82a11bd4
...@@ -140,12 +140,6 @@ static int alac_set_info(ALACContext *alac) ...@@ -140,12 +140,6 @@ static int alac_set_info(ALACContext *alac)
return 0; return 0;
} }
static inline int count_leading_zeros(int32_t input)
{
return 31-av_log2(input);
}
static inline int decode_scalar(GetBitContext *gb, int k, int limit, int readsamplesize){ static inline int decode_scalar(GetBitContext *gb, int k, int limit, int readsamplesize){
/* read x - number of 1s before 0 represent the rice */ /* read x - number of 1s before 0 represent the rice */
int x = get_unary_0_9(gb); int x = get_unary_0_9(gb);
...@@ -196,7 +190,7 @@ static void bastardized_rice_decompress(ALACContext *alac, ...@@ -196,7 +190,7 @@ static void bastardized_rice_decompress(ALACContext *alac,
int k; /* size of extra bits */ int k; /* size of extra bits */
/* read k, that is bits as is */ /* read k, that is bits as is */
k = 31 - count_leading_zeros((history >> 9) + 3); k = av_log2((history >> 9) + 3);
x= decode_scalar(&alac->gb, k, rice_kmodifier, readsamplesize); x= decode_scalar(&alac->gb, k, rice_kmodifier, readsamplesize);
x_modified = sign_modifier + x; x_modified = sign_modifier + x;
...@@ -220,7 +214,7 @@ static void bastardized_rice_decompress(ALACContext *alac, ...@@ -220,7 +214,7 @@ static void bastardized_rice_decompress(ALACContext *alac,
sign_modifier = 1; sign_modifier = 1;
k = count_leading_zeros(history) + ((history + 16) >> 6 /* / 64 */) - 24; k = 7 - av_log2(history) + ((history + 16) >> 6 /* / 64 */);
block_size= decode_scalar(&alac->gb, k, rice_kmodifier, 16); block_size= decode_scalar(&alac->gb, k, rice_kmodifier, 16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment