summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/avcodec: Don't include cpu.hAndreas Rheinhardt2021-07-22
| | | | | | | It is not used here at all; instead, add it where it is used without including it or any of the arch-specific CPU headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Don't include hwcontext.hAndreas Rheinhardt2021-07-22
| | | | | | | It is no longer used directly; but it is still indirectly included via codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Don't include errno.hAndreas Rheinhardt2021-07-22
| | | | | | | This inclusion has been added before libavutil/error.h was split off from avcodec.h (in 60c144f700e2e362047b00704abcb694d49e549c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including bsf.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include bsf.h directly wherever it is used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm_data: Move tables only used by adpcm.c to itAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm_data: Fix type mismatch for ff_adpcm_afc_coeffsAndreas Rheinhardt2021-07-22
| | | | | | | | According to the header it is an array of int16_t, yet it is declared as uint16_t. Fix this by using int16_t troughout and convert the definition to use values in the range of int16_t. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Don't include disabled AVCodecsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Disable dead codeAndreas Rheinhardt2021-07-22
| | | | | | | This change ensures that the linker can drop adpcm_data.o if no decoder that actually uses anything from there is enabled. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Fix indentationAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Use smaller scope for some variablesAndreas Rheinhardt2021-07-22
| | | | | | | | This is to avoid unused variables warnings after the code for the disabled encoders has been #if'ed away which will happen in a subsequent commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcmenc: Don't include disabled AVCodecsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcmenc: Deduplicate AVClassesAndreas Rheinhardt2021-07-22
| | | | | | | | The child_class_next API relied on different (de)muxers to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcmenc: #if disabled code away, fix build without ADPCM_ARGOAndreas Rheinhardt2021-07-22
| | | | | | | | | | | | | The adpcm_argo encoder does not use the data from adpcm_data.c directly; instead it shares a function with the adpcm_argo decoder that is in adpcm.c. When all the ADPCM decoders and the adpcm_argo encoder are disabled, adpcm.c is not compiled; yet the code in adpcmenc.c calling said function from adpcm.c is still present, leading to link errors. Fix this by disabling the code belonging to disabled codecs in adpcmenc.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcmenc: Use smaller scope for some variablesAndreas Rheinhardt2021-07-22
| | | | | | | | This is to avoid unused variables warnings if the code for disabled encoders is #if'ed away which will happen in a subsequent commit. In case of buf it also avoids shadowing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sampleZane van Iperen2021-07-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/dsd_tablegen: Merge header into dsd.cAndreas Rheinhardt2021-07-19
| | | | | | | | Since b492fbcc6e87094804fdf71308dc500976c6b165, the DSD tables are always initialized at runtime, so merge the dsd_tablegen.h header into dsd.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Avoid calling functions repeatedly via FFMINAndreas Rheinhardt2021-07-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libavcodec.v: Tighten export whitelistAndreas Rheinhardt2021-07-18
| | | | | | | | | | | | | | Currently every symbol (with external linkage) that starts with "av" is exported. Yet libaom-av1 has lots of functions that are not meant to be exported and start with "av1_" (I counted 1236); and libvpx has average_split_mvs. These functions are exported if one links these libraries statically into a shared libavcodec.so. Solve this by tightening the whitelist to "av_", "avcodec_", "avpriv_" and (as a special-case) "avsubtitle_free". Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/exr: Check uncompressed_size against max_pixelsMichael Niedermayer2021-07-17
| | | | | | | | | Fixes: Timeout Fixes: 35286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6557139802914816 Fixes: 31253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-4901782326214656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libdav1d: parse sequence headers in extradata if availableJames Almer2021-07-14
| | | | | | | This allows the decoder context to be initialized with all stream parameters before a packet is parsed. Signed-off-by: James Almer <jamrial@gmail.com>
* {configure,avcodec/libx264}: remove separate x264_csp_bgr checkJan Ekström2021-07-12
| | | | | | We already require X264_BUILD >= 118, which includes an unconditional definition of X264_CSP_BGR in itself, thus making this check effectively always true.
* libavcodec/vorbisenc: Add missing initial_paddingGuangyu Sun2021-07-12
| | | | | | | | | | | Vorbis has priming samples at the beginning. If the initial_padding is not set in the encoder, the total sample count will be one frame fewer than it should be. The result is that we get a truncated version of encoding. initial_padding should be set to the frame_size used in vorbis_encode_frame(). Signed-off-by: Guangyu Sun <gsun@roblox.com>
* avcodec/qsvenc: clip global_quality for ICQ modes.Gyan Doshi2021-07-12
| | | | | | Allowed range is 1 to 51. Ref: https://software.intel.com/content/www/us/en/develop/articles/advanced-bitrate-control-methods-in-intel-media-sdk.html
* avcodec/libdav1d: don't repeatedly parse the same sequence headerJames Almer2021-07-09
| | | | | | | Look at the event flag that signals a new sequence header was found in the bitstream on supported libdav1d versions for this purpose. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libdav1d: use ff_decode_frame_props() to fill frame propertiesJames Almer2021-07-09
| | | | | | | The main benefit comes from propagating container level metadata like hdr, which is more commonly used than the relevant Metadata OBUs. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/aacdec_template: Avoid some invalid values to be set by ↵Michael Niedermayer2021-07-09
| | | | | | | | | | decode_audio_specific_config_gb() Fixes: NULL pointer dereference Fixes: decode_spectrum_and_dequant.mp4 Found-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/textdec: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_anatoliy: Deduplicate pix_fmts arraysAndreas Rheinhardt2021-07-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_anatoliy: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Deduplicate ff_mpv_generic_options-based AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libwebpenc: Deduplicate options, AVClass, pix_fmtsAndreas Rheinhardt2021-07-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libcodec2: Remove AVClass for decoderAndreas Rheinhardt2021-07-08
| | | | | | The decoder has no options. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/g726: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3enc: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3dec_float: Deduplicate AVClassesAndreas Rheinhardt2021-07-08
| | | | | | | | The child_class_next API relied on different AVCodecs to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/Makefile: Fix standalone build of adpcm_argo encoderAndreas Rheinhardt2021-07-08
| | | | | | | | Said encoder uses a function in adpcm.c and while it does not use anything from adpcm_data.c, other parts of both adpcm.c and adpcmenc.c need it, so adpcm_data.c needs to be enabled anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegdec: Try to continue decoding on zero quant matrix valueAndriy Gelman2021-07-05
| | | | | | | | | | | A zero value in the quantization matrix is invalid but in practice will just set the transform coefficient to zero after inverse quantization. Try to continue decoding if the AV_EF_EXPLODE flag is not set. Fixes ticket #9287. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/setts_bsf: add a NOPTS constantJames Almer2021-07-04
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/setts_bsf: actually store the current packet's timestamps to be ↵James Almer2021-07-04
| | | | | | | | | | usable by the next Before this change, the PREV_OUTPTS and PREV_OUTDTS constants always evaluated to AV_NOPTS_VALUE. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/bsf: switch to av_get_token to parse bsf list stringGyan Doshi2021-07-04
| | | | | | | | | | The recently added setts bsf makes use of the eval API whose expressions can contain commas. The existing parsing in av_bsf_list_parse_str() uses av_strtok to naively split the string at commas, thus preventing the use of setts filter with expressions containing commas. av_get_token can work with escaped commas, allowing full use of setts.
* avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()Michael Niedermayer2021-07-03
| | | | | | | Fixes: floating point division by 0 Fixes: Ticket8213 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/j2kenc: Check for av_strtok() failureMichael Niedermayer2021-07-03
| | | | | | Fixes: CID1466601 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* qsvenc_hevc: allow user set more coding optionsHaihao Xiang2021-07-02
| | | | | | | | | The SDK supports NalHrdConformance, RecoveryPointSEI and AUDelimiter for hevc encoder, so we may allow user to set these coding options like as what we did for h264_qsv encoder. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
* avcodec/cpia: Fix missing src_size updateMichael Niedermayer2021-06-29
| | | | | | | | Fixes: out of array read Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984 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: Better size checksMichael Niedermayer2021-06-29
| | | | | | | | Fixes: signed integer overflow: 3530839700044513368 + 8386093932303352321 cannot be represented in type 'long long' Fixes: 35182/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5398383270428672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/clearvideo: Check tile_size to be not too largeMichael Niedermayer2021-06-29
| | | | | | | | Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 35023/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-6740166587842560 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: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration ↵Michael Niedermayer2021-06-29
| | | | | | | | | | calculation Fixes: signed integer overflow: 486539264 * 14 cannot be represented in type 'int' Fixes: 35281/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6068262742917120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_metadata_bsf: Allow zeroing constraint_set4_flag and ↵Derek Buitenhuis2021-06-29
| | | | | | | | | | | constraint_set5_flag These bits are reserved in earlier versions of the H.264 spec, and some poor hardware decoders require they are zero. Thus, it is useful to be able to zero these on streams that may have them set. The result is still a valid H.264 bitstream. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>