summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
...
* avcodec: Add const to decoder packet data pointersAndreas Rheinhardt2022-07-09
| | | | | | | The packets given to decoder need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/apng: Add APNG_FCTL_CHUNK_SIZE defineAndreas Rheinhardt2022-07-09
| | | | | | Also use it where appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec: fix parsing of dual mono filesJames Almer2022-07-08
| | | | | | | | | | Dual mono files report a channel count of 2 with each individual channel in its own SCE, instead of both in a single CPE as is the case with standard stereo. This commit handles this non default channel configuration scenario. Fixes ticket #1614 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/openh264: return (DE|EN)CODER_NOT_FOUND if version check failsAndreas Schneider2022-07-08
| | | | | | | | A cosmetic change only, it basically just changes the user facing error message to clients that interpret the errors to something that makes sense. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/flashsv: Clear pointersMichael Niedermayer2022-07-07
| | | | | | | | Fixes: Use after free Fixes: 47399/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLASHSV2_fuzzer-5718646686613504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aasc: Fix indentionMichael Niedermayer2022-07-07
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/flashsv: Check inflate() for failureMichael Niedermayer2022-07-07
| | | | | | Fixes: CID1047223 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/smacker: fix indention after previous commitMichael Niedermayer2022-07-07
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/smacker: Optimize constant 16bit audio outputMichael Niedermayer2022-07-07
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exrenc: add av_cold to some functionsPaul B Mahol2022-07-06
|
* avcodec/nvenc: add support for additional (10 bit) RGB pixel formatsTimo Rothenpieler2022-07-05
|
* get_bits: move check_marker() to mpegvideodec.hAnton Khirnov2022-07-04
| | | | | It is only used by mpegvideo-based decoders - specifically mpeg12, intelh263, ituh263, mpeg4video.
* avcodec/mscc: Don't modify input packetAndreas Rheinhardt2022-07-04
| | | | | | | This packet may not be writable, hence we must not write to it. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/decoders: Use const uint8_t* to access input packet dataAndreas Rheinhardt2022-07-04
| | | | | | | These packets need not be writable, so we must not modify them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcadec: Treat the input packet's data as constAndreas Rheinhardt2022-07-04
| | | | | | | | A decoder's input packet need not be writable, so we must not modify the data. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libdavs2: workaround memory leakZhao Zhili2022-07-04
| | | | | | | | | | | | | | | | | | davs2_decoder_close doesn't free those on the fly frames which don't get output yet. It's a design bug, but easy to workaround. Before the patch: Direct leak of 1198606 byte(s) in 2 object(s) allocated from: #0 0x563af5e1e5f0 in malloc (ffmpeg+0x6675f0) #1 0x563af9765ef3 in davs2_malloc davs2/source/common/common.h:1240 #2 0x563af9765ef3 in davs2_alloc_picture davs2/source/common/header.cc:815 Indirect leak of 3595818 byte(s) in 6 object(s) allocated from: #0 0x563af5e1e5f0 in malloc (ffmpeg+0x6675f0) #1 0x563af9765ef3 in davs2_malloc davs2/source/common/common.h:1240 #2 0x563af9765ef3 in davs2_alloc_picture davs2/source/common/header.cc:815 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/alsdec: No channels cannot be accessedMichael Niedermayer2022-07-03
| | | | | | | | | Fixes: out of array access Fixes: 48145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5054524173189120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/qdrw: adjust max colors to array sizeMichael Niedermayer2022-07-03
| | | | | | | | | Fixes: out of array access Fixes: 48429/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDRAW_fuzzer-4608329791438848 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/pnmenc: support both endian variants for PFMPaul B Mahol2022-07-03
|
* avcodec: add PHM decoder and encoderPaul B Mahol2022-07-03
|
* avcodec/tests/snowenc: Remove unused-but-set variableAndreas Rheinhardt2022-07-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/qoidec: Remove unused-but-set variableAndreas Rheinhardt2022-07-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/j2kenc: Remove unused-but-set variableAndreas Rheinhardt2022-07-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/imc: Remove unused-but-set variableAndreas Rheinhardt2022-07-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_ps: Remove unused-but-set variableAndreas Rheinhardt2022-07-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/alacdsp: Make intermediates unsignedMichael Niedermayer2022-07-02
| | | | | | | | Fixes: signed integer overflow: -14914387 + -2147418648 cannot be represented in type 'int' Fixes: 46464/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-474307197311385 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_h2645: Remove unnecessary (h264|hevc)_sei.h inclusionsAndreas Rheinhardt2022-07-02
| | | | | | | They are unnecessary since the SEI enum has been moved to sei.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_slice: Don't reinitialise initialised mutexAndreas Rheinhardt2022-07-01
| | | | | | | | | | | | | | It results in undefined behaviour. Instead initialize the mutexes and condition variables once during init (and check these initializations). Also combine the corresponding mutex and condition variable into one structure so that one can allocate their array jointly. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/v4l2_m2m: Check if the file descriptor is valid before closingWujian(Chin)2022-07-01
| | | | | | | Fixes ticket #9507. Reviewed-by: Steven Liu <liuqi05@kuaishou.com> Signed-off-by: wujian_nanjing <wujian2@huawei.com>
* avcodec/libx264: Avoid duplicating stringsAndreas Rheinhardt2022-07-01
| | | | | | Also removes some unchecked allocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3_parser{,_internal}: expose AC-3 bit_rate_codeJan Ekström2022-06-30
| | | | | | | Required by MP4's AC3SpecificBox and MPEG-TS AC-3 audio_descriptor, of which the former is implemented in our MP4 writer. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec/exrenc: add grayf32 format supportPaul B Mahol2022-06-30
|
* avcodec/hevcdec: Return immediately upon hevc_init_context() failureAndreas Rheinhardt2022-06-30
| | | | | | | | | | This function is only called from the decoder's init function and given that this decoder has FF_CODEC_CAP_INIT_CLEANUP set, hevc_decode_free() is called automatically (currently it would be called twice with the second call being redundant). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevcdec: Remove redundant context_initializedAndreas Rheinhardt2022-06-30
| | | | | | | | All contexts are always initialized during init, regardless of whether frame threading is in use or not. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Don't mention removed functionAndreas Rheinhardt2022-06-30
| | | | | | | | avcodec_thread_init() has been removed in 9a79bb552a518f26bec1b5306a03b76076bcf8eb. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pnmenc: reindentPaul B Mahol2022-06-29
|
* avcodec/pnmenc: add support for grayf32 in PFM imagePaul B Mahol2022-06-29
|
* lavc/aarch64: motion estimation functions in neonSwinney, Jonathan2022-06-28
| | | | | | | | | | | | | | | | | | | | | | - ff_pix_abs16_neon - ff_pix_abs16_xy2_neon In direct micro benchmarks of these ff functions verses their C implementations, these functions performed as follows on AWS Graviton 3. ff_pix_abs16_neon: pix_abs_0_0_c: 141.1 pix_abs_0_0_neon: 19.6 ff_pix_abs16_xy2_neon: pix_abs_0_3_c: 269.1 pix_abs_0_3_neon: 39.3 Tested with: ./tests/checkasm/checkasm --test=motion --bench --disable-linux-perf Signed-off-by: Jonathan Swinney <jswinney@amazon.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/libx265: make X265 CSP selection pixel format independentJan Ekström2022-06-27
| | | | | | | | Currently the format listing misses the J formats completely, yet they are marked as supported in the encoder. Thus to make the logic support them while not explicitly listing them, make the logic utilize chroma subsampling information in both width and height available through the pixel format descriptor.
* libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtimeYue Heng2022-06-27
| | | | | | | | | | Enable dynamic QP configuration in runtime on qsv encoder. Through AVFrame->metadata, we can set key "qsv_config_qp" to change QP configuration when we encode video in CQP mode. Signed-off-by: Yue Heng <yue.heng@intel.com> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* libavcodec/qsvenc_hevc: Use default value from MSDK to set bf.Wenbin Chen2022-06-27
| | | | | | | | Change the default value of "bf" for hevc_qsv to -1. 8 isn't the best choice so let MSDK to decide the number of b frames. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/cuviddec: fix null pointer dereferenceZhao Zhili2022-06-26
| | | | | | It can happened on error path of cuvid_decode_init(). Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: fix AV1 decoding errorZhao Zhili2022-06-26
| | | | | | | | | | | cuvidParseVideoData only supports pure OBUs, it reports an unknown error with AV1CodecConfigurationRecord. Check whether extradata is AV1CodecConfigurationRecord and skip the first 4 bytes to fix the issue. The bug is revealed in ffmpeg cmd since 45e3b6a68 and ffd1316e. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: fix time reporting for DFPWM streamsJack Bruienne2022-06-26
| | | | | | | | | | This adds the exact bits per sample for DFPWM to av_get_exact_bits_per_sample. Previously, the DTS and PTS were set to 0 because the codec never reported them, but adding this allows libavformat to automatically set DTS and PTS from the byte position of the stream. Signed-off-by: Jack Bruienne <jackbruienne@gmail.com>
* avcodec/x86/h264_qpel: Remove unused functionsAndreas Rheinhardt2022-06-26
| | | | | | | | | | Forgotten in 4011a76494a5ff6844312813bc753aae8e54c2f0. The reason for this is that these functtions are marked as av_always_inline and GCC does not emit warnings if such functions are unused, so this went unnoticed. Yet Clang does, so this commit removes them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libjxlenc: properly read input colorspaceLeo Izen2022-06-25
| | | | | | | | | | | Whether an ICC profile is present or not, the libjxl encoder wrapper should now properly read colorspace tags and forward them to libjxl appropriately, rather than just assume sRGB as before. It will also print warnings when colorimetric assumptions are made about the input data. Reviewed-by: Niklas Haas <git@haasn.dev> Signed-off-by: Leo Izen <leo.izen@gmail.com>
* avcodec/libjxldec: properly tag output colorspaceLeo Izen2022-06-25
| | | | | | | | | Whether an ICC profile is present or not, the decoder should now properly tag the colorspace of pixel data received by the decoder. Reviewed-by: Niklas Haas <git@haasn.dev> Signed-off-by: Leo Izen <leo.izen@gmail.com>
* AV1 VDPAU hwaccel Decode supportManojGuptaBonda2022-06-25
| | | | | | | | | | | | | | Support for VDPAU accelerated AV1 decoding was added with libvdpau-1.5. Support for the same in ffmpeg is added with this patch. Profiles related to VDPAU AV1 can be found in latest vdpau.h present in libvdpau-1.5. Add AV1 VDPAU to list of hwaccels and supported formats Added file vdpau_av1.c and Modified configure to add VDPAU AV1 support. Mapped AV1 profiles to VDPAU AV1 profiles. Populated the codec specific params that need to be passed to VDPAU. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/av1: Add upper bound for the size of a sane sequence headerAndreas Rheinhardt2022-06-24
| | | | | | | | It will be used by the Matroska muxer to reserve a certain number of bytes for the CodecPrivate in case no extradata is initially available (as it is for the libaom-av1 encoder). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_sei: Fix check for SEI endAndreas Rheinhardt2022-06-24
| | | | | | | | | | | | | | The intention behind the current check seems to be to check for the rbsp_trailing_bits() syntax structure which is always 0x80 for valid SEI messages. Yet this is wrong: These trailing bits are not part of the GetBitContext -- they have already been stripped in ff_h2645_packet_split(). And it is harmful, as 0x80 is a legal SEI message payload type (namely for Structure of pictures information SEI messages). We ignore this type of SEI, but because of this bug we also ignored every SEI message in the same NALU following it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>