Anton Khirnov:
> Quoting Andreas Rheinhardt (2020-11-12 21:51:28)
>> Derek Buitenhuis:
>>> On 10/11/2020 10:46, Andreas Rheinhardt wrote:
+#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap,
\
+ symbols, symbols_wrap,
Anton Khirnov:
> Quoting Andreas Rheinhardt (2020-11-10 11:46:58)
>> +int ff_init_vlc_from_lengths(VLC *vlc_arg, int nb_bits, int nb_codes,
>> + const int8_t *lens, int lens_wrap,
>> + const void *symbols, int symbols_wrap, int
>> symbols_siz
Quoting Andreas Rheinhardt (2020-11-10 11:46:58)
> +int ff_init_vlc_from_lengths(VLC *vlc_arg, int nb_bits, int nb_codes,
> + const int8_t *lens, int lens_wrap,
> + const void *symbols, int symbols_wrap, int
> symbols_size,
> +
Quoting Andreas Rheinhardt (2020-11-12 21:51:28)
> Derek Buitenhuis:
> > On 10/11/2020 10:46, Andreas Rheinhardt wrote:
> >>
> >> +#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap,
> >> \
> >> + symbols, symbols_wrap, symbols_size,
>
Derek Buitenhuis:
> On 12/11/2020 20:51, Andreas Rheinhardt wrote:
>> The ff_init_vlc_... functions are inherently thread-safe: Everything is
>> modified only once and directly set to its final value; so it's no
>> problem if two threads are initializing the same static VLC at the same
>> time.
>
On 12/11/2020 20:51, Andreas Rheinhardt wrote:
> The ff_init_vlc_... functions are inherently thread-safe: Everything is
> modified only once and directly set to its final value; so it's no
> problem if two threads are initializing the same static VLC at the same
> time.
Hmm, indeed. At the very
Derek Buitenhuis:
> On 10/11/2020 10:46, Andreas Rheinhardt wrote:
>>
>> +#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \
>> + symbols, symbols_wrap, symbols_size, \
>> + offset, flags, static_si
On 10/11/2020 10:46, Andreas Rheinhardt wrote:
>
> +#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \
> + symbols, symbols_wrap, symbols_size, \
> + offset, flags, static_size) \
> +d
When using ff_init_vlc_sparse() to create a VLC, three input tables are
used: A table for lengths, one for codes and one for symbols; the latter
one can be omitted, then a default one will be used. These input tables
will be traversed twice, once to get the long codes (which will be put
into subtab