summaryrefslogtreecommitdiff
path: root/libavcodec/speedhqenc.c
Commit message (Collapse)AuthorAge
* avcodec/mpegvideo_enc: Deduplicate ff_mpv_generic_options-based AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/speedhqenc: Hardcode table to save spaceAndreas Rheinhardt2021-05-05
| | | | | | | | | | The SpeedHQ encoder currently reverses the entries of two small tables and stores them in other tables. These other tables have a size of 48 bytes, yet the code for their initialization takes 135 bytes (GCC 9.3, x64, O3 albeit in an av_cold function). So remove the runtime initialization and hardcode the tables. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/speedhq, speedhqenc: Make codecs init-threadsafeAndreas Rheinhardt2021-05-05
| | | | | | | | | | | | The SpeedHQ decoder uses and initializes a RLTable's VLC, yet it also initializes other parts of the RLTable that it does not use. This has downsides besides being wasteful: Because the SpeedHQ encoder also initializes these additional fields, there is a potential for data races (and therefore undefined behaviour). In fact, removing the superfluous initializations from the decoder automatically makes both the decoder and the encoder init-threadsafe. This commit does so. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg12enc, speedhqenc: Avoid redundant copies of tablesAndreas Rheinhardt2021-01-25
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/speedhqenc: Call correct functionAndreas Rheinhardt2020-12-11
| | | | | | | | | | | | | | | | | | | Up until now, the SpeedHQ encoder called a wrong function for init: void ff_init_uni_ac_vlc(const uint8_t huff_size_ac[256], uint8_t *uni_ac_vlc_len); Yet the first argument actually used is of type RLTable; the size of said struct is less than 256 if the size of a pointer is four, leading to an access beyond the end of the RLTable. This commit fixes this by calling the actually intended function: init_uni_ac_vlc() from mpeg12enc.c. It was intended to use this function [1], yet doing so was forgotten when the patch was actually applied. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-July/266187.html Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add SpeedHQ encoderJean-Baptiste Kempf2020-11-24