summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/h264dec: Disable forced small_padding on flag2 fastMichael Niedermayer2020-06-021-1/+1
| | | | | | | Fixes: 20978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5746381832847360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: clear pointer which become stale in get_ppt()Michael Niedermayer2020-06-011-0/+1
| | | | | | | | | Fixes: use after free Fixes: 22484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5671488765296640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvenc: zero avg and max bitrate in CQ modeRoman Arzumanyan2020-06-011-2/+7
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/encode: Remove ff_alloc_packetAndreas Rheinhardt2020-06-012-7/+0
| | | | | | | It is no longer used anymore. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12enc: support mpeg2 encoder const profileLimin Wang2020-06-012-0/+10
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: add constants for KLV pseudo-profile.Brad Hards2020-05-311-0/+3
| | | | | | | | | | | | | | | | | There are two different ways KLV is used in MISB specs - sync and async. The corresponding text (in ST1401) says: ISO/IEC 13818-1 Table-34 defines a stream_type = 0x15 for “Metadata carried in PES packets,” and Table 2-22 defines a stream_id = 0xFC for “metadata stream.” and In ISO/IEC 13818-1, Table-34 defines a stream_type = 0x06 for “PES packets containing private data,” and Table 2-22 defines a stream_id = 0xBD for “private_stream_1.” These constants allow us to distinguish the two cases, as codec profiles. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/anm: Don't unnecessarily use context variablesAndreas Rheinhardt2020-05-311-20/+19
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/anm: Check extradata length before allocating frameAndreas Rheinhardt2020-05-311-5/+3
| | | | | | | | Then one doesn't need to free the frame in case the length turns out to be insufficient. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add PFM image decoderPaul B Mahol2020-05-308-5/+85
|
* avcodec/adpcm_data: extend ff_adpcm_ima_cunning_index_tableMichael Niedermayer2020-05-292-3/+3
| | | | | | | | Fixes: overread by 1 Fixes: 21880/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_CUNNING_fuzzer-5717917221257216.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libx264: misc style fixesJun Zhao2020-05-281-38/+38
| | | | | | commit 4ed3a01d717 missed coding style fix. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/decode: fix decoding when frames are allocated using ↵James Almer2020-05-271-1/+2
| | | | | | | | | AVHWAccel.alloc_frame() Regression since a1133db30ef07896afd96f067e5c51531a4e85ab Found-by: comex <comexk@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/adpcmenc: fix formattingZane van Iperen2020-05-271-5/+5
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add adpcm_ima_ssi encoderZane van Iperen2020-05-275-1/+36
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcmenc: add capabilities argument to ADPCM_ENCODER()Zane van Iperen2020-05-271-17/+18
| | | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264dec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-271-3/+1
| | | | | | | | | | | then ff_h264_free_tables() and h264_decode_end() can be removed in h264_decode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-278-1/+13
| | | | | | | | | | then ff_mpv_encode_end() will be unnecessary in ff_mpv_encode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/adpcmenc: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-271-1/+1
| | | | | | | then we can remove adpcm_encode_close() in adpcm_encode_init() if have failed. so the goto error lable will be unnecessary and can be removed later. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec.h: move avcodec_get_{type,name} to codec_id.hAnton Khirnov2020-05-272-11/+12
|
* avcodec.h: split AVCodec API into its own headerAnton Khirnov2020-05-274-416/+466
|
* lavc/vaapi_hevc: add missing max_8bit_constraint_flagLinjie Fu2020-05-271-0/+1
| | | | | | This is accidentally missed while rebasing. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/hevc_refs: Fix the logic of find_ref_idx()Xu Guangxin2020-05-271-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Currently find_ref_idx() would trigger 2 scans in DPB to find the requested POC: 1. Firstly, ignore MSB of ref->poc and search for the requested POC; 2. Secondly, compare the entire ref->poc with requested POC; For long term reference, we are able to only check LSB if MSB is not presented(e.g. delta_poc_msb_present_flag == 0). However, for short term reference, we should never ignore poc's MSB and it should be kind of bit-exact. (Details in 8.3.2) Otherwise this leads to decoding failures like: [hevc @ 0x5638f4328600] Error constructing the frame RPS. [hevc @ 0x5638f4328600] Error parsing NAL unit #2. [hevc @ 0x5638f4338a80] Could not find ref with POC 21 Error while decoding stream #0:0: Invalid data found when processing input Search the requested POC based on whether MSB is used, and avoid the 2-times scan for DPB buffer. This benefits both native HEVC decoder and integrated HW decoders. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/hevc: Add poc_msb_present filed in LongTermRPSXu Guangxin2020-05-272-3/+3
| | | | | | | | | | delta_poc_msb_present_flag is needed in find_ref_idx() to indicate whether MSB of POC should be taken into account. Details in 8.3.2. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* mfenc: Avoid including codecapi.h, fix building in UWP mode with clangMartin Storsjö2020-05-272-7/+14
| | | | | | | | | | | | | Including codecapi.h and uuids.h in UWP mode doesn't define all defines properly, ending up with constructs that MSVC silently tolerates, but that clang errors out on, like this: DEFINE_GUIDEX(CODECAPI_AVEncCommonFormatConstraint); Just avoid including codecapi.h completely and hardcode the last few enum values we use from there. We already use local versions of most enums from there, due to older mingw-w64 headers being incomplete. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Remove an unused includeMartin Storsjö2020-05-271-3/+1
| | | | | | | This might have been used originally for the decoder parts of the MediaFoundation wrapper, which aren't merged yet. Signed-off-by: Martin Storsjö <martin@martin.st>
* opusenc: add apply_phase_inv optionLynne2020-05-263-2/+4
| | | | | By popular request. Does the same as in libopusenc.
* pngdec: add ability to check chunk CRCLynne2020-05-261-0/+17
| | | | | | | | By default now, if AV_EF_CRCCHECK or AV_EF_IGNORE_ERR are enabled the decoder will skip the chunk and carry on with the next one. This should make the decoder able to decode more corrupt files because the functions which decode individual chunks will very likely error out if fed invalid data and stop the decoding of the entire image.
* mpegaudiodec_template: add ability to check CRCLynne2020-05-261-3/+17
| | | | | | A lot of files have CRC included. The CRC only covers 34 bytes at most from the frame but it should still be enough for some amount of error detection.
* apedec: add ability to check CRCLynne2020-05-261-1/+25
| | | | | | | | The CRC flag is only signalled once every few minutes but CRC is still always present so the patch uses the file version instead. CRC on 24-bit files wants non-padded samples so skip such files. Some corrupt samples may have been output before the final check depending on the -max_samples setting.
* avcodec/mediacodec_wrapper: use MediaFormat to probe frame color characteristicsMatthieu Bouron2020-05-251-0/+100
|
* avcodec/frame_thread_encoder: remove usage of avcodec_encode_video2()James Almer2020-05-252-14/+19
| | | | | | Call the encoder's internal AVCodec.encode2() function instead. Signed-off-by: James Almer <jamrial@gmail.com>
* h264dec: support exporting QP tables through the AVVideoEncParams APIAnton Khirnov2020-05-254-1/+67
|
* avcodec: move avcodec_flush_buffers from decode.c to utils.cJames Almer2020-05-242-44/+44
| | | | | | It's not a decoding exclusive function anymore. Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/libvpxenc: Don't free user-provided AVPacketAndreas Rheinhardt2020-05-231-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/libmp3lame: Don't free user-provided AVPacketAndreas Rheinhardt2020-05-231-2/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/libopusenc: Don't free user-provided AVPacketAndreas Rheinhardt2020-05-231-2/+0
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* mfenc: Fix building with clang in MSVC modeMartin Storsjö2020-05-231-0/+3
| | | | | | | | | | | | | | | Just including icodecapi.h + codecapi.h apparently misses some bits, that MSVC doesn't complain about, but Clang does. Thus add a missing header to the custom hacky include path (required for keeping ICodecAPI visible when building in UWP mode, as it is intended to). The issue in Windows SDK headers about ICodecAPI availability in UWP/app mode has been reported upstream at https://developercommunity.visualstudio.com/content/problem/1037125/icodecapi-not-visible-when-compiling-in-uwp-mode.html, and later also filed in Feedback Hub (which can't be linked to externally). Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/xiph: Return better error codesAndreas Rheinhardt2020-05-231-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ass: explicitly set ScaledBorderAndShadowOneric2020-05-231-0/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: move mpeg4 profiles to profiles.hMarton Balint2020-05-225-17/+31
| | | | | | Also bump micro version after the recent option changes. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: move msbc profile to encoderMarton Balint2020-05-222-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/options_table: remove dts profilesMarton Balint2020-05-221-5/+0
| | | | | | Our encoder (dcaenc) does not use any of these. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: move aacenc profiles to profiles.hMarton Balint2020-05-224-10/+20
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/options_table: make AVCodecContext->profile search for child constantsMarton Balint2020-05-221-23/+25
| | | | | | | | | This change makes it possible for child encoders to define custom profile option names which can be used for setting the AVCodecContext->profile. Also rename unit name to something rather unique, so it won't be used elsewhere. Signed-off-by: Marton Balint <cus@passwd.hu>
* mfenc: Fall back to avctx->time_base if avctx->framerate isn't setMartin Storsjö2020-05-221-1/+9
| | | | | | | | The framerate field is the one users are supposed to set, but not all users might be setting it, so it might be good to fall back time_base in that case. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Fix setting has_b_frames for max_b_frames == 1Martin Storsjö2020-05-221-1/+1
| | | | | | | This was a mistake in my own additions in 050b72ab5ef318605b305aa6cb920e8b52f1002e. Signed-off-by: Martin Storsjö <martin@martin.st>
* cbs_h265: Fix use of an uninitialized variableMartin Storsjö2020-05-221-1/+1
| | | | | | | This fixes test failures in fate-cbs-hevc-* in certain configurations since c53f9f436440be4e18. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/bsf: mention that av_bsf_send_packet() returning EAGAIN is not an errorJames Almer2020-05-221-2/+3
| | | | | | | | | | | | | | | EAGAIN is returned when input is provided but can't be consumed. The filtering process is unaffected in this case, and the function will be able to consume new input after retrieving filtered packets with av_bsf_receive_packet(). Remove the line about empty packets never failing added in 41b05b849f215b03eeb9e3608571ba47de64182a while at it. Even if it's currently the case, it unnecessarily constrains the API and could be changed in the future in case it needs to be extended. The user should always check for errors and never expect a call to never fail. Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec.h: split bitstream filters API into its own headerAnton Khirnov2020-05-2238-306/+368
|
* lavc: rename bsf.h to bsf_internal.hAnton Khirnov2020-05-2238-40/+40
| | | | This will allow adding a public header named bsf.h