summaryrefslogtreecommitdiff
path: root/libavcodec/vlc.h
Commit message (Collapse)AuthorAge
* Revert "avcodec/vlc: Add macro for ff_init_vlc_sparse()"Andreas Rheinhardt2020-09-18
| | | | | | | | | | | | | | | This reverts commit 61669b7c40b8dc3a0841768fb39c7567513b7cfc. This commit broke building with MSVC due to its spec-incompliant handling of ',' in __VA_ARGS__: These are not treated as argument separators for further macros, so that in our case the init_vlc2() macro is treated as having only one argument whenever the init_vlc() macro is used. See [1] for further details. [1]: https://reviews.llvm.org/D69626 Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vlc: Add macro for ff_init_vlc_sparse()Andreas Rheinhardt2020-09-18
| | | | | | | | | | | | | | ff_init_vlc_sparse() supports arrays of uint8_t, uint16_t and uint32_t as input (and it also supports padding/other elements in between the elements). This makes the typical case in which the input is a simple array more cumbersome. E.g. for an array of uint8_t one would either need to call the function with arguments like "array, sizeof(array[0]), sizeof(array[0])" or with "array, 1, 1". The former is nicer, but longer, so that the latter is mostly used. Therefore this commit adds a macro that expands to the sizeof() construct. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* speedhq: fix out-of-bounds writeSteinar H. Gunderson2017-02-02
| | | | | | | | | | | | | Certain alpha run lengths (for SHQ1/SHQ3/SHQ5) could be stored in both long and short versions, and we would only accept the short version, returning -1 (invalid code) for the others. This could cause an out-of-bounds write on malicious input, as discovered by Andreas Cadhalpun during fuzzing. Fix by simply allowing both versions, leaving no invalid codes in the alpha VLC. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec: add Newtek SpeedHQ decoderSteinar H. Gunderson2017-01-11
| | | | | | | | | | | | | | This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), including correct decoding of the alpha channel. 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), about evenly split between bitstream reader and IDCT. There is currently no attempt at slice or frame threading, even though the format trivially supports both. NewTek very helpfully provided a full set of SHQ samples, as well as source code for an SHQ2 encoder (not included) and assistance with understanding some details of the format.
* lavc: fix previous mergeClément Bœsch2016-06-23
|
* Move VLC and RL_VLC_ELEM structure definitions to a separate headerAlexandra Hájková2016-05-17
Use the newly created vlc.h directly instead of including get_bits when needed. The VLC and RL_VLC_ELEM structures are independent from the bitreader. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>