]> git.sesse.net Git - ffmpeg/commit
avcodec/smacker: Disentangle two contexts
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 25 Jun 2020 18:46:00 +0000 (20:46 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 18 Sep 2020 00:05:24 +0000 (02:05 +0200)
commit71ed6a52ce39bc46f8218de652df1b1fe73e724a
tree9037acb4d13bbc9e081a020b8afeabe3a6f1cc15
parent527b853d1a72beb08ffaa63239d13b2c0c327c66
avcodec/smacker: Disentangle two contexts

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).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/smacker.c