summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/agm: Mark fill_pixels() as av_always_inlineMichael Niedermayer2020-08-11
| | | | | | | | Speedup from 275sec to 142sec Testcase: 24426/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5639724379930624 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhdenc: mark filter as always inlinePaul B Mahol2020-08-11
|
* avcodec/cfhdenc: optimize writting of small runcodesPaul B Mahol2020-08-11
|
* avcodec/cfhdenc: improve quality vs size ratioPaul B Mahol2020-08-11
|
* avcodec/jpeg2000dec: Check remaining data in packed_headers_stream before useMichael Niedermayer2020-08-10
| | | | | | | | | | Fixes: out of array read Fixes: 24487/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5165847820369920 Fixes: 24636/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5700973918683136 Fixes: 24683/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6202883897556992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhd: improve SampleIndex tag outputPaul B Mahol2020-08-09
| | | | This tag is used for jumping to different channels in bitstream.
* avcodec/cfhd: log version tags tooPaul B Mahol2020-08-09
|
* avcodec/cfhd: read prescale table tagPaul B Mahol2020-08-09
| | | | | Currently unused. Remove prescale shift tag as it is not part of this codec.
* avcodec/cfhd: use init_get_bits8()Paul B Mahol2020-08-09
|
* avcodec/cfhd: reindentPaul B Mahol2020-08-09
|
* avcodec/cfhd: check if band encoding is validPaul B Mahol2020-08-09
| | | | | Also simplify lossless check as value of 5 for band encoding always specify lossless mode.
* libavcodec/j2kenc: Support for all Progression ordersGautam Ramakrishnan2020-08-09
| | | | | | | | | This patch allows for selecting the progression order in the j2k encoder. However, all components and resolution levels will use the same progression order and will not feature the use of progression order change markers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhdenc: free alpha buffer on closingPaul B Mahol2020-08-08
|
* avcodec/cfhdenc: add gbrap12 pixel format supportPaul B Mahol2020-08-08
|
* avcodec/cfhdenc: compand coefficientsPaul B Mahol2020-08-08
| | | | Also use -quality private option and add more modes.
* avcodec/cfhd: add 3d transform supportPaul B Mahol2020-08-08
| | | | Based on Gagandeep Singh patch.
* avcodec/cfhd: remove some unused or only write itemsPaul B Mahol2020-08-08
|
* avcodec/cfhdenc: also write FrameNumber tagPaul B Mahol2020-08-08
|
* avcodec/put_bits: Make skip_put_bits() less dangerousAndreas Rheinhardt2020-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before c63c303a1f2b58677d480505ec93a90f77dd25b5 (the commit which introduced a typedef for the type of the buffer of a PutBitContext) skip_put_bits() was as follows: static inline void skip_put_bits(PutBitContext *s, int n) { s->bit_left -= n; s->buf_ptr -= 4 * (s->bit_left >> 5); s->bit_left &= 31; } If s->bit_left was negative after the first subtraction, then the next line will divide this by 32 with rounding towards -inf and multiply by four; the result will be negative, of course. The aforementioned commit changed this to: static inline void skip_put_bits(PutBitContext *s, int n) { s->bit_left -= n; s->buf_ptr -= sizeof(BitBuf) * ((unsigned)s->bit_left / BUF_BITS); s->bit_left &= (BUF_BITS - 1); } Casting s->bit_left to unsigned meant that the rounding is still towards -inf; yet the right side is now always positive (it transformed the arithmetic shift into a logical shift), so that s->buf_ptr will always be decremented (by about UINT_MAX / 8 unless n is huge) which leads to segfaults on further usage and is already undefined pointer arithmetic before that. This can be reproduced with the mpeg4 encoder with the AV_CODEC_FLAG2_NO_OUTPUT flag set. Furthermore, the earlier version as well as the new version share another bug: s->bit_left will be in the range of 0..(BUF_BITS - 1) afterwards, although the assumption throughout the other PutBitContext functions is that it is in the range of 1..BUF_BITS. This might lead to a shift by BUF_BITS in little-endian mode. This has been fixed, too. The new version is furthermore able to skip zero bits, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add adpcm_argo encoderZane van Iperen2020-08-07
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_argo: add ff_adpcm_argo_expand_nibble() and cleanup parametersZane van Iperen2020-08-07
| | | | | | Replaces adpcm_argo_expand_nibble(). Preparation for the encoder. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/tiff: Check bpp/bppcount for 0Michael Niedermayer2020-08-07
| | | | | | | | Fixes: division by zero Fixes: 24253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6250318007107584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/snowdec: Sanity check hcoeffMichael Niedermayer2020-08-07
| | | | | | | | Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int' Fixes: 24011/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5486376610168832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libx264: fix chroma quantizer offset usageTakio Yamaoka2020-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default for the chromaoffset field in AVCodecContext is zero, which until now always ended up overriding the AVOption-set value, thus leading to the AVOption not working. Additionally, the previous usage prevented the usage of negative values, while both the variable as well as x264's API would successfully handle such. Thus, the default value of the AVOption is changed to match the default of x264 (and what is currently the default for the AVCodecContext chromaoffset field), and the checks are changed to check for nonzero values. This way: 1. the library default is still utilized if the value is zero. 2. both negative and positive values are correctly passed to x264. For historical context, this was initially similarly implemented in 5764d38173661c29d954711dd5abfddf709e9ba4, and then b340bd8a58c32453172404a8e4240e3317e341da broke the value. Partially reverts commit b340bd8a58c32453172404a8e4240e3317e341da. Signed-off-by: Takio Yamaoka <y.takio@gmail.com>
* avcodec/mpegaudiodec_template: Fix some whitespace issuesMichael Niedermayer2020-08-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Handle reducedresno of 32Michael Niedermayer2020-08-06
| | | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'int' Fixes: 24566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6033783737024512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/j2kenc: Allow Encoder to use SOP and EPH markersGautam Ramakrishnan2020-08-06
| | | | | | | | This patch allows the encoder to use SOP and EPH markers. This would be useful as these markers provide better error detection mechanisms. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libopenh264enc: use framerate if availableJun Zhao2020-08-05
| | | | | | | | | | Respecting the framerate in the libopenh264enc codec context. Both the libx264 and libx265 encoders already contain similar logic to first check the framerate before falling back to the timebase. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/mpegaudiodec_template: Check CRCs for layer1 and layer2Michael Niedermayer2020-08-04
| | | | | | | | | | | This differs from the MPEG specification as the actual real world files do compute their CRC over variable areas and not the fixed ones listed in the specification. This is also the reason for the complexity of this code and the need to perform the CRC check for layer2 in the middle of layer2 decoding. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_argo: fix incorrect documentationZane van Iperen2020-08-04
| | | | | | Flag bit was in the wrong place. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/cfhd: fix overflow in multiplication in LUT calculationPaul B Mahol2020-08-04
|
* avcodec/aacdec_template: add support for 22.2 / channel_config 13Jan Ekström2020-08-04
|
* avcodec/aacdec_template: mark second LFE element as LFE2Jan Ekström2020-08-04
| | | | We now have the capability to do this.
* avcodec/aacdectab: add mapping for 22.2Jan Ekström2020-08-04
| | | | Utilizes the newly added 22.2 channel layout for channel_layout 13.
* avcodec/mpeg4audio: add newer channel_coding mappingsJan Ekström2020-08-04
| | | | | Additionally, add comments regarding their definitions. Based on ARIB STD-B32, which bases on 14496-3:2009 and 14496-3:2009/AMD4.
* avcodec/cfhd: correct 71 tag usagePaul B Mahol2020-08-03
| | | | It stores input format and never codebook.
* avcodec/cfhdenc: fix setting default compression levelPaul B Mahol2020-08-03
|
* avcodec/cfhdenc: extend quantization tablePaul B Mahol2020-08-03
| | | | Should give better quality.
* avcodec/cfhd: use LUT for 9 and 18 codebook decompandingPaul B Mahol2020-08-03
| | | | | Also fix codebook 9 decompanding, fixing artifact with codebook 9 samples. Reused Gagandeep Singh patch.
* avcodec/cfhdenc: fix PrescaleTable for YUV422P10Paul B Mahol2020-08-03
|
* avcodec/mpegaudiodec_template: disable CRC checking for layers 1 and 2James Almer2020-08-03
| | | | | | | | | | Layers 1 and 2 use lengths in bits which are not a multiple of 8, and our CRC works on a per-byte basis. Based on b48397e7b8 Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "mpegaudiodec_template: disable CRC checking for layers 1 and 2"James Almer2020-08-03
| | | | | | | | | | | This reverts commit b48397e7b84864f2d4c70361a4c4bed93e826753. The change did not disable crc checks for layer 1 & 2, it removed reading the CRC field. Fixes decoding some mp2 samples and FATE test failures. Signed-off-by: James Almer <jamrial@gmail.com>
* mpegaudiodec_template: disable CRC checking for layers 1 and 2Lynne2020-08-02
| | | | | Layers 1 and 2 use lengths in bits which are not a multiple of 8, and our CRC works on a per-byte basis.
* avcodec/v4l2_m2m: reindent after last commitAndriy Gelman2020-08-02
| | | | Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/v4l2_m2m: adapt to call close() on init failAndriy Gelman2020-08-02
| | | | | | | | This fixes several mem leaks when init of encoder/decoder failed. Fixes ticket #8285 Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/cfhd: set correct bits_per_raw_samplePaul B Mahol2020-08-02
|
* avcodec/cfhd: add more tag namesPaul B Mahol2020-08-02
|
* avcodec: add CFHD encoderPaul B Mahol2020-08-02
|
* avcodec/cfhd: improve decompanding quality with reference implementationPaul B Mahol2020-08-02
|
* avcodec/cfhd: fix non-aligned to 8 height decodingPaul B Mahol2020-08-02
|