[FFmpeg-devel] [PATCH] ALS decoder

Thilo Borgmann thilo.borgmann
Mon Aug 24 00:26:53 CEST 2009


Michael Niedermayer schrieb:
> On Sun, Aug 23, 2009 at 11:31:32PM +0200, Thilo Borgmann wrote:
> [...]
>>>> +/** Reads and decodes a Rice codeword.
>>>> + */
>>>> +static int64_t decode_rice(GetBitContext *gb, unsigned int k)
>>>> +{
>>>> +    int     max = gb->size_in_bits - get_bits_count(gb) - k;
>>>> +
>>>> +    if (k > 1) {
>>> [...]
>>>> +        q         = get_unary(gb, 0, max);
>>> [...]
>>>> +    } else {
>>>> +        int q;
>>>> +        q = get_unary(gb, 0, max);
>>> [...]
>>>
>>> please factorize this out, also please factorize anything else out
>>> if there is something that can be factored out
>> I've already had a look at this function looking for things to be
>> factored out. If there is anything left, please tell me explicitly. In
>> the case of q - it is of different type in the branches. How to factor
>> that out?
> 
> get_unary() returns int, q is int thats works thus
> if later code does 64bit math it could cast explicitly to int64_t and
> use a separet 64bit variable if it needs but i think its not needed
> 
Ah ok, will be done in revision 8.

Thanks!

-Thilo



More information about the ffmpeg-devel mailing list