Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-14 Thread Andreas Rheinhardt
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,

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-14 Thread Andreas Rheinhardt
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

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-14 Thread 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_size, > +

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-14 Thread 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, symbols_size, >

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-12 Thread Andreas Rheinhardt
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. >

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-12 Thread 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. Hmm, indeed. At the very

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-12 Thread Andreas Rheinhardt
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

Re: [FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-12 Thread 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_size) \ > +d

[FFmpeg-devel] [PATCH 001/114] avcodec/bitstream: Add second function to create VLCs

2020-11-10 Thread Andreas Rheinhardt
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