aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/error_resilience.h
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/error_resilience: Avoid me_cmp.h inclusionAndreas Rheinhardt2025-03-261-2/+4
| | | | | | | | Use spell out what me_cmp_func means. Avoids inclusions in the H.264 decoder as well as all mpegvideo decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: Fix doxy comments wrongly designated as trailing ///<Andreas Rheinhardt2025-03-121-1/+1
| | | | | | | | | | | The ///< or /**< form of doxygen comments are only to be used when the documentation follows the member and the comment block starts on the same line as the member. This commit fixes wrong uses of them; in particular, this fixes the comment for mb_height in H.264 SPS's structure which was wrongly added to mb_width. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Use ThreadProgress instead of ThreadFrame APIAndreas Rheinhardt2024-06-121-0/+1
| | | | | | | | | | | | Given that MPVPictures are already directly shared between threads in case of frame-threaded decoding, one can simply use it to pass decoding progress information between threads. This allows to avoid one level of indirection; it also means avoids allocations (of the ThreadFrameProgress structure) in case of frame-threading and indeed makes ff_thread_release_ext_buffer() decoder-only (actually, H.264-decoder-only). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Constify ThreadFrame*Andreas Rheinhardt2023-10-121-2/+1
| | | | | | | | Forgotten in 0eb399ac3953da16f880a1e455bb009a45f76d49. While just at it, also use a forward declaration. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Make applying decode_error_flags optionalAndreas Rheinhardt2023-09-151-1/+11
| | | | | | | | | | Add a pointer parameter that if supplied will be used to return the updated decode_error_flags. This will allow to fix several races when using frame-threading; these resulted from AVFrame that the earlier code updated concurrently being used as source in an av_frame_ref() call in the decoder's update_thread_context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "avcodec/er: remove check for fields"Michael Niedermayer2023-04-141-1/+0
| | | | | | | | | Fixes: out of array write on x86-32 Fixes: 57825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6094366187061248 Fixes: 57829/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-4526419991724032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg This reverts commit f7abe92bd7939b6aeeb2393fe141033e733305d4.
* avcodec/er: remove check for fieldsJ. Dekker2023-03-271-0/+1
| | | | | | | This change on its own is almost certainly not correct; however, in testing, many samples show notable improvement. Signed-off-by: J. Dekker <jdek@itanimul.li>
* avcodec/error_resilience: Avoid overhead of AVBuffer APIAndreas Rheinhardt2022-08-081-2/+2
| | | | | | These buffers are not shared in any way. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Only keep what is needed from MECmpContextAndreas Rheinhardt2022-05-191-1/+2
| | | | | | | | | ERContext currently has an embedded MECmpContext, despite only needing exactly one function from it. This is wasteful because MECmpContext is pretty large (135 pointers, 1080 B for eight byte pointers). So keep only what is needed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Remove write only ERContext.ref_countAndreas Rheinhardt2022-03-251-1/+0
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* error_resilience: remove avpriv_atomic usageRostislav Pehlivanov2017-11-261-1/+2
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* Merge commit '6b52762951fa138eef59e2628dabb389e0500e40'Clément Bœsch2017-03-201-2/+2
|\ | | | | | | | | | | | | * commit '6b52762951fa138eef59e2628dabb389e0500e40': error_resilience: Change type of array stride parameters to ptrdiff_t Merged-by: Clément Bœsch <u@pkh.me>
| * error_resilience: Change type of array stride parameters to ptrdiff_tDiego Biurrun2016-09-071-2/+2
| | | | | | | | ptrdiff_t is the correct type for array strides and similar.
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-1/+1
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '29c2d06d67724e994980045afa055c6c34611b30'Derek Buitenhuis2016-02-241-1/+0
|\| | | | | | | | | | | | | * commit '29c2d06d67724e994980045afa055c6c34611b30': cosmetics: Drop empty comment lines Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * cosmetics: Drop empty comment linesDiego Biurrun2016-02-181-1/+0
| |
* | avcodec/error_resilience: Avoid race with updating the error_countMichael Niedermayer2015-04-051-1/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'cf1e0786ed64e69614760bfb4ecd7adbde8e6094'Michael Niedermayer2015-01-271-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cf1e0786ed64e69614760bfb4ecd7adbde8e6094': error_resilience: move the MECmpContext initialization into ER code Conflicts: libavcodec/error_resilience.c libavcodec/h264.c libavcodec/h264.h libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * error_resilience: move the MECmpContext initialization into ER codeAnton Khirnov2015-01-271-1/+2
| | | | | | | | | | | | | | Currently, it needs to be initialized by the ER caller (which is currently either a mpegvideo decoder or h264dec). However, since none of those decoders use MECmpContext for anything except ER, it makes more sense to handle it purely inside ER.
* | 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>
| * dsputil: Split motion estimation compare bits off into their own contextDiego Biurrun2014-07-171-2/+2
| |
* | Various small spelling fixes.Reimar Döffinger2014-04-221-1/+1
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | avcodec/error_resilience: fix the case when MVs are not availableMichael Niedermayer2014-03-171-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd66e305bd1b4f3e91ae4e7e549148509d0811672'Michael Niedermayer2014-03-171-3/+16
|\| | | | | | | | | | | | | | | | | | | | | * commit 'd66e305bd1b4f3e91ae4e7e549148509d0811672': er: move relevant fields from Picture to ERPicture Conflicts: libavcodec/error_resilience.c libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * er: move relevant fields from Picture to ERPictureVittorio Giovara2014-03-161-3/+16
| | | | | | | | | | | | | | This is done to disentangle ER from mpegvideo. In order to use a classic Picture, callers can use ff_mpeg_set_erpic() or use a custom function to set the fields. Please note that buffers need to be allocated before calling ff_er_frame_end().
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-02-171-0/+5
|\| | | | | | | | | | | | | * qatar/master: error_resilience: add required headers. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * error_resilience: add required headers.Anton Khirnov2013-02-171-0/+5
| |
* | Merge commit '54974c62982ae827becdbdb9b620b7ba75d079a0'Michael Niedermayer2013-02-161-4/+4
|/ | | | | | | | | | | | | | * commit '54974c62982ae827becdbdb9b620b7ba75d079a0': error_resilience: decouple ER from MpegEncContext Conflicts: libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/h264.c libavcodec/mpegvideo.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* error_resilience: decouple ER from MpegEncContextAnton Khirnov2013-02-151-0/+74