summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/hevc_ps: add proper bound checks around cm_ref_layer_id in ↵HEADmasterClement Lecigne2023-05-172-7/+17
| | | | | | | colour_mapping_table. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* av1_parse: Don't reject zero-size padding OBUsMark Thompson2023-05-171-1/+3
| | | | Padding OBUs are not required to be nonempty.
* av1_parse: Remove unused getbits instanceMark Thompson2023-05-172-8/+1
|
* cbs_av1: Don't reject unknown metadataMark Thompson2023-05-173-2/+38
| | | | | | | Accept it and pass it through unchanged. The standard requires that decoders ignore unknown metadata, and indeed this is tested by some of the Argon coverage streams.
* cbs_av1: Add tracing headers for metadata typesMark Thompson2023-05-171-0/+10
| | | | Make it a little easier to interpret metadata in trace output.
* avcodec/mediacodec: Add VP8 encoderSamuel Mira2023-05-174-1/+34
| | | | | | | Connected FFmpeg to Mediacodec VP8 encoder. Signed-off-by: Samuel Mira <samuel.mira@qt.io> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec: Add AV1 encoderSamuel Mira2023-05-175-1/+113
| | | | | | | Connected FFmpeg to Mediacodec AV1 encoder Signed-off-by: Samuel Mira <samuel.mira@qt.io> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/vdpau_mpeg4: fix order of quant matrix coefficientsHendrik Leppkes2023-05-151-2/+3
| | | | | | The matrix coefficients are stored permutated for the IDCT, rather then in plain raster order, and need to be un-permutated for the hardware.
* avcodec/vdpau_mpeg12: fix order of quant matrix coefficientsHendrik Leppkes2023-05-151-2/+3
| | | | | | The matrix coefficients are stored permutated for the IDCT, rather then in plain raster order, and need to be un-permutated for the hardware.
* avcodec/nvdec_mpeg4: fix order of quant matrix coefficientsHendrik Leppkes2023-05-151-2/+3
| | | | | | The matrix coefficients are stored permutated for the IDCT, rather then in plain raster order, and need to be un-permutated for the hardware.
* avcodec/nvdec_mpeg2: fix order of quant matrix coefficientsHendrik Leppkes2023-05-151-2/+3
| | | | | | The matrix coefficients are stored permutated for the IDCT, rather then in plain raster order, and need to be un-permutated for the hardware.
* lavc/libdav1d: fix exporting framerateAnton Khirnov2023-05-152-7/+5
| | | | Same issues as in the previous commit.
* lavc/av1*: fix exporting framerateAnton Khirnov2023-05-155-15/+29
| | | | | | | | | * take num_ticks_per_picture_minus_1 into account, since that is a part of the framerate computation * stop exporting num_ticks_per_picture_minus_1 into AVCodecContext.ticks_per_frame, as that field is used for other purposes (in conjunction with repeat_pict, which is not used at all by av1)
* lavc: deprecate AVCodecContext.ticks_per_frameAnton Khirnov2023-05-1527-23/+158
| | | | | | | | For encoding, this field is entirely redundant with AVCodecContext.framerate. For decoding, this field is entirely redundant with AV_CODEC_PROP_FIELDS.
* lavc/libvpxenc: send frame durations to the encoderAnton Khirnov2023-05-151-2/+13
| | | | | Adapt similar code from libaomenc - stop using ticks_per_frame except as a last resort.
* lavc/libkvazaar,libopenh264enc: drop redundant checksAnton Khirnov2023-05-152-10/+0
| | | | The same check is present in encode_preinit_video().
* libaomenc: use AVCodecContext.framerate when availableAnton Khirnov2023-05-151-2/+6
|
* lavc/msmpeg4enc: use AVCodecContext.framerate when availableAnton Khirnov2023-05-151-1/+7
|
* lavc/ratecontrol: use AVCodecContext.framerate when availableAnton Khirnov2023-05-151-0/+3
|
* lavf: use AV_CODEC_PROP_FIELDS where appropriateAnton Khirnov2023-05-152-3/+3
| | | | | | | | | | H.264 and mpeg12 parsers need to be adjusted at the same time to stop using the value of AVCodecContext.ticks_per_frame, because it is not set correctly unless the codec has been opened. Previously this would result in both the parser and lavf seeing the same incorrect value, which would cancel out. Updating lavf and not the parsers would result in correct value in lavf, but the wrong one in parsers, which would break some tests.
* lavc/codec_desc: add a property for codecs that support field codingAnton Khirnov2023-05-153-5/+19
| | | | | | | Multiple places currently use AVCodecContext.ticks_per_frame > 1 to identify such codecs, which * requires a codec context * requires it to be open
* lavc: deprecate AV_CODEC_CAP_SUBFRAMESAnton Khirnov2023-05-1519-24/+98
| | | | There is nothing meaningful the caller can do with it.
* lavc/decode: drop a useless warningAnton Khirnov2023-05-152-9/+0
| | | | | | | | | | Decoders will currently warn if an audio decoder not marked with AV_CODEC_CAP_SUBFRAMES consumes less than the whole packet, but * this happens for regular files * this has no negative consequences * there is no meeaningful action that can or should be taken in response The warning is thus useless noise.
* avcodec/cbs_av1: add valid range of values for num_units_in_decoding_tickJames Almer2023-05-141-1/+1
| | | | | | The spec states "num_units_in_decoding_tick shall be greater than 0". Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/libsvtav1: Allow -1 for preset optionChristopher Degawa2023-05-111-2/+2
| | | | | | | | Currently, the -1 (MR) preset is disallowed as it's taken as the preset option not set, and the only way to access it was through svtav1-params. Signed-off-by: Christopher Degawa <ccom@randomderp.com> Signed-off-by: James Almer <jamrial@gmail.com>
* vcodec/vp8data: Move ff_vp8_dct_cat_prob to vp8data.cDai, Jianhui J2023-05-103-21/+45
| | | | | | | Avoid compiling error if included by multiple sources. Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avcodec/libmp3lame: make it possible to set copyright/original flagsLukáš Lalinský2023-05-101-3/+13
|
* lavc/codec_par: add AVCodecParameters.framerateAnton Khirnov2023-05-073-1/+16
| | | | This corresponds to AVCodecContext.framerate.
* avcodec/adpcm: Fix integer overflow in intermediate in ADPCM_XMDMichael Niedermayer2023-05-061-2/+2
| | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2140143616 + 254665816 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XMD_fuzzer-6690181676924928 As a sideeffect this simplifies the equation, the high bits are different after this but only the low 16bits are stored and used in later steps. 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/dpcm: fix undefined interger overflow in wadyMichael Niedermayer2023-05-061-1/+1
| | | | | | | | Fixes: signed integer overflow: -2147375930 + -133875 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WADY_DPCM_fuzzer-6703727013920768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tiff: add a zero DNG_LINEARIZATION_TABLE checkMichael Niedermayer2023-05-061-1/+1
| | | | | | | | | Fixes: index 4294967295 out of bounds for type 'uint16_t [65536]' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5950405086674944 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6666195176914944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()Michael Niedermayer2023-05-061-0/+3
| | | | | | | | Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6682195323650048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sonic: Fix two undefined integer overflowsMichael Niedermayer2023-05-061-2/+2
| | | | | | | | | Fixes: signed integer overflow: 2147483372 - -148624 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5477177805373440 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6681622236233728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: the IFF_ILBM implementation assumes that there are a multiple ↵Michael Niedermayer2023-05-061-1/+1
| | | | | | | | | | | of 16 allocated Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5124452659888128 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6362836707442688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/flacdec: Fix signed integre overflowMichael Niedermayer2023-05-061-1/+1
| | | | | | | | Fixes: signed integer overflow: 3011809745540902265 + 6323452730883571725 cannot be represented in type 'long' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-6687553022722048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: Cleanup befor returnMichael Niedermayer2023-05-061-6/+12
| | | | | | | | Fixes: leaks Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6703454090559488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Do not pass AVFrame into global header decodeMichael Niedermayer2023-05-061-1/+6
| | | | | | | | | | | The global header should not contain a frame, and decoding it would result in leaks Fixes: memleak Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-6603443149340672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: remove AVFrame argument from decode_iccp_chunk()Michael Niedermayer2023-05-061-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pdvdec: Check previous frame before using itMichael Niedermayer2023-05-061-1/+1
| | | | | | | | | Fixes: load of null pointer of type 'uint8_t' (aka 'unsigned char') Fixes: 58256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PDV_fuzzer-4776436325285888 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/libdav1d: support parsing multiple ITU-T T.35 entries in a pictureJames Almer2023-05-051-2/+11
| | | | | | This requires the newest libdav1d release. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/tak: do not store invalid values in stream infoAnton Khirnov2023-05-051-7/+13
| | | | | | | | | | When tak_get_nb_samples() fails, it will currently write AVERROR_INVALIDDATA as TAKStreamInfo.frame_samples. The parser will then use this negative value as a frame duration, which leads to various breakage. Avoid this by returning the error code from tak_parse_streaminfo() directly; never store negative values in the parsed header.
* lavc/tak: make ff_tak_parse_streaminfo staticAnton Khirnov2023-05-052-5/+3
| | | | It is not used outside of tak.c
* avutil/frame: deprecate key_frameJames Almer2023-05-042-0/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-04160-243/+371
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: deprecate interlaced_frame and top_field_firstJames Almer2023-05-042-0/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-0434-107/+130
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/options_table: reorder nokey after nointraZhao Zhili2023-05-041-1/+1
| | | | | | So the values are in ascending order. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/hevcdec: remove unused variables from hls_slice_dataZhao Zhili2023-05-041-8/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/avcodec: fix UB NULL+0Zhao Zhili2023-05-041-2/+3
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavf/dv: use a more granular timebase for audioAnton Khirnov2023-05-021-0/+3
| | | | | | | | | | | | | One that is fine enough to represent all DV audio sample rates. Audio packet durations are now sample-accurate. This largely undoes commit 76fbb0052df471075858c1cb82b04c8be7adba8d. To avoid breaking the issue fixed by that commit, resync audio timestamps against video if they get more than one frame apart. The sample from issue #8762 still works correctly after this commit. Slightly changes the results of the lavf-dv seektest, due to the audio timebase being more granular.