summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* lavc/mips: simplify the switch codeLinjie Fu2019-12-12
| | | | | Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/x265: set preferred_transfer_characteristics for HLGZhong Li2019-12-12
| | | | | | | | | | | "HEVC HDR UHDTV Bitstreams using HLG10 shall also contain the alternative_transfer_characteristics SEI message. The alternative_transfer_characteristics SEI message shall be inserted on the HEVC DVB_RAP, and preferred_transfer_characteristics shall be set equal to "18", indicating Recommendation ITU-R BT. 2100 [45] HLG system." Signed-off-by: Zhong Li <zhongli_dev@126.com>
* lavc/qsvenc: add Tiles encode support for HEVCLinjie Fu2019-12-12
| | | | | | | | | | | | | | | | | | | | | | Add -tile_rows and -tile_cols option to specify the number of tile rows and columns for ICL+ (gen 11) platform. A tile must wholly contain all the slices within it. Slices cannot cross tile boundaries. So the slice number would be implicitly resized to the max(nSlice, nTile). Example: ffmpeg -v verbose -hwaccel qsv -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -s:v 1920x1080 -i ./input.nv12 -vf format=nv12,hwupload=extra_hw_frames=64 -c:v hevc_qsv -tile_rows 2 -tile_cols 2 -slices 4 -y output.h265 Also dump the actual quantity of encoded tiled rows and columns in run time. Fix the enhancement #8400. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc: add MPEG-H 3D Audio codec idYuki Tsuchiya2019-12-12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/codec_desc: introduce AV_CODEC_PROP_INTRA_ONLY flag to audio codecYuki Tsuchiya2019-12-12
| | | | | | | Introduce AV_CODEC_PROP_INTRA_ONLY flag to audio codec as well as video codec to support non intra-only audio codec. Signed-off-by: Yuki Tsuchiya <Yuki.Tsuchiya@sony.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mlp_parser: mark sync frames as key framesJames Almer2019-12-12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ↵James Almer2019-12-11
| | | | | | | | | | | | | | | | | | | | | | ar_coeffs_cr_plus_128 Taking into account the code fb(2, ar_coeff_lag); num_pos_luma = 2 * current->ar_coeff_lag * (current->ar_coeff_lag + 1); if (current->num_y_points) num_pos_chroma = num_pos_luma + 1; else num_pos_chroma = num_pos_luma; Max value for ar_coeff_lag is 3 (two bits), for num_pos_luma 24, and for num_pos_chroma 25. Both ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 may have up to num_pos_chroma values. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: rename enable_intraintra_compound flagFei Wang2019-12-11
| | | | | | | | rename enable_intraintra_compound to enable_interintra_compound, which keep same as AV1 sepc(v1.0.0-errata1). Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: avoid reading trailing bits when obu type is OBU_TILE_LISTFei Wang2019-12-10
| | | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/agm: Do not allow MVs out of the picture area as no edge is allocatedMichael Niedermayer2019-12-10
| | | | | | | | Fixes: out of array access Fixes: 18499/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5749038406434816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmalosslessdec: Set FF_CODEC_CAP_INIT_CLEANUPMichael Niedermayer2019-12-10
| | | | | | | | | Fixes: memleaks Fixes: 18429/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-6210814364614656 Fixes: 18722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5680535690543104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Fix 2 integer overflowsMichael Niedermayer2019-12-10
| | | | | | | | Fixes: signed integer overflow: 2119056926 - -134217728 cannot be represented in type 'int' Fixes: 18728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5747539563511808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: Set packet_loss when we error out on a sanity checkMichael Niedermayer2019-12-10
| | | | | | | | Fixes: left shift of negative value -34 Fixes: 18719/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAPRO_fuzzer-5642658173419520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: Check offsetMichael Niedermayer2019-12-10
| | | | | | | | Fixes: index 33280 out of bounds for type 'float [32768]' Fixes: 18718/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-5635373899710464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()Michael Niedermayer2019-12-10
| | | | | | | | Fixes: signed integer overflow: 1778647621 + 574372924 cannot be represented in type 'int' Fixes: 18692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-6248679635943424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: Check if the channel sum of all internal contexts match ↵Michael Niedermayer2019-12-10
| | | | | | | | | | the external Fixes: NULL pointer dereference Fixes: 18689/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5715114640015360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/truespeech: Fix an integer overflow in truespeech_synth()Michael Niedermayer2019-12-10
| | | | | | | | Fixes: signed integer overflow: 2147483188 + 2048 cannot be represented in type 'int' Fixes: 18741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUESPEECH_fuzzer-5748950460268544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Remove redundant ;Michael Niedermayer2019-12-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/atrac9dec: Check q_unit_cnt more completely before using it to ↵Michael Niedermayer2019-12-07
| | | | | | | | | | | access at9_tab_band_ext_group Fixes: index 8 out of bounds for type 'const uint8_t [8][3]' Fixes: 19127/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5709394985091072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/cbs_h2645: Fix incorrect max size of nalu unitAndriy Gelman2019-12-06
| | | | | | | | | | | In the worst case the startcode prefix has 4 bytes. This fixes a trigerred assertion: Assertion dp <= max_size failed at libavcodec/cbs_h2645.c:1451 Found-by:libFuzzer Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/mvha: Check remaining space when reading VLC table probabilitiesMichael Niedermayer2019-12-06
| | | | | | | | | Fixes: Infinite loop Fixes: 19183/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5666216765292544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fitsdec: Use lrint()Michael Niedermayer2019-12-05
| | | | | | | | | | Fixes: fate-fitsdec-bitpix-64 Possibly Fixes: -nan is outside the range of representable values of type 'unsigned short' Possibly Fixes: 17769/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5678314672357376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: avcodec/tta: Set extradata_size to 22Andreas Rheinhardt2019-12-04
| | | | | | | | | | | | | | | Up until c4e0e314, the seek table has been included in the tta extradata, so that the size of said extradata was 22 (the size of a TTA1 header) + 4 * number of frames. The decoder rejected anything below a size of 30 and so the Matroska demuxer exported 30 byte long extradata, of which only 18 were set (it ignores a CRC-32 and simply leaves it at 0). But this is unnecessary since said commit, so reduce the size to 22. Furthermore, replace 30 by 22 in a comment about the extradata size in libavcodec/tta.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/libxavs2.c: optimize error descriptionshwren2019-12-04
| | | | | Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libxavs2.c: fix code style - spaceshwren2019-12-04
| | | | | Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libxavs2.c: avoid recomputations of pointers in xavs2_copy_frame* functionshwren2019-12-04
| | | | | Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libxavs2.c: use more descriptive variable names in xavs2_copy_frame* ↵hwren2019-12-04
| | | | | | | functions Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/av1_parser: skip frames with spatial_id > 0James Almer2019-12-02
| | | | | | This fixes marking keyframes in svc samples. Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use"James Almer2019-12-01
| | | | | | | | This reverts commit 8174e5c77d8a94b57b6b1bcbb90728cf8b08ab6b. It's no longer needed after the previous commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: implement missing set_frame_refs() functionJames Almer2019-12-01
| | | | | | | | | Defined in Section 7.8 This finishes implementing support for frames using frame_refs_short_signaling. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/alsdec: Discard frames for which no channel could be decodedMichael Niedermayer2019-12-01
| | | | | | | | Fixes: Timeout (80sec -> 33sec) Fixes: 18668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5710836719157248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alsdec: Avoid 1 layer of pointer dereferences in INTERLEAVE_OUTPUT()Michael Niedermayer2019-12-01
| | | | | | | This optimizes the code slightly (116 -> 80sec) Testcase: 18668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5710836719157248 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g729dec: Avoid one multiply by using init_get_bits8()Michael Niedermayer2019-12-01
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g729dec: Avoid using buf_sizeMichael Niedermayer2019-12-01
| | | | | | | | | | | buf_size is not updated as buf is advanced so it is wrong after the first iteration Fixes: Timeout (160sec -> 27sec) Fixes: 18658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-5729784269373440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g729dec: Factor block_size outMichael Niedermayer2019-12-01
| | | | | | This will be used in the next commit Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g729dec: require buf_size to be non 0Michael Niedermayer2019-12-01
| | | | | | | | | | The 0 case was added with the support for multiple packets. It appears unintended and causes extra complexity and out of array accesses (though within padding) No testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g729dec: Check for KELVIN && 6k4Michael Niedermayer2019-12-01
| | | | | | | | | | This combination would assume different block sizes throughout the code so its better to error out. Fixes: signed integer overflow: -1082385168 * 2 cannot be represented in type 'int' Fixes: 19110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-5643993950191616 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Fix integer overflow in lpc_prediction() with signMichael Niedermayer2019-12-01
| | | | | | | | Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int' Fixes: 18643/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5672182449700864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: Fix buflen computation in save_bits()Michael Niedermayer2019-12-01
| | | | | | | | Fixes: Assertion failure Fixes: 18630/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAPRO_fuzzer-5201588654440448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_block: Fix integer overflow in AC rescaling in ↵Michael Niedermayer2019-12-01
| | | | | | | | | | vc1_decode_i_block_adv() Fixes: signed integer overflow: 50176 * 262144 cannot be represented in type 'int' Fixes: 18629/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5182370286403584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vmdaudio: Check chunk counts to avoid integer overflowMichael Niedermayer2019-12-01
| | | | | | | | Fixes: signed integer overflow: 4 * 538976288 cannot be represented in type 'int' Fixes: 18622/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5092166174507008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/extract_extradata: Use bytestream apiAndriy Gelman2019-11-30
| | | | | Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/extract_extradata_bsf: Don't unref uninitialized buffersAndreas Rheinhardt2019-11-30
| | | | | | | | This happens if allocating extradata fails and s->remove is unset. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1_parser: export stream dimensions in avctxJames Almer2019-11-29
| | | | | | This is required to demux annexb samples when a decoder isn't available. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/mvha: Check init_get_bits8() for failureJun Zhao2019-11-29
| | | | | | fix potential null pointer dereference Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/vp8: fix multiple ff_thread_finish_setup() callsZhao Zhili2019-11-28
| | | | | | | | | | webp decoder doesn't set update_thread_context field $ ffmpeg -i rgb_q80.webp -f null - [webp @ 0x7ffbd5823200] Multiple ff_thread_finish_setup() calls Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/qsvenc: Fix some code indentationsLinjie Fu2019-11-28
| | | | Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* Add options for spatial layers.Thierry Foucu2019-11-28
| | | | | | | | Disable by default to output all the layers, to match libaomdec wrapper. Add option to select the operating point for the spatial layers. Update the documentation with the new options. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add mvha video decoderPaul B Mahol2019-11-27
|
* avcodec: add mvdv video decoderPaul B Mahol2019-11-27
|