aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/exr: use lookuptable for alpha if there is no trc_funcMark Reid2020-11-201-1/+1
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/wavpack: use av_buffer_replace() to simplify codeGil Pedersen2020-11-191-4/+3
| | | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Gil Pedersen <git@gpost.dk> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mobiclip: Use get_ue_golomb_31() where possibleAndreas Rheinhardt2020-11-151-4/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs_av1: remove dead codeJames Almer2020-11-131-3/+0
| | | | | | | | | | The other branch already covers cases where enable_order_hint is true and frame is of type Inter. Regression since ddb0e4fecdef24e8c7b90fa0a41d13e642ea732f Fixes Coverity issues #1469194 and #1469195. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp3dsp: Use unsigned constant to avoid undefined integer overflow in ↵Michael Niedermayer2020-11-131-1/+1
| | | | | | | | | | | ff_vp3dsp_set_bounding_values() Fixes: signed integer overflow: 64 * 33686018 cannot be represented in type 'int' Fixes: 26911/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-4904975073017856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvdec_av1: fix setting film grain parameters for frames with ↵James Almer2020-11-131-26/+31
| | | | | | | | | update_grain == 0 The spec in section 6.8.20 states the parameters should be loaded from a reference frame indexed by film_grain_params_ref_idx. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1dec: remove order_hint from AV1FrameJames Almer2020-11-132-7/+2
| | | | | | We now have access to the raw frame header, so use that Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1dec: add a reference to the raw frame header to AV1FramesJames Almer2020-11-132-0/+17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dxva2: add AV1 decode supportHendrik Leppkes2020-11-126-4/+545
| | | | Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMVAndreas Rheinhardt2020-11-121-0/+1
| | | | | | | Fixes Coverity ID 1469181. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nvdec: add av1 hwaccelTimo Rothenpieler2020-11-117-2/+367
| | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org> Co-authored-by: James Almer <jamrial@gmail.com>
* avcodec/nvdec: add support for separate reference frameTimo Rothenpieler2020-11-112-2/+41
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/av1dec: expose coded_losslessTimo Rothenpieler2020-11-112-0/+35
| | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org> Co-authored-by: James Almer <jamrial@gmail.com>
* avcodec/av1dec: expose skip mode frame indexTimo Rothenpieler2020-11-112-0/+85
| | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org> Co-authored-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add a range check to tg_endJames Almer2020-11-113-2/+8
| | | | | | | | | | | Section 6.10.1 of the AV1 spec states: It is a requirement of bitstream conformance that the value of tg_start is equal to the value of TileNum at the point that tile_group_obu is invoked. It is a requirement of bitstream conformance that the value of tg_end is greater than or equal to tg_start. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer ref_order_hint when not coded in the bitstreamJames Almer2020-11-111-2/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/gdv: Remove dead checkAndreas Rheinhardt2020-11-101-1/+1
| | | | | | | | | | | | | At the end of its decode function, the decoder sets *got_frame to 1 and then checks whether ret is < 0; if so, it is returned, otherwise avpkt->size is. But it is impossible for ret to be < 0 here and if it were, it would be nonsense to set *got_frame to 1 before this. Therefore just return avpkt->size unconditionally. Fixes Coverity issue #1439730. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/utils: clear the packet props queue on flushingJames Almer2020-11-091-0/+4
| | | | | | | This ensures no queued timestamps or side data are kept and used after seeking, preventing potential desyncs. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add adpcm_ima_amv encoderZane van Iperen2020-11-093-1/+59
| | | | | | Fixes ticket #747. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_amv: document header formatZane van Iperen2020-11-091-0/+10
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_amv: use coded sample countZane van Iperen2020-11-091-1/+18
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_amv: restrict to 1 channelZane van Iperen2020-11-092-2/+5
| | | | | | The format doesn't allow for anything else. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* lavc/amfenc: Add hardware config metadataOvchinnikovDmitrii2020-11-084-0/+17
| | | | | | | | Without this metadata section the ffmpeg utility thinks that the AMF encoder does not support input from D3D11 and DXVA2 hardware surfaces, causing hardware pipelines to fail. Fixes #8953.
* lavc: Mark hw_config pointer arrays as constMark Thompson2020-11-0814-14/+14
| | | | They are read-only just like the HWConfig structures they point to.
* avcodec/adpcm_ima_swf: fix frame size to 4096Zane van Iperen2020-11-071-1/+1
| | | | | | | | | SWF File Format Specification, Version 19 says this is 1 raw sample + 4095 nibbles. https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* Revert "avcodec/adpcm_swf: support decoding multiple fixed-sized blocks at once"Zane van Iperen2020-11-071-13/+2
| | | | | | | | | | | | | | Is incorrect behaviour. Was covering for an encoder bug where it produced frames of the wrong size. This reverts commit e9dd73d30d09043446ac6dd7b8ad31e557873852. Fixes: out of array write Fixes: 26821/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_SWF_fuzzer-5764465137811456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/truemotion2: Allocate buffers togetherAndreas Rheinhardt2020-11-061-27/+19
| | | | | | Reduces the number of allocations and frees. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/truemotion2: Cleanup generically on init failureAndreas Rheinhardt2020-11-061-11/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/truemotion2: Remove redundant initializationsAndreas Rheinhardt2020-11-061-7/+1
| | | | | | The codec's private context has already been zeroed generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/truemotion2: Replace av_free() by av_freep() in AVCodec.closeAndreas Rheinhardt2020-11-061-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sonic: Don't allocate a temporary buffer for every frameAndreas Rheinhardt2020-11-061-12/+4
| | | | | | Instead allocate it together with the buffer that it mirrors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mss4: Fix memleaks upon allocation errorAndreas Rheinhardt2020-11-061-5/+2
| | | | | | | | | | During init the mts2 decoder allocates several VLCs and then several buffers in a loop; if one of the latter allocations fails, only the VLCs are freed, not any buffers that might already have been successfully allocated. This commit fixes this by setting the FF_CODEC_CAP_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sonic: Don't hardcode sizeof(int) == 4Andreas Rheinhardt2020-11-041-2/+2
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/sonic: Allocate several buffers togetherAndreas Rheinhardt2020-11-041-27/+21
| | | | | | | It simplifies freeing them and reduces the amount of allocations. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* vaapi_encode_mpeg2: Fix setting colour propertiesMark Thompson2020-11-031-9/+8
| | | | | | | Follow the same pattern as the previous commits for H.264 and H.265. Reviewed-By: Jan Ekström <jeebjp@gmail.com> Tested-By: Xu, Yefeng <yefengx.xu@intel.com>
* vaapi_encode_h265: Fix setting colour propertiesMark Thompson2020-11-031-22/+12
| | | | | | | Matching the previous commit for H.264. Reviewed-By: Jan Ekström <jeebjp@gmail.com> Tested-By: Xu, Yefeng <yefengx.xu@intel.com>
* vaapi_encode_h264: Fix setting colour propertiesMark Thompson2020-11-031-22/+12
| | | | | | | | | | The properties should always be set; only the presence flags want to be conditional. Fixes #8959. Reviewed-By: Jan Ekström <jeebjp@gmail.com> Tested-By: Xu, Yefeng <yefengx.xu@intel.com>
* avcodec/mpc8: Unobfuscate sign-extensionAndreas Rheinhardt2020-11-031-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mimic: Inline constantsAndreas Rheinhardt2020-11-031-2/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/tscc2: Don't check for errors for complete VLCsAndreas Rheinhardt2020-11-031-6/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/utils: add adpcm_ima_alp to av_get_exact_bits_per_sample()Zane van Iperen2020-11-031-0/+1
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/magicyuv: Free previous VLC tableMichael Niedermayer2020-11-031-0/+1
| | | | | | | | | | | Fixes: memleak Fixes: 26788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-5184116808744960 Regression since: 1bf30a1beb7527887c9b466d07765d20fa3b5412 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add av1 VAAPI decoderFei Wang2020-11-026-2/+300
| | | | | | | | | Example cmdline: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -v verbose \ -c:v av1 -i input.ivf -pix_fmt yuv420p -vsync passthrough -f md5 \ -y out.md5 Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* avcodec/nvenc: fix build with older SDKsTimo Rothenpieler2020-10-301-3/+0
|
* avcodec/nvenc: only enforce explicitly set twopass modeTimo Rothenpieler2020-10-301-1/+1
|
* avcodec/nvenc: only auto-pick vbr rc in cq modeTimo Rothenpieler2020-10-301-1/+1
|
* avcodec/nvenc: all presets are SDK10 presets nowTimo Rothenpieler2020-10-291-26/+16
|
* avcodec/utils: Check sample rate before use for AV_CODEC_ID_BINKAUDIO_DCT in ↵Michael Niedermayer2020-10-291-1/+4
| | | | | | | | | | get_audio_frame_duration() Fixes: shift exponent 95 is too large for 32-bit type 'int' Fixes: 26590/clusterfuzz-testcase-minimized-ffmpeg_dem_SMACKER_fuzzer-5120609937522688 Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp3: Don't check for errors for complete VLCAndreas Rheinhardt2020-10-291-5/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cllc: Don't unnecessarily free VLCAndreas Rheinhardt2020-10-291-8/+3
| | | | | | | | | | | The Canopus Lossless decoder uses several VLCs and if initializing the ith VLC fails, all the VLCs 0..i have been freed; the ith VLC's table is initialized to NULL for this purpose. Yet it is totally unnecessary to free the ith VLC table at all: ff_init_vlc_sparse() cleans up after itself on error and if an error happens before ff_init_vlc_sparse(), the ith VLC hasn't been touched yet and doesn't need freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>