[libav-devel] [PATCH] [RFC] get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL

Luca Barbato lu_zero at gentoo.org
Mon Dec 14 09:04:45 CET 2015


On 13/12/15 22:26, Kieran Kunhya wrote:
> On 13 December 2015 at 19:21, Luca Barbato <lu_zero at gentoo.org> wrote:
>> On 13/12/15 19:02, Kieran Kunhya wrote:
>>> ---
>>>  libavcodec/get_bits.h | 11 +++++++++++
>>>  1 file changed, 11 insertions(+)
>>>
>>> diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
>>> index 0d3db1f..0a61c80 100644
>>> --- a/libavcodec/get_bits.h
>>> +++ b/libavcodec/get_bits.h
>>> @@ -539,6 +539,17 @@ void ff_free_vlc(VLC *vlc);
>>>              index = SHOW_UBITS(name, gb, nb_bits) + level;      \
>>>              level = table[index].level;                         \
>>>              n     = table[index].len;                           \
>>> +            if (max_depth > 2 && n < 0) {                       \
>>> +                LAST_SKIP_BITS(name, gb, nb_bits);              \
>>> +                if (need_update) {                              \
>>> +                    UPDATE_CACHE(name, gb);                     \
>>> +                }                                               \
>>> +                nb_bits = -n;                                   \
>>> +                                                                \
>>> +                index = SHOW_UBITS(name, gb, nb_bits) + level;  \
>>> +                level = table[index].level;                     \
>>> +                n     = table[index].len;                       \
>>> +            }                                                   \
>>>          }                                                       \
>>>          run = table[index].run;                                 \
>>>          SKIP_BITS(name, gb, n);                                 \
>>>
>>
>> Where do you need it?
> 
> The author of the code tells me it is needed for the large VLCs in Cineform.

You basically repeated the same pattern that is in GET_VLC. GET_RL_VLC
is used by mpeg12 msmpeg4, eamad and mdec with max_depth 2, fate passes
so doesn't seem problematic to me.

lu






More information about the libav-devel mailing list