summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
Commit message (Collapse)AuthorAgeFilesLines
* h264: revert 1189af429211ac650aac730368a6cf5b23756605.Ronald S. Bultje2017-03-281-3/+0
| | | | The patch introduces race conditions.
* avcodec/h264_sei: Check actual presence of SEI picture timing instead of ↵Michael Niedermayer2017-02-151-2/+2
| | | | | | implying it Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: Clear ref_counts on redundant slicesMichael Niedermayer2017-02-081-1/+3
| | | | | | | | Fixes reading freed memory Fixes: 568/clusterfuzz-testcase-6107186067406848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '38efff92f1ef81f3de20ff0460ec7b70c253d714'Clément Bœsch2017-01-241-120/+140
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '38efff92f1ef81f3de20ff0460ec7b70c253d714': FATE: add a test for H.264 with two fields per packet h264: fix decoding multiple fields per packet with slice threads This merge includes two commits because the FATE test was useful in order to make proper testing. The merge gets rid of the now unused: - SLICE_SINGLETHREAD and SLICE_SKIPED macros - max_contexts - "again" label in decode_nal_units() This commit also includes the fix from d3e4d406b. Thanks to wm4 and Michael Niedermayer for their testing. Merged-by: Clément Bœsch <u@pkh.me> Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
| * h264: fix decoding multiple fields per packet with slice threadsAnton Khirnov2016-07-151-47/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | Since we only know whether a NAL unit corresponds to a new field after parsing the slice header, this requires reorganizing the calls to slice parsing, per-slice/field/frame init and actual decoding. In the previous code, the function for slice header decoding also immediately started a new field/frame as necessary, so any slices already queued for decoding would no longer be decodable. After this patch, we first parse the slice header, and if we determine that a new field needs to be started we decode all the queued slices.
* | lavc/h264: simplify find_unused_picture()Clément Bœsch2017-01-191-13/+3
| |
* | Merge commit 'f450cc7bc595155bacdb9f5d2414a076ccf81b4a'Matthieu Bouron2017-01-171-1/+105
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f450cc7bc595155bacdb9f5d2414a076ccf81b4a': h264: eliminate decode_postinit() Also includes fixes from 1f7b4f9abc and e344e65109. Original patch replace H264Context.next_output_pic (H264Picture *) by H264Context.output_frame (AVFrame *). This change is discarded as it is incompatible with the frame reconstruction and motion vectors display code which needs the extra information from the H264Picture. Merged-by: Clément Bœsch <u@pkh.me> Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
| * h264: eliminate decode_postinit()Anton Khirnov2016-07-151-3/+138
| | | | | | | | | | | | | | | | This function's purpose is not very well defined. Currently it does two (only marginally related) things: selecting the next output frame and calling ff_thread_finish_setup() for frame threading. The first of those more properly belongs under field_start(), while the second can be called directly from decode_nal_units().
* | lavc/h264_slice: drop redundant current_slice resetClément Bœsch2017-01-161-2/+0
| | | | | | | | It is done unconditionally in ff_h264_field_end()
* | h264_slice: Wait for refs to be available before we use them in error ↵Derek Buitenhuis2016-12-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | concealment This could happen when there was a frame number gap and frame threading was used. This fixes #5458. 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>
* | Merge commit 'a8cbe5a0ccebf60a8a8b0aba5d5716dd54c1595c'Hendrik Leppkes2016-11-171-4/+4
|\ \ | |/ | | | | | | | | | | * commit 'a8cbe5a0ccebf60a8a8b0aba5d5716dd54c1595c': h264_ps: export actual height in MBs as SPS.mb_height Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264_ps: export actual height in MBs as SPS.mb_heightAnton Khirnov2016-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Currently, SPS.mb_height is actually what the spec calls PicHeightInMapUnits, which is half the frame height when interlacing is allowed. Calling this 'mb_height' is quite confusing, and there are at least two associated bugs where this field is treated as the actual frame height - in the h264 parser and in the code computing maximum reordering buffer size for a given level. Fix those issues (and avoid possible future ones) by exporting the real frame height in this field.
| * h264: Eliminate unused but set variableDiego Biurrun2016-06-231-3/+1
| | | | | | | | libavcodec/h264_slice.c:1384:9: warning: variable 'droppable' set but not used
* | Merge commit '58640fe89ec4f2a3d67c0a2585fca8de34440857'Timothy Gu2016-08-031-0/+32
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '58640fe89ec4f2a3d67c0a2585fca8de34440857': h264: handle frame recovery in h264_field_start() Conflicts: libavcodec/h264dec.c Merged-by: Timothy Gu <timothygu99@gmail.com>
| * h264: handle frame recovery in h264_field_start()Anton Khirnov2016-06-211-0/+18
| | | | | | | | | | | | This is a more appropriate place for this. H264Context.recovery_frame is shared between frame threads, so modifying it where it is right now is invalid.
* | Merge commit 'e26c64148be8a20ace7512d96503172fb5e9753b'Timothy Gu2016-08-031-0/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit 'e26c64148be8a20ace7512d96503172fb5e9753b': h264: discard slices of redundant pictures right after parsing the slice header Conflicts: libavcodec/h264_slice.c libavcodec/h264dec.c TODO: fix indentation Merged-by: Timothy Gu <timothygu99@gmail.com>
| * h264: discard slices of redundant pictures right after parsing the slice headerAnton Khirnov2016-06-211-0/+4
| | | | | | | | | | Going through the whole decoder initialization process for a slice we are not going to decode is unnecessary and potentially dangerous.
* | Merge commit '6efc4638584e1e14d1a6152186ba28f5d48a80c0'Timothy Gu2016-08-031-0/+1
|\ \ | |/ | | | | | | | | | | * commit '6efc4638584e1e14d1a6152186ba28f5d48a80c0': h264: always set redundant_pic_count during slice header parsing Merged-by: Timothy Gu <timothygu99@gmail.com>
| * h264: always set redundant_pic_count during slice header parsingAnton Khirnov2016-06-211-0/+1
| | | | | | | | | | It is always checked in the surrounding code, so this make sure we don't see a value from an old slice.
| * h264: call the hwaccel frame_start() from h264_field_start()Anton Khirnov2016-06-211-0/+6
| | | | | | | | This is a more appropriate place for it.
* | Revert "Revert "Merge commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22'""Timothy Gu2016-08-031-0/+7
| | | | | | | | | | | | | | This reverts commit e4af9be0f45c8f2ca148fb971f1e0c6782530e8c and redoes 796027f22154c799e0063e2457b31e0cfd1dddae. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* | Revert "Merge commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22'"Timothy Gu2016-08-031-7/+0
| | | | | | | | | | | | | | This reverts commit 796027f22154c799e0063e2457b31e0cfd1dddae, reversing changes made to bca30ed2b67f095fd31e07319a622ac30ad22978. Preemptive revert before further testing has been done.
* | Merge commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22'Timothy Gu2016-08-031-0/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22': h264: fix the check for mixed IDR/non-IDR slices Conflicts: libavcodec/h264_slice.c libavcodec/h264dec.c Merged-by: Timothy Gu <timothygu99@gmail.com>
| * h264: fix the check for mixed IDR/non-IDR slicesAnton Khirnov2016-06-211-0/+7
| |
* | Merge commit 'b13fc1e344011949929975a3451f78f226aa1de3'Timothy Gu2016-08-031-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit 'b13fc1e344011949929975a3451f78f226aa1de3': h264: do not pass H264Context to h264_slice_header_parse() Conflicts: libavcodec/h264dec.h Did not merge the h264_slice_header_parse() part. We use a few other members of H264Context for error checking in that function. Merged-by: Timothy Gu <timothygu99@gmail.com>
| * h264: do not pass H264Context to h264_slice_header_parse()Anton Khirnov2016-06-211-19/+19
| | | | | | | | | | This should make it more clear that this function does not need any decoder-global state other than the parameter sets.
* | Merge commit '996f13413b0415097e2a184d161462ffb3ceb647'James Almer2016-08-011-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '996f13413b0415097e2a184d161462ffb3ceb647': h264: fix warnings in fill_filter_caches_inter() Conflicts: libavcodec/h264_slice.c See ef8f6464a55db730cab8c48a1a51fa4e6ca12107 Merged-by: James Almer <jamrial@gmail.com>
| * h264: fix warnings in fill_filter_caches_inter()Anton Khirnov2016-06-211-9/+9
| | | | | | | | | | | | The code does some weird casting to a 2-dimensional sub-array of ref2frm. This is not necessary, since only one dimension is needed there.
* | Merge commit 'bc7f4268514624e1286ea76d27a89a56b4ee18e1'James Almer2016-08-011-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'bc7f4268514624e1286ea76d27a89a56b4ee18e1': h264: drop tests whether the codec id is AV_CODEC_ID_H264 Conflicts: libavcodec/h264dec.c Merged-by: James Almer <jamrial@gmail.com>
| * h264: drop tests whether the codec id is AV_CODEC_ID_H264Anton Khirnov2016-06-211-1/+0
| | | | | | | | Those are unused remnants of the old SVQ3 code.
* | Merge commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c'James Almer2016-08-011-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c': h264: add H264_ prefix to the NAL unit types Conflicts: libavcodec/h264_parse.c libavcodec/h264_parser.c libavcodec/h264_slice.c libavcodec/h264dec.c Merged-by: James Almer <jamrial@gmail.com>
| * h264: add H264_ prefix to the NAL unit typesAnton Khirnov2016-06-211-3/+3
| | | | | | | | | | This will prevent conflicts e.g. in code that deals with both h264 and hevc.
* | Merge commit 'f638b67e5790735f34620bf82025c9b9d6fc7216'James Almer2016-08-011-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'f638b67e5790735f34620bf82025c9b9d6fc7216': h264: move the parameter set definitions to a new header file Conflicts: libavcodec/h264_parse.h libavcodec/h264_ps.c libavcodec/h264dec.h Merged-by: James Almer <jamrial@gmail.com>
| * h264: move the parameter set definitions to a new header fileAnton Khirnov2016-06-211-0/+1
| | | | | | | | | | The PS parsing code is independent from the decoder, so it makes more sense for it to have its own separate header.
* | Merge commit '251cbb44003caf179fb17afbb8a6c56643c2a646'Clément Bœsch2016-07-291-0/+1
|\ \ | |/ | | | | | | | | | | * commit '251cbb44003caf179fb17afbb8a6c56643c2a646': h264: create a new header for common h264 definitions Merged-by: Clément Bœsch <u@pkh.me>
| * h264: create a new header for common h264 definitionsAnton Khirnov2016-06-211-0/+1
| | | | | | | | | | | | Move the NAL unit types into it. This will allow to stop including the whole decoder-specific h264dec.h in some code that is unrelated to the decoder and only needs some enum values.
* | Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'Clément Bœsch2016-07-291-1/+1
|\ \ | |/ | | | | | | | | | | * commit '9df889a5f116c1ee78c2f239e0ba599c492431aa': h264: rename h264.[ch] to h264dec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
| * h264: rename h264.[ch] to h264dec.[ch]Anton Khirnov2016-06-211-1/+1
| | | | | | | | This is more consistent with the naming of other decoders.
* | Merge commit 'f651c6a259d4bc78f25db11d25df9256d5110bd3'Clément Bœsch2016-07-291-0/+166
|\ \ | |/ | | | | | | | | | | * commit 'f651c6a259d4bc78f25db11d25df9256d5110bd3': h264: factor out setting frame properties / side data Merged-by: Clément Bœsch <u@pkh.me>
| * h264: factor out setting frame properties / side dataAnton Khirnov2016-06-211-0/+166
| | | | | | | | | | | | Right now this code is mixed with selecting the next output frame. Move it to a separate function called from h264_field_start(), which is a more appropriate place for this.
* | Merge commit 'bcd91f1644b46dd142c5355c8b742b27d9028903'Clément Bœsch2016-07-291-9/+7
|\ \ | |/ | | | | | | | | | | * commit 'bcd91f1644b46dd142c5355c8b742b27d9028903': h264: move a per-field block from decode_slice_header() to field_start() Merged-by: Clément Bœsch <u@pkh.me>
| * h264: move a per-field block from decode_slice_header() to field_start()Anton Khirnov2016-06-211-9/+7
| | | | | | | | This is a more appropriate place for it.
| * h264: only allow ending a field/starting a new one before finish_setup()Anton Khirnov2016-06-211-15/+19
| | | | | | | | | | Doing this after ff_thread_finish_setup() is called is invalid and can conflict with reads from the other thread.
* | avcodec/h264_slice: Make setup_finished check cover more casesMichael Niedermayer2016-07-271-4/+7
| |
* | Merge commit 'debca90863e4ee53447efd02483c500f89766384'Clément Bœsch2016-07-271-8/+5
|\ \ | |/ | | | | | | | | | | * commit 'debca90863e4ee53447efd02483c500f89766384': h264: store {curr,max}_pic_num in the per-slice context Merged-by: Clément Bœsch <u@pkh.me>
| * h264: store {curr,max}_pic_num in the per-slice contextAnton Khirnov2016-06-211-8/+5
| | | | | | | | | | | | | | While the value of those variables will be constant for the whole frame, they are only used in two functions called from slice header decoding. Moving them to the per-slice context allows us to make the H264Context passed to slice_header_parse() constant.
* | Merge commit 'f966498e433fead2f5e6b5b66fad2ac062146d22'Clément Bœsch2016-07-271-28/+18
|\ \ | |/ | | | | | | | | | | * commit 'f966498e433fead2f5e6b5b66fad2ac062146d22': h264: decode the poc values from the slice header into the per-slice context Merged-by: Clément Bœsch <u@pkh.me>
| * h264: decode the poc values from the slice header into the per-slice contextAnton Khirnov2016-06-211-25/+16
| | | | | | | | | | Copy them into the decoder-global context in field_start(). This avoids modifying the decoder-global context during bitstream parsing.
* | lavc/h264_slice: adjust a few line breaks to reduce diff with LibavClément Bœsch2016-07-271-4/+1
| |
* | Merge commit '54dd9b1cdd9e54f1ee39ae25af0324f8aba2831b'Clément Bœsch2016-07-271-95/+90
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '54dd9b1cdd9e54f1ee39ae25af0324f8aba2831b': h264: set mb_aff_frame in frame_start() h264: move the block starting a new field out of slice_header_parse() Both commits are merged at the same time in order to prevent a regression with Ticket #4440 (see 38660128). Merged-by: Clément Bœsch <u@pkh.me>
OpenPOWER on IntegriCloud