summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/wmadec: Mark decoders as init-threadsafeAndreas Rheinhardt2021-05-12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmadec: Check operations that can failAndreas Rheinhardt2021-05-12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmadec: Forward error instead of return -1Andreas Rheinhardt2021-05-12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wma: Check initializing VLCAndreas Rheinhardt2021-05-12
| | | | | | Initializing a VLC entails implicit allocations which may fail. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wma(dec|enc): Fix memleaks upon allocation errorAndreas Rheinhardt2021-05-12
| | | | | | | ff_wma_init() can fail without freeing everything it has allocated; so add the FF_CODEC_CAP_INIT_CLEANUP to the codecs using it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wma: Remove nonsense volatileAndreas Rheinhardt2021-05-12
| | | | | | | The address of this variable never leaks, so it cannot be modified by anyone else at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp3: Mark decoders as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp3: ReindentationAndreas Rheinhardt2021-05-10
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp3: Avoid code duplication when initializing coeff_vlcsAndreas Rheinhardt2021-05-10
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp3: Don't try to decode VP4 when VP4 decoder is disabledAndreas Rheinhardt2021-05-10
| | | | | | | | Otherwise decoding will crash lateron; e.g. because dct_tokens is never set or because a VLC that has not been allocated is used. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ttmlenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vmdvideo: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vmdvideo: Cleanup generically upon init failureAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Use av_memdup() instead of av_malloc()+memcpy()Andreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Fix segfault when using too many slice threadsAndreas Rheinhardt2021-05-10
| | | | | | | | | | | | | | The DNXHD encoder's context contains an array of 32 pointers to DNXHDEncContexts used in case of slice threading; when trying to use more than 32 threads with slice threading, the encoder's init function errors out, but the close function takes avctx->thread_count at face value and tries to free inexistent elements of the array, leading to potential crashes. Fix this by modifying the check used to decide whether the slice contexts should be freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhddec: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Mark encoders as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | | Initializing zlib in the way we do here is threadsafe, see https://www.zlib.net/zlib_faq.html#faq21 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/exrenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmaprodec: Make decoders init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | | | | | | | | In this case this actually fixes a potential data race: The static VLC tables were reinitialized every time an AVCodecContext has been initialized; while the mutex in avcodec_open2() ensured that the VLCs could not be initialized concurrently by multiple threads, nothing guaranteed that these VLCs are not read concurrently (when decoding a packet with an already initialized AVCodecContext) while another thread initializes them. This is undefined behaviour despite the values being written coinciding with the earlier values. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmaprodec: Check ff_mdct_init() for failureAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tscc: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | | Initializing zlib in the way we do here is threadsafe, see https://www.zlib.net/zlib_faq.html#faq21 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tscc: Don't free uninitialized z_streamAndreas Rheinhardt2021-05-10
| | | | | | | | It is not documented to be safe to call inflateEnd() on a z_stream that has not been successfully initialized via inflateInit(); so record whether it has been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mscc: Mark decoders as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | | Initializing zlib in the way we do here is threadsafe, see https://www.zlib.net/zlib_faq.html#faq21 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp8: Mark decoders as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | It only allocates some AVFrames. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Inline function with only one caller into itAndreas Rheinhardt2021-05-10
| | | | | | | | | The split into vp9_decode_init() and init_frames() is a remnant of using init_thread_copy() for frame-threading; the latter has been removed, so there is no reason for init_frames() not be part of vp9_decode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Remove excessive log messagesAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Cleanup generically on init failureAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rawdec: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ljpegenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Implement Acorn Replay IMA ADPCM decoderCameron Cawley2021-05-09
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/avpacket: use av_malloc() to allocate an AVPacketJames Almer2021-05-08
| | | | | | | | av_mallocz() is superfluous as get_packet_defaults() is called immediately after it's allocated, which will initialize the entire struct to default values. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/avpacket: always initialize the new packet in avpriv_packet_list_put()James Almer2021-05-08
| | | | | | | If a copy callback is provided by the caller, the packet passed to it was zeroed instead of initialized with default values. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h263, h263data: Move ff_h263_init_rl_inter to h263.cAndreas Rheinhardt2021-05-07
| | | | | | | | | | | | The SVQ1 decoder does not need mpegvideo or rl.c, but it uses stuff from h263data.c. But since 61fe481586425a41d45e371de1e875b49882477d h263data.c called ff_rl_init() and this of course led to build errors when the SVQ1 decoder is enabled and mpegvideo disabled. Fix this by moving ff_h263_init_rl_inter() to h263.c. Fixes ticket #9224. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: be more explicit about the buffer size in get_encode_buffer ↵James Almer2021-05-07
| | | | | | documentation Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/alsdec: Fix decoding error with mono audio filesMichael Niedermayer2021-05-07
| | | | | | | | | | | highest_decoded_channel is modified to serve as meant. Reported-by: Noboru Harada <noboru@ieee.org> Regression since: a11aa5f3ed7ee4d2385a7b725d43f6070d790b4c Fixes: Sin48k16bit1ch.mp4 Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: Refine ff_h264_h_lpf_luma_inter_msagxw2021-05-07
| | | | | | | | Using mask to avoid judgment, H264 4K decoding speed improved about 0.1fps tested on 3A4000 Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: Optimize function ff_h264_loop_filter_strength_msa.gxw2021-05-07
| | | | | | | Speed of decoding H264 1080P: 5.05x ==> 5.13x Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: Refine get_cabac_inline_mips.Shiyou Yin2021-05-07
| | | | | | | | | 1. Refined function get_cabac_inline_mips. 2. Optimize function get_cabac_bypass and get_cabac_bypass_sign. Speed of decoding h264: 4.89x ==> 5.05x(tested on 3A4000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: Restore the initialization sequence of MSA and MMI in ↵Shiyou Yin2021-05-07
| | | | | | | | | | ff_h264chroma_init_mips. The MSA optimization has been refined in commit 93218c2 and ce0a52e. It is better than MMI version now. Speed of decoding H264: 4.83x ==> 4.89x (tested on 3A4000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/zmbvenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-07
| | | | | | | | Initializing zlib in the way we do here is threadsafe, see https://www.zlib.net/zlib_faq.html#faq21 Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zmbvenc: Fix memleak upon init errorAndreas Rheinhardt2021-05-07
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zmbv: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-07
| | | | | | | | Initializing zlib in the way we do here is threadsafe, see https://www.zlib.net/zlib_faq.html#faq21 Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zmbv: Don't free uninitialized z_streamAndreas Rheinhardt2021-05-07
| | | | | | | | | It is not documented to be safe to call inflateEnd() on a z_stream that has not been successfully initialized via inflateInit(); so record whether it has been successfully initialized. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ttmlenc: Don't confuse capabilities and caps_internalAndreas Rheinhardt2021-05-07
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/videotoolboxenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-06
| | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Rick Kern <kernrj@gmail.com>
* avcodec/dvenc: Make encoder init-threadsafeAndreas Rheinhardt2021-05-06
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dvdec: Make decoder init-threadsafeAndreas Rheinhardt2021-05-06
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dv: Don't initialize RL VLC for encoderAndreas Rheinhardt2021-05-06
| | | | | | | | Said RL VLC is only used by the decoder, ergo don't initialize it for the encoder and move the whole code and the RL VLC table itself to dvdec.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>