summaryrefslogtreecommitdiff
path: root/libavcodec/mpc8huff.h
Commit message (Collapse)AuthorAge
* avcodec/mpc8: Avoid code duplication when initializing VLCsAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, VLCs that were part of an array of VLCs were often not initialized in a loop, but separately. The probable reason for this was that these VLCs differed slightly in the parameters to be used for them (i.e. the number of codes or the number of bits to be used differs), so that one would have to provide these parameters e.g. via arrays. Yet these problems have actually largely been solved by now: The length information is contained in a run-length encoded form that is the same for all VLCs and both the number of codes as well as the number of bits to use for each VLC can be easily derived from them. There is just one problem to be solved: When the underlying tables have a different number of elements, putting them into an array of arrays would be wasteful; using an array of pointers to the arrays would also be wasteful. Therefore this commit combines the tables into bigger tables. (Given that all the length tables have the same layout this applies only to the symbols tables.) Finally, the array containing the offset of the VLC's buffer in the big buffer has also been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpc8: Reduce the size of the length tables to initialize VLCsAndreas Rheinhardt2020-12-08
| | | | | | | | | | After permuting both length, code as well as symbol tables so that the codes are ordered from left to right in the tree, it became apparent that the length of the codes decreases from left to right. Therefore one can run-length encode the lengths to save space. This commit implements this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpc8: Reduce size of tables used to initialize VLCsAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | By switching to ff_init_vlc_from_lengths() one can make a table of codes of type uint8_t superfluous, saving space. Other VLCs (those without dedicated symbols table and with codes of type uint8_t) have been made to use ff_init_vlc_from_lengths(), too, because it reduces codesize (ff_init_vlc_from_lengths() has two parameters less than ff_init_vlc_sparse()) and because it allows to use the offset parameter in future commits. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpc8huff: Make some arrays unsigned to prevent overflowAndreas Rheinhardt2019-07-24
| | | | | | | | | | | mpc8_q4_syms is an array of int8_t that is initialized using values not in the range of an int8_t and that is only accessed via a pointer to uint8_t in ff_init_vlc_sparse. The latter applies to all the other *_bits and *_syms tables in mpc8huff.h, so make them all unsigned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Globally rename the header inclusion guard names.Stefano Sabatini2008-08-31
| | | | | | | | | Consistently apply this rule: the guard name is obtained from the filename by stripping the leading "lib", converting '/' and '.' to '_' and uppercasing the resulting name. Guard names in the root directory have to be prefixed by "FFMPEG_". Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Musepack SV8 demuxer and decoderKostya Shishkov2007-11-07
Originally committed as revision 10938 to svn://svn.ffmpeg.org/ffmpeg/trunk