On 12/06/2012 02:03 PM, Justin Ruggles wrote:
> On 12/06/2012 01:48 PM, Justin Ruggles wrote:
>> On 12/03/2012 12:26 PM, Kostya Shishkov wrote:
>>>> +static int get_code(GetBitContext *gb, int nbits)
>>>>> +{
>>>>> +    if (nbits == 1) {
>>>>> +        skip_bits1(gb);
>>> looks like very effective coding
>>>
>>>>> +        return 0;
>>>>> +    } else {
>>>>> +        return get_sbits(gb, nbits);
>>>>> +    }
>>>>> +}
>>
>> The only way nbits can be 1 is when bits_per_coded_sample is 16 and
>> sample_shift is 15. That seems like a pretty rare use case. Which makes
>> it even weirder to have it special-cased like that. Maybe a sample shift
>> of 15 is specifically only used by the encoder for silence blocks?
> 
> No, that does not seem to be the case. Unless it was done in an earlier
> tak encoder version and it's just there for compatibility...

Well, as it turns out, that 1 bit actually is needed. I generated a file
with only 1 significant bit, and the tak encoder did indeed use a sample
shift of 15. That tak file only decodes losslessly if the 1 bit is read
with get_sbits(gb, 1). So really get_code() can just be replaced with
get_sbits().

Thanks,
Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to