aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ivi.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use proper namespaceAndreas Rheinhardt2023-09-111-6/+6
| | | | | | | | | | | | | | | | Therefore use a proper prefix for this API, e.g. ff_init_vlc_sparse -> ff_vlc_init_sparse ff_free_vlc -> ff_vlc_free INIT_VLC_LE -> VLC_INIT_LE INIT_VLC_USE_NEW_STATIC -> VLC_INIT_USE_STATIC (The ancient INIT_VLC_USE_STATIC has been removed in 595324e143b57a52e2329eb47b84395c70f93087, so that the NEW has been dropped.) Finally, reorder the flags and change their values accordingly. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> 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/vlc: Use structure instead of VLC_TYPE array as VLC elementAndreas Rheinhardt2022-06-171-1/+1
| | | | | | | | | | | | | | | | | | In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-051-4/+3
| | | | | | | | 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>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-201-3/+3
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ivi: Fix indentationAndreas Rheinhardt2021-04-261-12/+14
| | | | | | | Also improve readability by keeping a pointer to the IVIBandDesc that is currently freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ivi: Make initializing VLCs thread-safeAndreas Rheinhardt2020-12-081-5/+8
| | | | | | This automatically makes indeo4/5 init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ivi: Avoid reversing BE VLC codes for LE bitstream readerAndreas Rheinhardt2020-10-121-20/+2
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ivi: Fix segfault on allocation errorAndreas Rheinhardt2020-09-151-1/+3
| | | | | | | | | | | If allocating the tiles array for indeo 4/5 fails, the context is in an inconsistent state, because the counter for the number of tiles is > 0. This will lead to a segfault when freeing the tiles' substructures. Fix this by setting the number of tiles to zero if the allocation was unsuccessful. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ivi: Clear got_p_frame before decoding a new frame using itMichael Niedermayer2020-05-211-0/+2
| | | | | | | | Fixes: assertion failure Fixes: 21666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5706468994318336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec, libpostproc: Remove outcommented START/STOP_TIMERAndreas Rheinhardt2020-03-141-5/+0
| | | | | | | as well as includes of libavutil/timer.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Replace get_bits_long() by get_bits() where possibleMichael Niedermayer2019-12-311-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Replace show_bits_long() by show_bits() where possibleMichael Niedermayer2019-12-311-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Allocate bufs laterMichael Niedermayer2019-08-291-19/+20
| | | | | | | | Fixes: Timeout (24sec->2sec) Fixes: 15951/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5095433266790400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Ask for samples with odd tilesMichael Niedermayer2019-07-171-0/+4
| | | | | | | | Fixes: Assertion failure Fixes: 15422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5676625481433088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Move buffer/block end check to caller of ivi_dc_transform()Michael Niedermayer2019-04-191-6/+5
| | | | | | | | Fixes: assertion failure Fixes: 14078/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5760571284127744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Reduce dereferencing structs in inner loop of ↵Michael Niedermayer2019-03-311-20/+25
| | | | | | | | | | ivi_process_empty_tile() This speeds the code up by about 15% Testcase: 13779/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5699589711069184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Mark band parameter as constMichael Niedermayer2019-03-311-7/+7
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: fix indention for previous commitMichael Niedermayer2019-03-311-28/+28
|
* avcodec/ivi: Factor ref_mb check outMichael Niedermayer2019-03-311-4/+5
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Avoid mbs memleakMichael Niedermayer2018-12-231-0/+8
| | | | | | | Fixes: 11696/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5740319635668992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()Michael Niedermayer2018-08-121-2/+3
| | | | | | 396078 -> 268468 dezicycles Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Only clip samples when needed in ivi_output_plane()Michael Niedermayer2018-08-121-2/+9
| | | | | | 435740 -> 396078 dezicycles Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Use av_image_check_size2()Michael Niedermayer2017-07-121-2/+2
| | | | | | | | Fixes OOM Fixes: 1514/clusterfuzz-testcase-minimized-6437666243477504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Free custom blk_vlcMichael Niedermayer2017-05-061-0/+3
| | | | | | | | Fixes memleak Fixes: 1351/clusterfuzz-testcase-minimized-5861971645693952 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 '746c56b7730ce09397d3a8354acc131285e9d829'Clément Bœsch2017-03-201-4/+4
|\ | | | | | | | | | | | | * commit '746c56b7730ce09397d3a8354acc131285e9d829': indeo: Change type of array pitch parameters to ptrdiff_t Merged-by: Clément Bœsch <u@pkh.me>
| * indeo: Change type of array pitch parameters to ptrdiff_tDiego Biurrun2016-09-041-4/+4
| | | | | | | | ptrdiff_t is the correct type for array pitches and similar.
* | avcodec/ivi: use init_get_bits8()Paul B Mahol2017-02-031-1/+3
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch2016-06-291-1/+2
|\| | | | | | | | | | | | | | | | | | | * commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
| * get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-071-1/+2
| | | | | | | | | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
* | Merge commit '6202e2fede75df92cbc374a3f7d6893d0c5ac721'Derek Buitenhuis2016-04-171-17/+16
|\| | | | | | | | | | | | | * commit '6202e2fede75df92cbc374a3f7d6893d0c5ac721': indeo4: Rework stream analysis report Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * indeo4: Rework stream analysis reportVittorio Giovara2016-03-221-17/+16
| | | | | | | | | | | | | | | | * Change log level from error to debug * Print report after the first decoded frame, not at the end of decoding * Drop macro guard and use a context variable instead Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1'Hendrik Leppkes2016-01-021-1/+1
|\| | | | | | | | | | | | | * commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1': Remove stray line breaks from avpriv_{report_missing_feature|request_samples} Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * Remove stray line breaks from avpriv_{report_missing_feature|request_samples}Diego Biurrun2015-12-261-1/+1
| |
* | avcodec/ivi: Check image dimensionsMichael Niedermayer2015-11-141-1/+2
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 1e32c6c591d940337c20b197ec1c4d3d/asan_heap-oob_4a52e5_8946_0bb0d9e863def56005e49f1d89bdc94d.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-201-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-191-2/+2
| |
* | Merge commit '23944d29a22a2cd602753b3705f73011c3bf0b18'Michael Niedermayer2015-03-301-26/+64
|/ | | | | | | * commit '23944d29a22a2cd602753b3705f73011c3bf0b18': indeo: Give Indeo4/5 shared code a more consistent name Merged-by: Michael Niedermayer <michaelni@gmx.at>
* indeo: Give Indeo4/5 shared code a more consistent nameDiego Biurrun2015-03-301-0/+1559