[FFmpeg-devel] [PATCH 16/21] avcodec/smacker: Disentangle two contexts

Paul B Mahol onemda at gmail.com
Sat Aug 1 17:09:34 EEST 2020


On 8/1/20, Andreas Rheinhardt <andreas.rheinhardt at gmail.com> wrote:
> Smacker uses two types of Huffman trees: Those for eight bit values and
> those for 16 bit values. Given that both return their values via arrays
> and that both need to check not to overrun their array, the context for
> parsing eight bit values (HuffContext) will necessarily exhibit certain
> similarities with the context used for parsing 16 bit values (DBCtx).
> These similarities led to using a HuffContext in addition a DBCtx for
> parsing 16 bit trees.
>
> This stands in the way of further developments for the HuffContext struct
> (when parsing eight bit trees, the length of the arrays are always 256,
> so that one can inline said value and move the currently heap-allocated
> tables directly in the structure).
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavcodec/smacker.c | 43 +++++++++++++++++++++----------------------
>  1 file changed, 21 insertions(+), 22 deletions(-)
>

Probably OK


More information about the ffmpeg-devel mailing list