summaryrefslogtreecommitdiff
path: root/libavcodec/cavsdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/cavsdec: Check bits left before picture allocationMichael Niedermayer2023-05-011-0/+3
| | | | | | | | Fixes: Timeout Fixes: 57893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5091726540013568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavs: Only keep what is needed from IDCTDSP-APIAndreas Rheinhardt2022-10-241-1/+1
| | | | | | | | Namely ScanTable.permutated. The rest of the IDCTDSP-API is unused as cavs has its own idct. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_set_dimensions() to decode.hAndreas Rheinhardt2022-08-271-1/+0
| | | | | | | | | Decoder-only, as the dimensions are set by the user when encoding. Also fixup the other headers a bit while removing unnecessary internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-271-0/+1
| | | | | | | | | Only used by decoders (encoders have ff_encode_alloc_frame()). Also clean up the other headers a bit while removing now redundant internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+1
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/cavsdec: Add profile checkJun Zhao2022-05-081-0/+5
| | | | | | | Add profile check for cavs decoder, now cavs decoder only support JiZhun(0x20) profile Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-051-6/+6
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | It is a more fitting place for them. Also move the definition of ff_log2_run to mathtables.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-6/+6
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Fix error messageAndreas Rheinhardt2022-02-111-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-111-1/+1
| | | | | | It does not initialize any static data in its .init. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Cleanup generically on init failureAndreas Rheinhardt2022-02-111-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt2022-02-081-0/+1
| | | | | | | | This is by definition the appropriate place for it. Remove all the now unnecessary libavcodec/internal.h inclusions; also remove other unnecessary headers from the affected files. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cavsdec, h264*, hevc_parser: Use get_ue_golomb_31 where possibleAndreas Rheinhardt2020-07-291-1/+1
| | | | | | | | | | instead of get_ue_golomb(). The difference between the two is that the latter also has to take into account the case in which the read code is more than 9 bits (four preceding zeroes + at most five value bits) long, leading to more code. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cavsdec: Set ret on errors in decode_pic()Michael Niedermayer2019-10-171-4/+12
| | | | | | Fixes regression and fate failure on some machienes Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Check remaining bitstream in the main loop in decode_pic()Michael Niedermayer2019-10-161-2/+12
| | | | | | | | Fixes: Timeout (149sec ->1sec) Fixes: 17311/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5679368642232320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Limit the number of access units per packet to 2Michael Niedermayer2019-08-291-0/+4
| | | | | | | | Fixes: Timeout (122sec -> 13ms) Fixes: 15978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5148925004087296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Propagate error codes inside decode_mb_i()Michael Niedermayer2018-11-041-8/+21
| | | | | | | | Fixes: Timeout Fixes: 10702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5669940938407936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Check alpha/beta offsetMichael Niedermayer2018-02-221-0/+5
| | | | | | | | Fixes: Integer overflow Fixes: 6183/clusterfuzz-testcase-minimized-6269224436629504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Check P/B frame mb decode which return error codesMichael Niedermayer2017-08-151-4/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Check I frame mb decode for errorsMichael Niedermayer2017-08-151-3/+7
| | | | | | | | Fixes: timeout Fixes: 2943/clusterfuzz-testcase-5430257156882432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Fix runtime error: signed integer overflow: 59 + 2147483600 ↵Michael Niedermayer2017-05-311-1/+1
| | | | | | | | | cannot be represented in type 'int' Fixes: 1903/clusterfuzz-testcase-minimized-5359318167715840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Fix runtime error: signed integer overflow: 31 + 2147483640 ↵Michael Niedermayer2017-05-131-1/+1
| | | | | | | | | cannot be represented in type 'int' Fixes: 1506/clusterfuzz-testcase-minimized-5401272918212608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Check sym_factorMichael Niedermayer2017-05-081-0/+4
| | | | | | | | | Fixes: runtime error: signed integer overflow: 25984 * 130560 cannot be represented in type 'int' Fixes: 1404/clusterfuzz-testcase-minimized-5000441286885376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cavsdec: Fix undefined behavior from integer overflowMichael Niedermayer2017-05-051-1/+1
| | | | | | | Fixes: 1335/clusterfuzz-testcase-minimized-5566961566089216 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'f81be06cf614919d71ded29b8f595bef40123ad8'James Almer2017-03-191-1/+1
|\ | | | | | | | | | | | | * commit 'f81be06cf614919d71ded29b8f595bef40123ad8': cavs: Change type of stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
| * cavs: Change type of stride parameters to ptrdiff_tDiego Biurrun2016-08-261-1/+1
| | | | | | | | ptrdiff_t is the correct type for array strides and similar.
* | avcodec/cavsdec: Clear MMX state after MB decode loopMichael Niedermayer2016-10-221-0/+1
| | | | | | | | | | | | | | The MMX state must be cleared between using MMX and using memory allocation thats basically the only location between the 2 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | cavsdec: unref frame before referencing againAndreas Cadhalpun2016-10-211-0/+2
| | | | | | | | | | | | | | | | This fixes asserts (from commit 13aae8) in av_frame_ref and av_frame_move_ref. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b'Hendrik Leppkes2015-09-161-1/+0
|\ \ | |/ | | | | | | | | | | * commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b': mpegvideo: Drop mpegvideo.h where not needed Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mpegvideo: Drop mpegvideo.h where not neededVittorio Giovara2015-09-131-1/+0
| | | | | | | | Add necessary headers in .c files.
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/cavsdec: Use ff_set_dimensions()Michael Niedermayer2015-05-141-5/+8
| | | | | | | | | | | | Fixes CID1239111 part2 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/cavsdec: Check frame_rate_codeMichael Niedermayer2015-05-141-0/+6
| | | | | | | | | | | | Fixes CID1239111 part1 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/cavsdec: Check esc_codeMichael Niedermayer2015-05-141-0/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/cavs: Check for av_malloc* failure in ff_cavs_init_top_lines()Michael Niedermayer2015-01-101-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa'Michael Niedermayer2014-11-181-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa': lavc: fix bitshifts amount bigger than the type Conflicts: libavcodec/internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: fix bitshifts amount bigger than the typeVittorio Giovara2014-11-181-2/+2
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
* | Merge commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41'Michael Niedermayer2014-10-151-2/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41': lavc: deprecate the use of AVCodecContext.time_base for decoding Conflicts: libavcodec/avcodec.h libavcodec/h264.c libavcodec/mpegvideo_parser.c libavcodec/utils.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: deprecate the use of AVCodecContext.time_base for decodingAnton Khirnov2014-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | When decoding, this field holds the inverse of the framerate that can be written in the headers for some codecs. Using a field called 'time_base' for this is very misleading, as there are no timestamps associated with it. Furthermore, this field is used for a very different purpose during encoding. Add a new field, called 'framerate', to replace the use of time_base for decoding.
* | avcodec/cavs: make cavs_chroma_qp non staticMichael Niedermayer2014-06-281-9/+2
| | | | | | | | | | | | | | | | The table is needed by multiple files Reverts part of ef07ac1e126b95ad7e1b56504c19b59901265c3e Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/cavs: fix B_SUB_DIRECT col-MB is Intra MB case.Yao Wang2014-06-261-5/+27
| | | | | | | | | | | | | | | | | | in this case current MB size is forced to 16x16 (AVS standard section 9.9.1) Signed-off-by: Yao Wang <jiayaowang@gmail.com> Fixes Ticket 1901 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9'Michael Niedermayer2014-06-191-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9': dsputil: Split clear_block*/fill_block* off into a separate context Conflicts: configure libavcodec/asvdec.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dsputil.h libavcodec/eamad.c libavcodec/intrax8.c libavcodec/mjpegdec.c libavcodec/ppc/dsputil_ppc.c libavcodec/vc1dec.c libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split clear_block*/fill_block* off into a separate contextDiego Biurrun2014-06-181-1/+1
| |
* | avcodec/cavsdec: simplify % 512 operationsMichael Niedermayer2014-06-181-3/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>