aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/snow.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/snow: Remove ff_snow_release_buffer()Andreas Rheinhardt2025-03-121-11/+2
| | | | | | Pointless after 7e41f95dce6390f39a5134a25213828ed65fac6b. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Remove outdated assertAndreas Rheinhardt2025-03-091-3/+0
| | | | | | | | | It comes from a time before frames were refcounted; it has indeed been added in a follow-up commit to c13e490dce1a66d79e1f053d8a38fb9b2eb53267: "codec_release_buffer: fix handling of non user buffers". This type of check is obsolete now. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Fix off by 1 error in run_bufferMichael Niedermayer2024-08-011-1/+1
| | | | | | | | Fixes: out of array access Fixes: 70741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5703668010647552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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/snow: Move freeing encoder-only buffers to snowenc.cAndreas Rheinhardt2023-09-291-7/+0
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Move initializing HpelDSPContext to snowenc.cAndreas Rheinhardt2023-09-291-1/+0
| | | | | | Only used by the encoder. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Move initializing QpelDSPContext to snowenc.cAndreas Rheinhardt2023-09-291-25/+0
| | | | | | Only used by the encoder. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Move decoder parts out of ff_snow_common_init_after_headerAndreas Rheinhardt2023-09-281-14/+1
| | | | | | | | | | | | | | | They are not common. Furthermore, this file is pulled in when linking checkasm and up until now, the calls to ff_get_buffer() and av_codec_is_decoder() caused all of libavcodec to be pulled in as well. Besides being bad size-wise this also has the downside that it pulls in avpriv_(cga|vga16)_font from libavutil which are marked as being imported from another library when building libavcodec as a DLL; this breaks checkasm because it links both lavc and lavu statically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Split ff_snow_get_buffer()Andreas Rheinhardt2023-09-281-41/+5
| | | | | | | | | | | | The part of said function that is common to both encoder and decoder is negligible since c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a and more than offset by the costs of "Am I an encoder?" checks. So move allocating the frames to the encoder and decoder directly. Also rename ff_snow_frame_start() to ff_snow_frames_prepare(), because a frame without a buffer has not been properly started. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-041-2/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegvideo: Allocate map and score_map buffers jointlyAndreas Rheinhardt2022-10-291-1/+0
| | | | | | Reduces the amounts of allocs, frees and allocation checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Move initializing MotionEstContext to snowenc.cAndreas Rheinhardt2022-10-121-2/+0
| | | | | | | Only used by the encoder. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-271-6/+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/snow: Remove unused halfpel_planeAndreas Rheinhardt2022-07-311-66/+1
| | | | | | | Committed in 5be3a818719d613e2f225cf1532fda01ba106b04 in an unfinished state; never used or finished and always disabled. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/encode: add an encoder-specific get_buffer() variantAnton Khirnov2022-05-111-2/+6
| | | | | | | | | | | Several encoders (roqvideo, svq1, snow, and the mpegvideo family) currently call ff_get_buffer(). However this function is written assuming it is called by a decoder. Though nothing has been obviously broken by this until now, that may change in the future. To avoid potential future issues, introduce a simple encode-specific wrapper around avcodec_default_get_buffer2() and enforce its use in encoders.
* lavc/snow: only allocate mconly_picture for decodingAnton Khirnov2022-05-111-4/+8
| | | | It is not used in the encoder.
* avcodec: Remove unnecessary h263.h inclusionsAndreas Rheinhardt2022-01-091-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-201-2/+3
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snow: Hardcode table to save spaceAndreas Rheinhardt2021-05-021-10/+0
| | | | | | | | The size of ff_qexp is only 32 bytes, but the code to generate it at runtime takes 47 bytes (GCC 9.3, x64, -O3 in an av_cold function); so just hardcode it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/snow: Use ff_thread_once() in ff_snow_common_init()Andreas Rheinhardt2020-12-101-5/+13
| | | | | | | | | | | | ff_snow_common_init() currently initializes static data every time it is invoked; given that both the Snow encoder and decoder have the FF_CODEC_CAP_INIT_THREADSAFE flag set, this can lead to data races (and therefore undefined behaviour) even though all threads write the same values. This commit fixes this by using ff_thread_once() for the initializations. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/snow: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos labelLimin Wang2020-06-131-14/+12
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-6/+6
| | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit 'da0c8664b4dc906696803685f7e53ade68594ab8'Michael Niedermayer2015-06-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'da0c8664b4dc906696803685f7e53ade68594ab8': mpegvideo: Move various temporary buffers to a separate context Conflicts: libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/rv34.c libavcodec/vc1_mc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: replace unspecific error codeMichael Niedermayer2015-06-041-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: fix support for odd dimensionsMichael Niedermayer2015-03-221-4/+4
| | | | | | | | | | | | Fixes Ticket3914 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: Initialize spatial_decomposition_count to a valid valueMichael Niedermayer2015-02-251-0/+1
| | | | | | | | | | | | | | | | Fixes undefined behavior Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: Free all planes and bands independent of the last countMichael Niedermayer2015-02-241-2/+2
| | | | | | | | | | | | | | | | Fixes memleak Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: Fix av_malloc* failure checksMichael Niedermayer2015-01-121-4/+11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: Use av_malloc_array()Michael Niedermayer2015-01-121-3/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: clear freed pointersMichael Niedermayer2014-11-161-1/+3
| | | | | | | | | | | | Avoid leaving stale pointers in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: Make block argumrnt of ff_snow_pred_block() constMichael Niedermayer2014-09-221-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: fix null pointer dereference in cleanup after allocation failureMichael Niedermayer2014-08-111-1/+1
| | | | | | | | | | | | Fixes: snowf.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '2d60444331fca1910510038dd3817bea885c2367'Michael Niedermayer2014-07-171-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '2d60444331fca1910510038dd3817bea885c2367': dsputil: Split motion estimation compare bits off into their own context Conflicts: configure libavcodec/Makefile libavcodec/arm/Makefile libavcodec/dvenc.c libavcodec/error_resilience.c libavcodec/h264.h libavcodec/h264_slice.c libavcodec/me_cmp.c libavcodec/me_cmp.h libavcodec/motion_est.c libavcodec/motion_est_template.c libavcodec/mpeg4videoenc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/x86/Makefile libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: remove unused variablesMichael Niedermayer2014-07-161-2/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: only allocate space for edges when encodingMichael Niedermayer2014-07-161-9/+16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snowdec: remove mpegvideoencdsp dependencyMichael Niedermayer2014-07-161-15/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3c650efb81aaa3b395ba4606ee68a47ee4efb57b'Michael Niedermayer2014-07-071-9/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3c650efb81aaa3b395ba4606ee68a47ee4efb57b': dsputil: Move draw_edges() to mpegvideoencdsp Conflicts: libavcodec/mpegvideo_enc.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c libavcodec/x86/dsputil_x86.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: factor ff_snow_get_buffer() outMichael Niedermayer2014-06-271-11/+21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: ensure the buffers have allocated edgesMichael Niedermayer2014-06-261-1/+10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: fix 1 pixel block sizesMichael Niedermayer2014-05-311-2/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '368f50359eb328b0b9d67451f56fda20b3255f9a'Michael Niedermayer2014-05-301-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '368f50359eb328b0b9d67451f56fda20b3255f9a': dsputil: Split off quarterpel bits into their own context Conflicts: configure libavcodec/dsputil.c libavcodec/h263dec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/vc1dec.c libavcodec/vc1dsp.c libavcodec/x86/dsputil_init.c libavcodec/x86/qpeldsp.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: use FF_ALLOC(Z)_ARRAY_OR_GOTOMichael Niedermayer2014-04-221-6/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: use av_malloc(z)_array()Michael Niedermayer2014-04-181-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '458446acfa1441d283dacf9e6e545beb083b8bb0'Michael Niedermayer2013-11-151-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '458446acfa1441d283dacf9e6e545beb083b8bb0': lavc: Edge emulation with dst/src linesize Conflicts: libavcodec/cavs.c libavcodec/h264.c libavcodec/hevc.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/rv34.c libavcodec/svq3.c libavcodec/vc1dec.c libavcodec/videodsp.h libavcodec/videodsp_template.c libavcodec/vp3.c libavcodec/vp8.c libavcodec/wmv2.c libavcodec/x86/videodsp.asm libavcodec/x86/videodsp_init.c Changes to the asm are not merged, they are left for volunteers or in their absence for later. The changes this merge introduces are reordering of the function arguments See: face578d56c2d1375e40d5e2a28acc122132bc55 Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Rewrite emu_edge functions to have separate src/dst_stride arguments.Ronald S. Bultje2013-09-281-1/+3
| | | | | | | | | | | | This allows supporting files for which the image stride is smaller than the max. block size + number of subpel mc taps, e.g. a 64x64 VP9 file or a 16x16 VP8 file with -fflags +emu_edge.
* | Convert multiplier for MV from int to ptrdiff_t.Ronald S. Bultje2013-09-281-1/+1
| | | | | | | | | | | | | | This prevents emulated_edge_mc from not undoing mvy*stride-related integer overflows. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | snow: Check av_frame_alloc() failuresMichael Niedermayer2013-08-291-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: gray supportMichael Niedermayer2013-08-291-9/+11
| | | | | | | | | | | | Fixes Ticket839 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavcodec/snow: change AVFrame to pointers to AVFrame for ABI stabilityMichael Niedermayer2013-08-291-34/+34
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/snow: check for malloc* failuresMichael Niedermayer2013-08-281-3/+13
| | | | | | | | | | | | Also return and pass on error codes where needed for this Signed-off-by: Michael Niedermayer <michaelni@gmx.at>