summaryrefslogtreecommitdiff
path: root/libavcodec/h264dec.c
Commit message (Collapse)AuthorAge
* avcodec/h264dec: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lableLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264dec: store count of the tables into const variable for long linesLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264dec: cosmeticsLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264dec: Disable forced small_padding on flag2 fastMichael Niedermayer2020-06-02
| | | | | | | Fixes: 20978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5746381832847360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264dec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-27
| | | | | | | | | | | then ff_h264_free_tables() and h264_decode_end() can be removed in h264_decode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* h264dec: support exporting QP tables through the AVVideoEncParams APIAnton Khirnov2020-05-25
|
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* h264dec: do not set picture_structure on initAnton Khirnov2020-04-10
| | | | | This has been cargo culted from mpegvideo and serves no useful purpose. It will be initialize correctly in h264_field_start()
* h264dec: rename flush_dpb()Anton Khirnov2020-04-10
| | | | | The name is misleading, this function does a lot more than just flushing the DPB.
* h264_ps: make the PPS hold a reference to its SPSAnton Khirnov2020-04-10
| | | | | | | | It represents the relationship between them more naturally and will be useful in the following commits. Allows significantly more frames in fate-h264-attachment-631 to be decoded.
* h264dec: do not abort if decoding extradata failsAnton Khirnov2020-04-10
| | | | | | Such errors are not necessarily fatal and decoding might still be possible, e.g. it happens for MVC streams where we do not handle the subset SPS thus failing to parse its corresponding PPS.
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-10
| | | | | | | | | | | | | | | | init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | This is a constant codec property, so a capability flag is more appropriate.
* h264dec: do not export the chroma sample location immediately on parsing the SPSAnton Khirnov2020-03-20
| | | | | This SPS is not necessarily the one that will be used. Export the chroma location along with all the other SPS properties.
* libavcodec, libpostproc: Remove outcommented START/STOP_TIMERAndreas Rheinhardt2020-03-14
| | | | | | | 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/h264: Fix poc_lsb in open gop contextNicolas Gaullier2019-09-10
| | | | | When no IDR nor mmco_reset is found, prev_poc_lsb is undefined and shall not be assumed to be zero
* avcodec/h264dec: set AVFrame decode_error_flags in case of decoding errorAmir Pauker2019-07-07
| | | | | | | | | set AVFrame decode_error_flags in case h->slice_ctx->er.error_occurred is set after the call to ff_h264_execute_decode_slices. This allows the user to detect concealed decoding errors in the call to avcodec_receive_frame Signed-off-by: Amir Pauker <amir@livelyvideo.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* h2645_parse: Make ff_h2645_packet_split reference-compatibleAndreas Rheinhardt2019-01-23
| | | | | | | This is in preparation for a patch for cbs_h2645. Now the packet's rbsp_buffer can be owned by an AVBuffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* lavc/h264dec: don't error out when receiving multiple IDR slicesJosh de Kock2018-10-26
| | | | | | | | | | This error isn't particularly helpful as checking for mixed IDR/non-IDR NALUs would need to be done at a higher level to actually be accurate. Removing the error allows an API user to send individual slice NALUs (i.e. incomplete frames) so they can take advantage of slice threading. The ticket which this error was added for (#4408) no longer segfaults after removing this error (as the bug was likely fixed more properly elsewhere).
* avcodec/h264dec: remove unnecessary checks in h264_decode_frameZhao Zhili2018-09-07
| | | | | | | These conditions are checked again in is_extra(). This patch makes no functional changes. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264dec: check number of SPS in is_extraZhao Zhili2018-09-07
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* h264: Support multi-field closed captions by using AVBufferRef and not ↵Kieran Kunhya2018-08-17
| | | | | | resetting per field Signed-off-by: Josh de Kock <joshdk@obe.tv>
* lavc/videotoolbox: fix threaded decodingRodger Combs2018-03-08
| | | | | | | | | | | | | | | | | | AVHWAccel.end_frame can run on a worker thread. The assumption of the frame threading code is that the worker thread will change the AVFrame image data, not the AVFrame fields. So the AVFrame fields are not synced back to the main thread. But this breaks videotoolbox due to its special requirements (everything else is fine). It actually wants to update AVFrame fields. The actual videotoolbox frame is now stored in the dummy AVBufferRef, so it mimics what happens in non-videotoolbox cases. (Changing the AVBufferRef contents is a bit like changing the image data.) The post_process callback copies that reference to the proper AVFrame field. Based on a patch by wm4. Signed-off-by: Aman Gupta <aman@tmm1.net>
* h264: add AVOption to set x264_build defaultwm42017-12-26
| | | | | | | | | | | This provides a generic way to the API user to deal with files that either lack this SEI, or which have the SEI only in packets not passed to the decoder (such as the common case of the SEI being in the very firsat video packet, but decoding is started somewhere in the middle of the file). Bugs like 840b41b2a643fc8f0617c0370125a19c02c6b586 make this somewhat of a necessity. This intentionally uses the version in the SEI instead, if any is found.
* h264dec: Remove mpeg4video.h header dependencyKieran Kunhya2017-12-11
|
* avcodec/h264_sei: remove redundant prefix to H264SEIFramePacking fieldsJames Almer2017-12-01
| | | | | | Cosmetic change. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-26
| | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* avcodec/h264: implement new decode_params callback for PPS/SPSAman Gupta2017-11-13
| | | | | | | | | This callback will be used by the VideoToolbox H264 hwaccel so that it can receive SPS and PPS NALUs. VideoToolbox requires PPS changes to be fed into the decoder session, and for the session to be recreated when the SPS changes. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are ↵Aman Gupta2017-11-13
| | | | | | | | | | | | | | produced The only reason videotoolbox wouldn't produce frames is if the data fed to it was invalid, so returning AVERROR_INVALIDDATA makes sense here. Further, it means AVERROR_EXTERNAL can be used in further commits to signal fatal VideoToolbox errors, letting the user know that they need to fallback to another decoder. Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4'James Almer2017-11-08
|\ | | | | | | | | | | | | * commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4': h264dec: track the last seen value of x264_build Merged-by: James Almer <jamrial@gmail.com>
| * h264dec: track the last seen value of x264_buildAnton Khirnov2017-07-26
| | | | | | | | | | | | | | | | | | | | Do not use the one in the SEI directly as that is reset at certain points. Inspired by patches from Michael Niedermayer <michaelni@gmx.at> and Anton Mitrofanov <BugMaster@narod.ru>. CC: libav-stable@libav.org
* | Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit 'dd343fd986459f467a2d1d70c26101dff1d47d68': lavu: Drop deprecated VDPAU pixel formats Merged-by: James Almer <jamrial@gmail.com>
* | Merge commit '5182a28b5de060c51c21b36053ab205bfbbbbe31'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit '5182a28b5de060c51c21b36053ab205bfbbbbe31': lavc: Drop deprecated global afd field Merged-by: James Almer <jamrial@gmail.com>
* | Merge commit '7b917041184874e7d7cba4450813de7e0bb28a33'James Almer2017-10-21
|\| | | | | | | | | | | | | * commit '7b917041184874e7d7cba4450813de7e0bb28a33': lavc: Drop deprecated VDPAU codec capability Merged-by: James Almer <jamrial@gmail.com>
| * h264dec: initialize field_started to 0 on each decode callAnton Khirnov2017-03-12
| | | | | | | | | | | | | | | | It might be incorrectly set to 1 if the previous call exited with an error. Bug-Id: 1019 CC: libav-stable@libav.org
* | Merge commit '248dc5c1646dcdd96fe79761105c4ae889e711fd'James Almer2017-10-03
|\| | | | | | | | | | | | | * commit '248dc5c1646dcdd96fe79761105c4ae889e711fd': h264dec: fix dropped initial SEI recovery point Merged-by: James Almer <jamrial@gmail.com>
| * h264dec: fix dropped initial SEI recovery pointJohn Stebbins2017-02-24
| |
| * golomb: Convert to the new bitstream readerDiego Biurrun2017-01-31
| |
| * h264dec: export cropping information instead of handling it internallyAnton Khirnov2017-01-12
| |
| * h264dec: be more explicit in handling container croppingAnton Khirnov2017-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | The current condition can trigger in cases where it shouldn't, with unexpected results. Make sure that: - container cropping is really based on the original dimensions from the caller - those dimenions are discarded on size change The code is still quite hacky and eventually should be deprecated and removed, with the decision about which cropping is used delegated to the caller.
* | h264dec: remove unneeded prototypeRafaël Carré2017-07-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264dec: export cropping information instead of handling it internallyJames Almer2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | This merges commit c3e84820d67cb1d8cfb4196f9b43971308a81571 from libav, originally written by Anton Khirnov and skipped in fc63d5ceb357c4b760cb02772de0b50d0557140f. libavcodec/h264_picture.c | 3 --- libavcodec/h264_ps.c | 9 --------- libavcodec/h264_slice.c | 25 +++++++++++++++++++------ libavcodec/h264dec.c | 13 +------------ libavcodec/h264dec.h | 9 +++++---- 5 files changed, 25 insertions(+), 34 deletions(-)
* | avcodec/h264dec: be more explicit in handling container croppingJames Almer2017-05-26
| | | | | | | | | | | | | | | | | | | | | | This merges commit 4fded0480f20f4d7ca5e776a85574de34dfead14 from libav, originally written by Anton Khirnov and skipped in fc63d5ceb357c4b760cb02772de0b50d0557140f. libavcodec/h264_slice.c | 20 +++++++++++++------- libavcodec/h264dec.c | 3 +++ libavcodec/h264dec.h | 5 +++++ 3 files changed, 21 insertions(+), 7 deletions(-)
* | Merge commit 'f1af37b51033ad90e56a8d7dfcc366f2bd9d2fed'Clément Bœsch2017-05-05
|\| | | | | | | | | | | | | * commit 'f1af37b51033ad90e56a8d7dfcc366f2bd9d2fed': h264dec: make ff_h264_decode_init() static Merged-by: Clément Bœsch <cboesch@gopro.com>
| * h264dec: make ff_h264_decode_init() staticAnton Khirnov2017-01-09
| | | | | | | | It is not called from outside h264dec.c anymore.
| * h264dec: make sure to only end a field if it has been startedAnton Khirnov2016-12-19
| | | | | | | | | | | | | | | | Calling ff_h264_field_end() when the per-field state is not properly initialized leads to all kinds of undefined behaviour. CC: libav-stable@libav.org Bug-Id: 977 978 992
| * pthread_frame: ensure the threads don't run simultaneously with hwaccelAnton Khirnov2016-12-19
| |
| * h264dec: support broken files with mp4 extradata/annex b dataAnton Khirnov2016-10-02
| | | | | | | | Bug-Id: 966
| * h264dec: reset nb_slice_ctx_queued for hwaccel decodingAnton Khirnov2016-08-03
| | | | | | | | | | | | Fixes hwaccel decoding of files with multiple slices. Found-By: Mark Thompson <sw@jkqxz.net>
| * h264dec: do not call finish_setup() if we have not started a frameAnton Khirnov2016-07-20
| | | | | | | | | | Found-By: Jan Ruge <jan.s.ruge@gmail.com> Bug-Id: 952