aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo_dec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpegvideo_dec: Move setting dct_unquant funcs to h263dec.cAndreas Rheinhardt2024-06-201-6/+0
| | | | | | | | It is a better place for it; no non-h263-based decoder needs these functions any more (both H.261 and the error resilience code recently stopped doing so). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h261dec: Unquantize coefficients while parsing themAndreas Rheinhardt2024-06-201-5/+6
| | | | | | | | | This is beneficial for performance: When concatenating the file from the vsynth1-h261 fate-test 100 times, performance (measured by timing the codec's decode callback) improved by 9.6%. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Remove unnecessary FFMINAndreas Rheinhardt2024-06-201-3/+10
| | | | | | | No mpegvideo-based decoder supports lowres > 3, so the FFMIN here are unnecessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegutils: Don't output wrong mb skip valuesAndreas Rheinhardt2024-06-201-1/+1
| | | | | | | | | | | | | | The earlier code had two problems: 1. For reference frames that are not directly output (happens unless low_delay is set), the mb skip values referred to the next reference frame to be decoded. 2. For non-reference frames, every macroblock was always considered skipped. This makes the output (worse than) useless; that no one ever complained about this shows that this feature is not really used. It is therefore removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't keep droppable in sync in update_thread_ctxAndreas Rheinhardt2024-06-201-1/+0
| | | | | | | | It is not a stream property, but a property of an individual picture (in fact, it is only set by the FLV decoder that does not even support frame threading). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't alloc framesize-bufs in update_thread_ctxAndreas Rheinhardt2024-06-201-8/+0
| | | | | | | | | | | | | | | | | | | | | | It is always allocated in ff_mpv_frame_start(), so the only reason to put it into ff_mpeg_update_thread_context() would be for the case that a frame-threaded decoder that supports coded fields implements frame-threading. The only mpegvideo-decoders supporting coded fields are MPEG-1/2 and VC-1. The latter's bitstream requires both coded fields to be part of the same access unit/packet, so that every frame thread will always call ff_mpv_frame_start() itself. The former only "need" the framesize buffers when using lowres. If MPEG-1/2 gains frame-threading, one could either perform framesize allocation in its update_thread_context or when starting a field. (Given that the next packet may trigger a reinitialization due to a frame size change, it was possible for the buffers that were allocated here to be thrown away unused.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Set dct_unquantize ptrs only once when possibleAndreas Rheinhardt2024-06-201-14/+7
| | | | | | | Everything except dct_unquantize_intra for MPEG-4 need only be set once. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't sync encoder-only coded_picture_numberAndreas Rheinhardt2024-06-121-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec, rv34: Simplify check for "does pic exist?"Andreas Rheinhardt2024-06-121-5/+5
| | | | | | | The days in which an MPVPicture* is set with the corresponding frame being blank are over; this allows to simplify some checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Avoid MotionEstContext in ff_mpeg_framesize_alloc()Andreas Rheinhardt2024-06-121-3/+2
| | | | | | | | | | Only set the ScratchpadContext and let the users that need it (i.e. encoders) set the MotionEstContext stuff themselves. Also add an explicit pointer to ScratchpadContext to point to the allocated buffer so that none of the other scratchpad pointers is singled out as being used for the allocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Use ThreadProgress instead of ThreadFrame APIAndreas Rheinhardt2024-06-121-11/+14
| | | | | | | | | | | | 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/mpegpicture: Make MPVPicture refcountedAndreas Rheinhardt2024-06-121-51/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, an initialized MpegEncContext had an array of MPVPictures (way more than were ever needed) and the MPVPicture* contained in the MPVWorkPictures as well as the input_picture and reordered_input_picture arrays (for the encoder) pointed into this array. Several of the pointers could point to the same slot and because there was no reference counting involved, one had to check for aliasing before unreferencing. Furthermore, given that these pointers were not ownership pointers the pointers were often simply reset without unreferencing the slot (happened e.g. for the RV30 and RV40 decoders) or there were moved without resetting the src pointer (happened for the encoders where the entries in the input_picture and reordered_input_picture arrays were not reset). Instead actually releasing these pictures was performed by looping over the whole array and checking which one of the entries needed to be kept. Given that the array had way too many slots (36), this meant that more than 30 MPVPictures have been unnecessarily unreferenced in every ff_mpv_frame_start(); something similar happened for the encoder. This commit changes this by making the MPVPictures refcounted via the RefStruct API. The MPVPictures itself are part of a pool so that this does not entail constant allocations; instead, the amount of allocations actually goes down, because the earlier code used such a large array of MPVPictures (36 entries) and allocated an AVFrame for every one of these on every ff_mpv_common_init(). In fact, the pool is only freed when closing the codec, so that reinitializations don't lead to new allocations (this avoids having to sync the pool in update_thread_context). Making MPVPictures refcounted also has another key benefit: It makes it possible to directly share them across threads (when using frame-threaded decoding), eliminating ugly code with underlying av_frame_ref()'s; sharing these pictures can't fail any more. The pool is allocated in ff_mpv_decode_init() for decoders, which therefore can fail now. This and the fact that the pool is not unreferenced in ff_mpv_common_end() also necessitated to mark several mpegvideo-decoders with the FF_CODEC_CAP_INIT_CLEANUP flag. *: This also means that there is no good reason any more for ff_mpv_common_frame_size_change() to exist. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Add close function for mpegvideo-decodersAndreas Rheinhardt2024-06-121-0/+8
| | | | | | | Currently identical to the H.261 and H.263 close functions (which it replaces). It will be extended in future commits. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary PicAndreas Rheinhardt2024-06-121-91/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic) that are directly part of MpegEncContext and an array of MPVPictures that are separately allocated and are mostly accessed via pointers (cur|last|next)_pic_ptr; they are also used to store AVFrames in the encoder (necessary due to B-frames). As the name implies, each of the former is directly associated with one of the _ptr pointers: They actually share the same underlying buffers, but the ones that are part of the context can have their data pointers offset and their linesize doubled for field pictures. Up until now, each of these had their own references; in particular, there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr etc. This is wasteful. This commit changes this relationship: cur_pic, last_pic and next_pic now become MPVWorkPictures; this structure does not have an AVFrame at all any more, but only the cached values of data and linesize. It also contains a pointer to the corresponding MPVPicture, establishing a more natural relationsship between the two. This already means that creating the context-pictures from the pointers can no longer fail. What has not been changed is the fact that the MPVPicture* pointers are not ownership pointers and that the MPVPictures are part of an array of MPVPictures that is owned by a single AVCodecContext. Doing so will be done in a latter commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Rename Picture->MPVPictureAndreas Rheinhardt2024-06-121-6/+7
| | | | | | Picture is just too generic. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Split ff_alloc_picture() into check and alloc partAndreas Rheinhardt2024-06-121-2/+6
| | | | | | | | | | | | ff_alloc_picture() currently does two things: It checks the consistency of the linesize (which should not be necessary, but is) and it allocates certain buffers. (It does not actually allocate the picture buffers, so its name is misleading.) This commit splits it into two separate functions. The rationale for this is that for the encoders, every picture needs its linesizes checked, but not every picture needs these extra buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Cache AVFrame.data and linesize valuesAndreas Rheinhardt2024-06-121-2/+2
| | | | | | | This avoids an indirection and is in preparation for removing the AVFrame from MpegEncContext.(cur|last|next)_pic altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Shorten variable namesAndreas Rheinhardt2024-06-121-65/+63
| | | | | | | | current_picture->cur_pic, last_picture->last_pic, similarly for new_picture and next_picture. Also rename the corresponding *_ptr fields. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo, mpegpicture: Add buffer poolAndreas Rheinhardt2024-06-121-19/+16
| | | | | | | | | | | | | This avoids constant allocations+frees and will also allow to simply switch to the RefStruct API, thereby avoiding the overhead of the AVBuffer API. It also simplifies the code, because it removes the "needs_realloc" field: It was added in 435c0b87d28b48dc2e0360adc404a0e2d66d16a0, before the introduction of the AVBuffer API: given that these buffers may be used by different threads, they were not freed immediately and instead were marked as being freed later by setting needs_realloc. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_motion: Remove dead checks for existence of referenceAndreas Rheinhardt2024-06-121-8/+4
| | | | | | | | These references now always exist due to dummy frames. Also remove the corresponding checks in the lowres code in mpegvideo_dec.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Mark dummy frames as suchAndreas Rheinhardt2024-06-121-0/+2
| | | | | | This will allow to avoid outputting them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Factor allocating dummy frames outAndreas Rheinhardt2024-06-121-33/+52
| | | | | | | | This will allow to reuse it to allocate dummy frames for the second field (which can be a P-field even if the first field was an intra field). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Sync linesize and uvlinesize between threadsAndreas Rheinhardt2024-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | linesize and uvlinesize are supposed to be the common linesize of all the Y/UV-planes of all the currently cached pictures. ff_mpeg_update_thread_context() syncs the pictures, yet it did not sync linesize and uvlinesize. This mostly works, because ff_alloc_picture() only accepts new pictures if they coincide with the linesize of the already provided pictures (if any). Yet there is a catch: Linesize changes are accepted when the dimensions change (in which case the cached frames are discarded). So imagine a scenario where all frame threads use the same dimension A until a frame with a different dimension B is encountered in the bitstream, only to be instantly reverted to A in the next picture. If the user changes the linesize of the frames upon the change to dimension B and keeps the linesize thereafter (possible if B > A), ff_alloc_picture() will report an error when frame-threading is in use: The thread decoding B will perform a frame size change and so will the next thread in ff_mpeg_update_thread_context() as well as when decoding its picture. But the next thread will (presuming it is not the same thread that decoded B, i.e. presuming >= 3 threads) not perform a frame size change, because the new frame size coincides with its old frame size, yet the linesize it expects from ff_alloc_picture() is outdated, so that it errors out. It is also possible for the user to use the original linesizes for the frame after the frame that reverted back to A; this will be accepted, yet the assumption that of all pictures are the same will be broken, leading to segfaults. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Store linesize in ScratchpadContextAndreas Rheinhardt2024-06-121-12/+7
| | | | | | | | | | | | | | | | | | | | | | | The mpegvideo-based codecs currently require the linesize to be constant (except when the frame dimensions change); one reason for this is that certain scratch buffers whose size depend on linesize are only allocated once and are presumed to be correctly sized if the pointers are != NULL. This commit changes this by storing the actual linesize these buffers belong to and reallocating the buffers if it does not suffice. This is not enough to actually support changing linesizes, but it is a start. And it is a prerequisite for the next patch. Also don't emit an error message in case the source ctx's edge_emu_buffer is unset in ff_mpeg_update_thread_context(). It need not be an error at all; e.g. it is a perfectly normal state in case a hardware acceleration is used as the scratch buffers are not allocated in this case (it is easy to run into this issue with MPEG-4) or if the src context was not initialized at all (e.g. because the first packet contained garbage). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec, h264_slice: Return proper error codesAndreas Rheinhardt2024-04-081-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Move getting Picture slot into alloc_picture()Andreas Rheinhardt2024-04-081-37/+26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Factor allocating dummy frame outAndreas Rheinhardt2024-04-081-32/+32
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Remove redundant code to reset keyframe flagAndreas Rheinhardt2024-04-081-2/+0
| | | | | | These AVFrames are blank and therefore the flag is already unset. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Remove obsolete current_picture_ptr reuse codeAndreas Rheinhardt2024-04-081-6/+0
| | | | | | Obsolete since at least 74d623914f02aa79447df43a742efd0929dded04. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't emit non-keyframe warning for H.261Andreas Rheinhardt2024-04-081-1/+1
| | | | | | | | | H.261 does not have keyframes (or indeed frame types) at all, so this warning is not warranted. Also remove an always-true check while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec, mpeg12dec: Move MPEG1/2 code to mpeg12dec.cAndreas Rheinhardt2024-04-081-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, ff_mpv_frame_start() offsets the data of the current picture and doubles the linesizes of all pictures if the current picture is field-based so that data and linesize allow to address the current field only. This is done based upon the current picture_structure value. Only two mpegvideo-based decoders ever set this field: mpeg1/2 and VC-1; but the latter only does it after ff_mpv_frame_start() (when using hardware-acceleration and in order to signal it to the DXVA2 hwaccel) in which case no offset is applied in ff_mpv_frame_start(). So only one decoder actually wants this offset*; therefore move the code performing it to mpeg12dec.c. *: VC-1 doubles linesize when using field_mode (not only the picture's linesize, but also uvlinesize and linesize), yet it does not offset anything. This is further proof that this should not be performed generically. Also move MPEG-1/2 specific setting of the top-field-first flag. (The change here implies that the AVFrame in current_picture may have different top-field-first flags than the AVFrame from current_picture_ptr, but this doesn't matter as only the latter's are used.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: remove deprecated FF_API_FRAME_PICTURE_NUMBERJames Almer2024-03-071-6/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/pthread_frame: Remove ff_thread_release_buffer()Andreas Rheinhardt2023-10-221-17/+17
| | | | | | | | | | | | | | It is unnecessary since the removal of non-thread-safe callbacks in e0786a8eeb9e7c8feb057e83f284491f0a87e463. Since then, the AVCodecContext has only been used as logcontext. Removing ff_thread_release_buffer() allowed to remove AVCodecContext* parameters from several other functions (not only unref functions, but also e.g. ff_h264_ref_picture() which calls ff_h264_unref_picture() on error). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg(picture|video_dec): Move comment to more appropriate placeAndreas Rheinhardt2023-10-101-0/+2
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Move caller-specific parts of function to callersAndreas Rheinhardt2023-10-101-2/+28
| | | | | | | | | Since at least commit c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (adding ff_encode_alloc_frame()), a large part of ff_alloc_picture() is completely separate for the two callers. Move the caller-specific parts out to the callers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Don't allocate buffers unnecessarilyAndreas Rheinhardt2023-10-101-1/+1
| | | | | | | | | | | | | | | | | ff_alloc_picture() performs two tasks: a) In most instances, it allocates frame buffers and b) it allocates certain auxiliary buffers. The exception to a) is the case when the encoder can reuse user-supplied frames. And for these frames the auxiliary buffers are unused, because this frame will never be used as current_picture (and therefore also not as next_picture or last_picture); see select_input_picture(). This means that we can simply avoid calling ff_alloc_picture() with user-supplied frames at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Always initialize IDCTDSPContext during initAndreas Rheinhardt2023-10-051-1/+1
| | | | | | | | | | | It has currently not been done for H263, H263P and MPEG4. Doing so avoids having to initialize the IDCT permutation lateron when decoding packets in order to be able to parse a quant matrix; it means that every mpegvideo decoder always has an initialized IDCTDSPContext after init. Initializing is done generically in ff_mpv_decode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't zero context on init failureAndreas Rheinhardt2023-10-051-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, ff_mpeg_update_thread_context() zeroes the context to initialize on initialization failure. This has been added in e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf. Just as now, ff_mpeg_update_thread_context() simply copied the src MpegEncContext over the dst MpegEncContext to initialize it, but clear_context() was only added in b160fc290cf49b516c5b6ee0730fd9da7fc623b1, so that cleaning up on init failure was a minefield if performed. It was not always performed, namely not before the first allocation needed to be freed. In the fuzzer sample that led to e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf, the call to av_image_check_size() failed and before said commit, the context contained lots of pointers from the src context, leading to assert violations lateron. Of course, the proper fix for this is resetting the pointers (or even better, not copying them in the first place), so this zeroing is unnecessary since commit b160fc290cf49b516c5b6ee0730fd9da7fc623b1. It is also harmful, because it makes initializing something only once during init more complicated; See the h264chroma handling in the diff for an example. Therefore it is removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Don't memset twiceAndreas Rheinhardt2023-10-031-23/+5
| | | | | | | | | This has been done for the luma plane of missing FLV1 and H263 references. Also remove code duplication by reusing gray_frame(), which has been renamed to color_frame() for this purpose. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Check for existence of planes before accessesAndreas Rheinhardt2023-10-031-2/+4
| | | | | | | Fixes segfaults with -debug +nomc -flags +gray (presuming a build with --enable-gray). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Remove commented-out legacy cruftAndreas Rheinhardt2023-10-021-4/+0
| | | | | | | | Added in 80e9e63c946660304fc65fa8141ccfdbe4d196d1 for reasons unknown to me. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/threadframe: Move ff_thread_can_start_frame() to thread.hAndreas Rheinhardt2023-09-181-0/+1
| | | | | | | It does not use ThreadFrames at all, so thread.h is the correct place. bcb0faeaba60b5d329fafee2e55f28d3c709e7b1 was wrong. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/internal: Don't auto-include emms.hAndreas Rheinhardt2023-09-041-0/+1
| | | | | | Instead include emms.h wherever it is needed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Use av_fast_padded_malloc where appropriateAndreas Rheinhardt2023-08-021-11/+6
| | | | | | Will probably also fix Coverity issue #1473529. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: properly set output frames as keyframesJames Almer2023-07-151-2/+2
| | | | | | | Should fix ticket #10426. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegvideo_dec: Add NULL pointer checks to MPV_motion_lowres()Michael Niedermayer2023-06-181-5/+8
| | | | | | | | | | | This makes the null pointer checks match mpv_motion_internal() Fixes: NULL pointer dereference Fixes: 59671/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-4993004566609920 Fixes: 59678/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEGVIDEO_fuzzer-4893168991338496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_dec: consider interlaced lowres 4:2:0 chroma in edge ↵Michael Niedermayer2023-06-181-2/+2
| | | | | | | | | | emulation check better Fixes: out of array read Fixes: 59673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5194311374077952 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-041-3/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-041-5/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: deprecate AVFrame.coded_picture_number and display_picture_numberMarton Balint2023-02-131-0/+4
| | | | | | | | Their usefulness is questionable, very few decoders set them, and their type should have been int64_t. A replacement field can be added later if a valid use case is found. Signed-off-by: Marton Balint <cus@passwd.hu>