summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec: Remove deprecated stat-bits fieldsAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 16216b713f9a21865cc07993961cf5d0ece24916. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove deprecated AVPacket APIAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in ce70f28a1732c74a9cd7fec2d56178750bd6e457. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec, avformat: Remove AVPacket.convergence_durationAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 948f3c19a8bd069768ca411212aaf8c1ed96b10d. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove sidedata-only-packet cruftAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec, avformat: Remove old BSF APIAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next APIAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/msmpeg4enc: Reindent after the last commitAndreas Rheinhardt2021-04-27
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/msmpeg4enc: Make msmpeg4 encoders init-threadsafeAndreas Rheinhardt2021-04-27
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/msmpeg4: Factor out common RLTable initialization codeAndreas Rheinhardt2021-04-27
| | | | | | | | | | | | | Up until now, both the msmpeg4 decoders and encoders initialized several RLTables common to them (the decoders also initialized the VLCs of these RLTables). This is an obstacle to making these codecs init-threadsafe. So move this initialization to ff_msmpeg4_common_init() that already contains this initialization code. This allows to reuse the AVOnce used for initializing ff_v2_dc_lum/chroma_table which automatically makes initializing these RLTables thread-safe. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/msmpeg4: ReindentationAndreas Rheinhardt2021-04-27
| | | | | | | Forgotten in/after f5957f3fe2b8dfda13a9750acc3e3a03cd5d39c9. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/msmpeg4: Make ff_msmpeg4_common_init() thread-safeAndreas Rheinhardt2021-04-27
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg4videoenc: Make encoder init-threadsafeAndreas Rheinhardt2021-04-27
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg4video: Make initializing RLTable thread-safeAndreas Rheinhardt2021-04-27
| | | | | | | | | | | Up until now the RLTable ff_mpeg4_rl_intra was initialized by both mpeg4 decoder and encoder (except the VLCs that are only used by the decoder). This is an obstacle to making these codecs init-threadsafe, so move initializing this to a single function that is guarded by a dedicated AVOnce. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ituh263enc: Make static initializations thread-safeAndreas Rheinhardt2021-04-27
| | | | | | | | | | | | This already makes several encoders (namely FLV, H.263, H.263+ and RealVideo 1.0 and 2.0 and SVQ1) that use this init-threadsafe. It also makes the Snow encoder init-threadsafe; it was already marked as such since commit d49210788b0836d56dd872d517fe73f83b080101, because it was thought to be harmless if one and the same object was initialized by multiple threads at the same time. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/encode: Zero padding in ff_get_encode_buffer()Andreas Rheinhardt2021-04-27
| | | | | | | | | | | | | The documentation of the get_encode_buffer() callback does not require to zero the padding; therefore we do it in ff_get_encode_buffer(). This also constitutes an implicit check for whether the buffer is actually allocated with padding. The memset in avcodec_default_get_encode_buffer() is now redundant and has been removed. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq3: Free array of frames in a loopAndreas Rheinhardt2021-04-26
| | | | | | Avoids code duplication Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq3: Remove unused function parameterAndreas Rheinhardt2021-04-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ivi: Fix indentationAndreas Rheinhardt2021-04-26
| | | | | | | Also improve readability by keeping a pointer to the IVIBandDesc that is currently freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc2enc: Actually zero paddingAndreas Rheinhardt2021-04-26
| | | | | | | | This encoder sets the min_size in ff_alloc_packet2(), so it can not rely on av_packet_make_refcounted() to zero the padding. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ttmlenc: add support for region positioning and sizingJan Ekström2021-04-26
| | | | | | | | The ASS margins are utilized to generate percentual values, as the usage of cell-based sizing and offsetting seems to be not too well supported by renderers. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec/ttmlenc: add initial support for regions and stylesJan Ekström2021-04-26
| | | | | | | | | Attempts to utilize the TTML cell resolution as a mapping to the reference resolution, and maps font size to cell size. Additionally sets the display and text alignment according to the ASS alignment number. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/ttmlenc: enable writing out additional header valuesJan Ekström2021-04-26
| | | | | | | | | | This way the encoder may pass on the following values to the muxer: 1) Additional root "tt" element attributes, such as the subtitle canvas reference size. 2) Anything before the body element of the document, such as regions in the head element, which can configure styles. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec/ttmlenc: split header writing into its own functionJan Ekström2021-04-26
| | | | Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec/adpcmenc: Adds encoder for Westwood ADPCM.Aidan Richmond2021-04-26
| | | | | Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: Fixes output from Westwood ADPCM.Aidan Richmond2021-04-26
| | | | | | | | Fixes bug #9198 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/mjpegdec: postpone calling ff_get_buffer() until the SOS markerJames Almer2021-04-25
| | | | | | | | | | | | | | | With JPEG-LS PAL8 samples, the JPEG-LS extension parameters signaled with the LSE marker show up after SOF but before SOS. For those, the pixel format chosen by get_format() in SOF is GRAY8, and then replaced by PAL8 in LSE. This has not been an issue given both pixel formats allocate the second data plane for the palette, but after the upcoming soname bump, GRAY8 will no longer do that. This will result in segfauls when ff_jpegls_decode_lse() attempts to write the palette on a buffer originally allocated as a GRAY8 one. Work around this by calling ff_get_buffer() after the actual pixel format is known. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/adpcm: init from extradata before setting sample formatsZane van Iperen2021-04-25
| | | | | | | | | Fixes a crash when decoding VQA files. Regression since c012f9b265e172de9c240c9dfab8665936fa3e83. Reported-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/exr: Return correct error code on allocation failureAndreas Rheinhardt2021-04-24
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Actually honour the documentation of subtitle_headerAndreas Rheinhardt2021-04-24
| | | | | | | | | | It is only supposed to be freed by libavcodec for decoders, yet avcodec_open2() always frees it on failure. Furthermore, avcodec_close() doesn't free it for decoders. Both of this has been changed. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/av1_metadata: don't store the inserted TD OBU in stackJames Almer2021-04-23
| | | | | | | | | Fixes: stack-use-after-return Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-5931515701755904 Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-6105676541722624 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/faxcompr: Check remaining bits on error in decode_group3_1d_line()Michael Niedermayer2021-04-22
| | | | | | | | Fixes: Timeout Fixes: 32886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4779761466474496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeglsdec: Don't presume the context to contain a JLSStateAndreas Rheinhardt2021-04-20
| | | | | | | | | | | | | | | Before 9b3c46a081a9f01559082bf7a154fc6be1e06c18 every call to ff_jpegls_decode_picture() allocated and freed a JLSState. This commit instead put said structure into the context of the JPEG-LS decoder to avoid said allocation. But said function can also be called from other MJPEG-based decoders and their contexts doesn't contain said structure, leading to segfaults. This commit fixes this: The JLSState is now allocated on the first call to ff_jpegls_decode_picture() and stored in the context. Found-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/utils: Check ima wav duration for overflowMichael Niedermayer2021-04-20
| | | | | | | | Fixes: signed integer overflow: 44331634 * 65 cannot be represented in type 'int' Fixes: 32120/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-5760221223583744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rv10: Execute whole size check earlier for rv20Michael Niedermayer2021-04-20
| | | | | | | | Fixes: Timeout Fixes: 31380/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5230899257016320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Include attributes.h directlyAndreas Rheinhardt2021-04-19
| | | | | | | | Some files currently rely on libavutil/cpu.h to include it for them; yet said file won't use include it any more after the currently deprecated functions are removed, so include attributes.h directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/aarch64: add pred16x16 10-bit functionsMikhail Nitenko2021-04-19
| | | | | | | | | | | | | | Benchmarks: A53 A72 pred16x16_dc_10_c: 136.0 124.0 pred16x16_dc_10_neon: 121.2 106.0 pred16x16_horizontal_10_c: 155.0 73.2 pred16x16_horizontal_10_neon: 82.2 67.7 pred16x16_top_dc_10_c: 106.0 93.7 pred16x16_top_dc_10_neon: 87.7 77.2 pred16x16_vertical_10_c: 83.0 67.7 pred16x16_vertical_10_neon: 54.2 61.7 Some functions work slower than C and are left commented out.
* lavc/aarch64: change h264pred_init structureMikhail Nitenko2021-04-19
| | | | Change structure to allow the addition of other bit depths.
* avcodec/nvenc: fix lossless tuning logicTimo Rothenpieler2021-04-18
| | | | | | | | | | | | Relying on the order of the enum is bad. It clashes with the new presets having to sit at the end of the list, so that they can be properly filtered out by the options parser on builds with older SDKs. So this refactors nvenc.c to instead rely on the internal NVENC_LOSSLESS flag. For this, the preset mapping has to happen much earlier, so it's moved from nvenc_setup_encoder to nvenc_setup_device and thus runs before the device capability check.
* lavc/libaomdec: fix build with 1.0.0Anton Khirnov2021-04-18
| | | | | aom_codec_frame_flags_t in libaom 1.0.0 is defined in aom_encoder.h, whereas for newer versions it was moved to aom_codec.h
* avcodec/jpeglsdec: Don't allocate+free JPEGLSState for every frameAndreas Rheinhardt2021-04-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/exr: increase vlc depthMichael Niedermayer2021-04-17
| | | | | | | | Fixes: shift exponent -4 is negative Fixes: 32265/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-465133454137753 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dpx: Check bits_per_color earlierMichael Niedermayer2021-04-17
| | | | | | | | Fixes: shift exponent 251 is too large for 32-bit type 'int' Fixes: 32147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5519111675314176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libaomdec: export frame pict_typeJames Almer2021-04-16
| | | | | | Should fix ticket #9180 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libwebpenc_animencoder: set the correct packet ptsJames Almer2021-04-16
| | | | | | | The only packet produced by this encoder contains the entire animated stream, so set its pts to the first frame encoded. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libwebpenc_animencoder: stop propagating bogus empty packetsJames Almer2021-04-16
| | | | | | | | | | Packets must have at least one of data or side_data. If none are available, then got_packet must not be signaled. The generic encode code already discarded these empty packets, but it's better just not propagating them at all. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nellymoserenc: Fix segfault when using unsupported channels/rateAndreas Rheinhardt2021-04-15
| | | | | | | | | NellyMoserEncodeContext.avctx is only set in init after these checks, yet it is used by encode_end(). This is a regression since 0a56bfa71f751a2b25da8d060a019c1c75ca9d7b. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: update exported AVOptions in the user-facing contextJames Almer2021-04-14
| | | | | | | This prevents bogus values being reported on frame multithreaded decoding scenarios. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264dec: update exported AVOptions in the user-facing contextJames Almer2021-04-14
| | | | | | | | Based on a patch by Hendrik Leppkes. Fixes ticket #9176. Signed-off-by: James Almer <jamrial@gmail.com>
* pthread_frame: introduce a codec callback to update the user-facing contextHendrik Leppkes2021-04-14
|
* avcodec/h264dec: add missing flags to is_avc and nal_length_size AVOptionsJames Almer2021-04-14
| | | | Signed-off-by: James Almer <jamrial@gmail.com>