summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
Commit message (Collapse)AuthorAge
* avcodec/h264dec: update exported AVOptions in the user-facing contextJames Almer2021-04-14
| | | | | | | | Based on a patch by Hendrik Leppkes. Fixes ticket #9176. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_slice: Check input SPS in ff_h264_update_thread_context()Michael Niedermayer2021-03-31
| | | | | | | | Fixes: crash Fixes: check_pkt.mp4 Found-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: Check sps in h264_slice_header_init()Michael Niedermayer2021-03-26
| | | | | | | | | Fixes: null pointer dereference Fixes: h264_slice_header_init.mp4 Found-by: Rafael Dutra <rafael.dutra@cispa.de> Tested-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: don't copy frame data during error concealmentJames Almer2021-03-11
| | | | | | | | | In addition to the fact that av_image_copy() cannot handle hardware pixel formats, h->short_ref[0]->f may not be writable at this point. Based on a patch by Hendrik Leppkes. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_slice: fix undefined integer overflow with POC in error concealmentMichael Niedermayer2020-10-18
| | | | | | | | | | Alternatively the POC could be changed to 64bit. the large values seem to be within what is allowed. Fixes: signed integer overflow: 2147483646 + 2 cannot be represented in type 'int' Fixes: 26076/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711127201447936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: use av_buffer_replace() to simplify codeJames Almer2020-10-05
| | | | | | | Based on eff289ce9f030f023e218ee7ce354d4f0e035b6d. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_slice: sync User Data Unregistered SEI buffers across threadsJames Almer2020-09-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use av_timecode_make_smpte_tc_string2 in hevc and h264 decoderMarton Balint2020-09-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/h264_slice: add timecode metadataLimin Wang2020-07-09
| | | | | | | | Please test with below command: ./ffplay -vf drawtext="fontfile=/Library/Fonts/Arial.ttf:text=\\'%{metadata\\:timecode}\\'" \ ../fate-suite/h264/crew_cif_timecode-2.h264 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264_slice: replace cur->f with out for better readabilityLimin Wang2020-07-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264_slice: use av_timecode_get_smpte()Limin Wang2020-06-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264: create user data unregistered SEI side data for H.264Limin Wang2020-06-15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* h264dec: support exporting QP tables through the AVVideoEncParams APIAnton Khirnov2020-05-25
|
* 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.
* h264_sei: parse the picture timing SEIs correctlyAnton Khirnov2020-04-10
| | | | | | | | | Those SEIs refer to the currently active SPS. However, since the SEI NALUs precede the coded picture data in the bitstream, the active SPS is in general not known when we are decoding the SEI. Therefore, store the content of the picture timing SEIs and actually parse it when the active SPS is known.
* 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.
* h264dec: do not return a value from init_dimensions()Anton Khirnov2020-03-16
| | | | There are no failure cases left in this function.
* 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_slice: clear frame only on gaps when it is not otherwise ↵Michael Niedermayer2019-09-24
| | | | | | | | | | initilaized Fixes: Timeout (53sec -> 31sec) Fixes: 16908/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711207859748864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: set the SEI parameters early on the AVCodecContextSteve Lhomme2019-07-14
| | | | | | | | | It's better to do it before the buffers are actually created. At least in VLC we currently don't support changing some parameters dynamically easily so we don't use the information if it comes after the buffer are created. Co-authored-by: James Almer <jamrial@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_slice: Fix integer overflow in implicit_weight_table()Michael Niedermayer2019-01-12
| | | | | | | | Fixes: signed integer overflow: 2 * 2132811760 cannot be represented in type 'int' Fixes: 11156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6237685933408256 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* h264/pic_timing: support multiple timecodesJosh de Kock2018-10-23
|
* lavc/h264: create AVFrame side data from H.264 timecodesDevin Heitmueller2018-10-23
| | | | | | | | | Create SMPTE ST 12-1 timecodes based on H.264 SEI picture timing info. For framerates > 30 FPS, the field flag is used in conjunction with pairs of frames which contain the same frame timestamp in S12M. Ensure the field is properly set per the spec.
* h264_slice: Copy the value of x264_build before calling ↵Derek Buitenhuis2018-10-09
| | | | | | | | | | | | | h264_slice_header_init during thread init If we don't copy this value first, it is seen as 0 by h264_slice_header_init, due to zero-allocation of the new context, triggering an old hack that multiplied the denominator by 2 for files produced by old x264 versions, but only if more than one thread was used. Fixes #7475 and #7083. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* 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>
* h264_slice: Fix return of incomplete frames from decoderJohn Stebbins2018-06-28
| | | | | | | | | | | When not using libavformat for demuxing, AVCodecContext.has_b_frames gets set too late causing the recovery frame heuristic in h264_refs to incorrectly flag an early frame as recovered. This patch sets has_b_frames earlier to prevent improperly flagging the frame as recovered. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: Fix integer overflow with last_pocMichael Niedermayer2018-04-12
| | | | | | | | Fixes: signed integer overflow: 2147483646 - -2816 cannot be represented in type 'int' Fixes: crbug 823145 Reported-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264: Increase field_poc to 64bit in ff_h264_init_poc() to detect ↵Michael Niedermayer2018-02-17
| | | | | | | | | | overflows Fixes: Integer overflow Fixes: 5746/clusterfuzz-testcase-minimized-6270097623613440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: Do not attempt to render into frames already outputMichael Niedermayer2018-01-07
| | | | | | | | | | Fixes: null pointer dereference Fixes: 4698/clusterfuzz-testcase-minimized-5096956322906112 This testcase does not reproduce the issue before 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: use H264_SEI_FpaType enum constantsJames Almer2017-12-01
| | | | | | Cosmetic change. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_sei: remove redundant prefix to H264SEIFramePacking fieldsJames Almer2017-12-01
| | | | | | Cosmetic change. Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'James Almer2017-11-29
|\ | | | | | | | | | | | | * commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa': stereo3d: Support view type for frame sequence type Merged-by: James Almer <jamrial@gmail.com>
| * stereo3d: Support view type for frame sequence typeVittorio Giovara2017-11-28
| | | | | | | | | | | | Implement detection in h264 and hevc and insertion in framepack filter. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * h264: Add support for alternative transfer characterics SEIVittorio Giovara2017-08-10
| | | | | | | | | | | | | | | | | | | | The use of this SEI is for backward compatibility in HLG HDR systems: older devices that cannot interpret the "arib-std-b67" transfer will get the compatible transfer (usually bt709 or bt2020) from the VUI, while newer devices that can interpret HDR will read the SEI and use its value instead. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * h264dec: add a CUVID hwaccelAnton Khirnov2017-07-26
| | | | | | | | | | Some parts of the code are based on a patch by Timo Rothenpieler <timo@rothenpieler.org>
* | h264dec: add a NVDEC hwaccelAnton Khirnov2017-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some parts of the code are based on a patch by Timo Rothenpieler <timo@rothenpieler.org> Merges Libav commit b9129ec4668c511e0a79e25c6f25d748cee172c9. Due to the name clash with our cuvid decoder, rename it to nvdec. This commit also changes the Libav code to dynamic loading of the cuda/cuvid libraries. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | 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
| * dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-08
| | | | | | | | | | | | | | | | | | | | This also adds support to avconv (which is trivial due to the new hwaccel API being generic enough). The new decoder setup code in dxva2.c is significantly based on work by Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites. Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * h264_sei: Add namespace prefix to all SEI valuesMark Thompson2017-05-16
| | | | | | | | | | This avoids confusion with equivalent H.265 SEI values when both are being used at the same time.
* | lavc: drop VDAClément Bœsch2017-10-23
| | | | | | | | | | Deprecated (aka removed) in OSX 10.11, and we have a replacement for it (VideoToolbox).
* | Merge commit '7b917041184874e7d7cba4450813de7e0bb28a33'James Almer2017-10-21
|\| | | | | | | | | | | | | * commit '7b917041184874e7d7cba4450813de7e0bb28a33': lavc: Drop deprecated VDPAU codec capability Merged-by: James Almer <jamrial@gmail.com>
| * h264_sei: Check actual presence of picture timing SEI messageMichael Niedermayer2017-02-28
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * 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: drop a redundant checkAnton Khirnov2017-01-09
| | | | | | | | | | Cropping parameters are already checked for validity during SPS parsing, no need to check them again.
| * 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
| * h264_slice: Wait for refs to be available before we use them in error ↵Derek Buitenhuis2016-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | concealment This could happen when there was a frame number gap and frame threading was used. Debugging-by: Ronald S. Bultje <rsbultje@gmail.com> Debugging-by: Justin Ruggles <justin.ruggles@gmail.com> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | h264_sei: Add namespace prefix to all SEI valuesMark Thompson2017-09-12
| | | | | | | | | | | | | | This avoids confusion with equivalent H.265 SEI values when both are being used at the same time. (cherry picked from commit 6ea220cbeec8863e2006a03b73bed52db2b13ee7)