summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/ffv1dec_template: fix indentionMichael Niedermayer2022-07-12
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/aarch64: Hook up the existing ff_pix_abs16_neon to the sad[0] function ↵Hubert Mazur2022-07-11
| | | | | | | pointer Signed-off-by: Hubert Mazur <hum@semihalf.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/pcm-dvdenc: Fix encoding 24bit samplesAndreas Rheinhardt2022-07-10
| | | | | | | | The earlier code ignored the lower 16 bits and instead used the highest 8 bits twice. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pcm-dvdenc: Remove unused extra_sample(s|_count)Andreas Rheinhardt2022-07-10
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Unify the code styleWenbin Chen2022-07-09
| | | | | | | Change whitespace and add newline to unify the code style. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()Wenbin Chen2022-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 422 frames we should not use hard coded 8 to calculate mb size for uv plane. Chroma shift should be taken into consideration to be compatiple with different sampling format. The error is reported by fate test when av_cpu_max_align() return 64 on the platform supporting AVX512. This is a hidden error and it is exposed after commit 17a59a634c39b00a680c6ebbaea58db95594d13d. mpeg2enc has a mechanism to reuse frames. When it computes SSE (sum of squared error) on current mb, reconstructed mb will be wrote to the previous mb space, so that the memory can be saved. However if the align is 64, the frame is shared in somewhere else, so the frame cannot be reused and a new frame to store reconstrued data is created. Because the height of mb is wrong when compute sse on 422 frame, starting from the second line of macro block, changed data is read when frame is reused (we need to read row 16 rather than row 8 if frame is 422), and unchanged data is read when frame is not reused (a new frame is created so the original frame will not be changed). That is why commit 17a59a634c39b00a680c6ebbaea58db95594d13d exposes this issue, because it add av_cpu_max_align() and this function return 64 on platform supporting AVX512 which lead to creating a frame in mpeg2enc, and this lead to the different outputs. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/hevc_cabac: Don't cast const away unnecessarilyAndreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_refs: Constify ff_hevc_get_ref_list()Andreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_sei: Use proper type for NALU typeAndreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h26[45]_metadata_bsf: Fix range of chroma_sample_loc_typeAndreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_ps: Fix wrong copyright yearsAndreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dv: Remove unnecessary headerAndreas Rheinhardt2022-07-09
| | | | | | Forgotten in 6d484671ecb612c32cbda0fab65f961743aff5f8. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Mark init and close functions as av_coldAndreas Rheinhardt2022-07-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encode: Avoid check whose result is known in advanceAndreas Rheinhardt2022-07-09
| | | | | | | | | | | | | | | encode_send_frame_internal() is always only called if the buffer packet is empty and except when we are dealing with an audio codec that does not allow variable frame size it stays that way until a call to av_frame_ref() at the end of encode_send_frame_internal(). In case we are dealing with the small last frame of an audio encoder requiring constant frame size the frame will be allocated by pad_last_frame() and this the only case where this is so. So by returning directly after pad_last_frame(), we can avoid having to recheck whether the frame is still empty before av_frame_ref(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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
|