summaryrefslogtreecommitdiff
path: root/libavcodec/h264_refs.c
Commit message (Collapse)AuthorAge
* avcodec/h264_refs: Document last if() in ff_h264_execute_ref_pic_marking()Michael Niedermayer2018-09-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_refs: Detect more random access points which are not markedMichael Niedermayer2018-09-03
| | | | | | | Fixes: nature_360-7501616eb5eafca5-1111.mp4 Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'cb167f2947f1a2c446bd8db196d0e64ef4a6d06b'James Almer2017-10-30
|\ | | | | | | | | | | | | * commit 'cb167f2947f1a2c446bd8db196d0e64ef4a6d06b': h264_refs: validate the SPS pointer in ff_h264_execute_ref_pic_marking() Merged-by: James Almer <jamrial@gmail.com>
| * h264_refs: validate the SPS pointer in ff_h264_execute_ref_pic_marking()Sean McGovern2017-05-09
| | | | | | | | | | Bug-Id: 1036 CC: libav-stable@libav.org
| * golomb: Convert to the new bitstream readerDiego Biurrun2017-01-31
| |
* | Merge commit 'b96f0ab3d29cdd9ea9ddabfb2052f72bf8615661'Clément Bœsch2017-03-19
|\| | | | | | | | | | | | | * commit 'b96f0ab3d29cdd9ea9ddabfb2052f72bf8615661': h264: Kill broken disabled cruft Merged-by: Clément Bœsch <u@pkh.me>
| * h264: Kill broken disabled cruftDiego Biurrun2016-08-17
| |
* | avcodec/h264, videotoolbox: fix crash after VT decoder failsAman Gupta2017-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way videotoolbox hooks in as a hwaccel is pretty hacky. The VT decode API is not invoked until end_frame(), so alloc_frame() returns a dummy frame with a 1-byte buffer. When end_frame() is eventually called, the dummy buffer is replaced with the actual decoded data from VTDecompressionSessionDecodeFrame(). When the VT decoder fails, the frame returned to the h264 decoder from alloc_frame() remains invalid and should not be used. Before 9747219958060d8c4f697df62e7f172c2a77e6c7, it was accidentally being returned all the way up to the API user. After that commit, the dummy frame was unref'd so the user received an error. However, since that commit, VT hwaccel failures started causing random segfaults in the h264 decoder. This happened more often on iOS where the VT implementation is more likely to throw errors on bitstream anomolies. A recent report of this issue can be see in http://ffmpeg.org/pipermail/libav-user/2016-November/009831.html The issue here is that the dummy frame is still referenced internally by the h264 decoder, as part of the reflist and cur_pic_ptr. Deallocating the frame causes assertions like this one to trip later on during decoding: Assertion h->cur_pic_ptr->f->buf[0] failed at src/libavcodec/h264_slice.c:1340 With this commit, we leave the dummy 1-byte frame intact, but avoid returning it to the user. This reverts commit 9747219958060d8c4f697df62e7f172c2a77e6c7. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | avcodec/h264_refs: Change default case to av_assert0() to suppress warningMichael Niedermayer2016-09-12
| | | | | | | | | | | | | | | | Should fix "libavcodec/h264_refs.c:372:13: warning: variable 'i' is used uninitialized whenever switch default is taken" Found-by: durandal_17 Suggested-by: jkqxz Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'b13fc1e344011949929975a3451f78f226aa1de3'Timothy Gu2016-08-03
|\| | | | | | | | | | | | | | | | | | | | | | | | | * 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-21
| | | | | | | | | | This should make it more clear that this function does not need any decoder-global state other than the parameter sets.
* | Merge commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c'James Almer2016-08-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | * 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-21
| | | | | | | | | | This will prevent conflicts e.g. in code that deals with both h264 and hevc.
* | Merge commit '251cbb44003caf179fb17afbb8a6c56643c2a646'Clément Bœsch2016-07-29
|\| | | | | | | | | | | | | * 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-21
| | | | | | | | | | | | 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-29
|\| | | | | | | | | | | | | * 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-21
| | | | | | | | This is more consistent with the naming of other decoders.
* | Merge commit 'debca90863e4ee53447efd02483c500f89766384'Clément Bœsch2016-07-27
|\| | | | | | | | | | | | | * 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-21
| | | | | | | | | | | | | | 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.
* | avcodec/h264: remove list_count and ref_count clearingMichael Niedermayer2016-07-20
| | | | | | | | | | | | | | | | | | | | The code conflicts with moving the h264_init_ps() call point Without this, ff_h264_parse_ref_count() fills ref and list count and h264_init_ps() subsequently wipes them out on a "success" path. Subsequently things crash as the wiped fields are used. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_refs: Assert that op is 0-2Michael Niedermayer2016-07-10
| | | | | | | | | | | | Coverity fails to realize this Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '84b2d3fb68caf71cff4b80b44ff865d7ae2531ce'Clément Bœsch2016-07-09
|\| | | | | | | | | | | | | * commit '84b2d3fb68caf71cff4b80b44ff865d7ae2531ce': h264: Drop unused function check_opcodes() Merged-by: Clément Bœsch <u@pkh.me>
| * h264: Drop unused function check_opcodes()Diego Biurrun2016-06-14
| |
* | Merge commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983'Clément Bœsch2016-06-30
|\| | | | | | | | | | | | | * commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983': h264: postpone generating the implicit MMCOs Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: postpone generating the implicit MMCOsAnton Khirnov2016-06-12
| | | | | | | | | | | | Do it right before the MMCOs are applied to the DPB. This will allow moving the frame_start() call out of the slice header parsing, since generating the implicit MMCOs needs to be done after frame_start().
* | Merge commit '2d410ebbaa1e760d6837cb434a6d1d4c3c6f0d85'Clément Bœsch2016-06-30
|\| | | | | | | | | | | | | * commit '2d410ebbaa1e760d6837cb434a6d1d4c3c6f0d85': h264: decode the MMCOs into per-slice contexts Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: decode the MMCOs into per-slice contextsAnton Khirnov2016-06-12
| | | | | | | | | | | | They are stored in the slice header, so technically they are per-slice (though they must be the same in every slice). This will simplify the following commits.
* | Merge commit '39ab2ea53121b9976a619cd545fbd3464b908696'Clément Bœsch2016-06-29
|\| | | | | | | | | | | | | * commit '39ab2ea53121b9976a619cd545fbd3464b908696': h264: rename mmco_index to nb_mmco Merged-by: Clément Bœsch <u@pkh.me>
| * h264: rename mmco_index to nb_mmcoAnton Khirnov2016-06-12
| | | | | | | | | | The variable stores the number of mmco entries, so the current name is misleading.
* | Merge commit 'ed9a20ebe4a89de119ea97bdccf688ece8c6648c' into merge-libav-newClément Bœsch2016-06-29
|\| | | | | | | | | | | | | | | | | * commit 'ed9a20ebe4a89de119ea97bdccf688ece8c6648c': h264: split reading the ref list modifications and actually building the ref list ref_modifications.val are read as u32 instead of u8 in FFmpeg. Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: split reading the ref list modifications and actually building the ref ↵Anton Khirnov2016-06-12
| | | | | | | | | | | | | | | | list This will allow postponing the reference list construction (and by consequence some other functions, like frame_start) until the whole slice header has been parsed.
* | Merge commit '7b50d60442af8d9527e9da46818011fe15a5265a'Clément Bœsch2016-06-29
|\| | | | | | | | | | | | | * commit '7b50d60442af8d9527e9da46818011fe15a5265a': h264: call ff_h264_fill_mbaff_ref_list() when constructing the normal ref list Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: call ff_h264_fill_mbaff_ref_list() when constructing the normal ref listAnton Khirnov2016-06-12
| | | | | | | | There is no real reason to call it separately.
* | Merge commit 'b16e9b9ac9db449cae2242767dd3c3fc309357c4'Clément Bœsch2016-06-29
|\| | | | | | | | | | | | | * commit 'b16e9b9ac9db449cae2242767dd3c3fc309357c4': h264: move initialising the explicit pred weight table for MBAFF Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: move initialising the explicit pred weight table for MBAFFAnton Khirnov2016-06-12
| | | | | | | | | | | | | | Currently it's done in the code that initialises the ref list for MBAFF, which is not a logical place for it. Move it to the function that parses the pred table from the bitstream, which is analogous to what is done for the implicit weight table as well.
| * h264: drop an outdated commentAnton Khirnov2016-06-12
| |
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '89ae244e78a8d636fbb8427a2da052b04cf710bd'Clément Bœsch2016-06-19
|\| | | | | | | | | | | | | * commit '89ae244e78a8d636fbb8427a2da052b04cf710bd': h264_refs: remove an unused parameter from ff_h264_fill_mbaff_ref_list() Merged-by: Clément Bœsch <u@pkh.me>
| * h264_refs: remove an unused parameter from ff_h264_fill_mbaff_ref_list()Anton Khirnov2016-04-24
| |
* | Merge commit '755f79f84cbeb5d749fb120e55e0098a2d7663a0'Clément Bœsch2016-06-19
|\| | | | | | | | | | | | | | | | | | | | | * commit '755f79f84cbeb5d749fb120e55e0098a2d7663a0': h264_refs: make the H264Context const where possible ff_h264_decode_ref_pic_list_reordering() and h264_initialise_ref_list() do not have a const H264Context * as they modify the default_ref inside that context. Merged-by: Clément Bœsch <u@pkh.me>
| * h264_refs: make the H264Context const where possibleAnton Khirnov2016-04-24
| |
* | Merge commit 'a2fd547839d3ef8f342b6f2c096d0887675d3b1a'Clément Bœsch2016-06-19
|\| | | | | | | | | | | | | * commit 'a2fd547839d3ef8f342b6f2c096d0887675d3b1a': h264_refs: reorder functions to avoid forward declarations Merged-by: Clément Bœsch <u@pkh.me>
| * h264_refs: reorder functions to avoid forward declarationsAnton Khirnov2016-04-24
| |
* | Merge commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8'Clément Bœsch2016-06-12
|\| | | | | | | | | | | | | * commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8': h264: factor out calculating the POC count into a separate file Merged-by: Clément Bœsch <u@pkh.me>
| * h264: factor out calculating the POC count into a separate fileAnton Khirnov2016-04-24
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit '3176217c60ca7828712985092d9102d331ea4f3d'Clément Bœsch2016-06-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3176217c60ca7828712985092d9102d331ea4f3d': h264: decouple h264_ps from the h264 decoder Main changes: - a local GetBitContext is created for the various ff_h264_decode_seq_parameter_set() attempts - just like the old code, remove_sps() is adjusted so it doesn't remove the pps. Fixes decode with Ticket #631 http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111108/dae58f17/attachment.mp4 but see next point as well. - ff_h264_update_thread_context() is updated to work even when SPS isn't set as it breaks current skip_frame code. This makes sure we can still decode the sample from ticket #631 without the need for -flags2 +chunks. (Thanks to Michael) - keep {sps,pps}_ref pointers that stay alive even when the active pps/sps get removed from the available lists (patch by michaelni with additionnal frees in ff_h264_free_context() from mateo) - added a check on sps in avpriv_h264_has_num_reorder_frames() to fix crashes with mpegts_with_dvbsubs.ts from Ticket #4074 http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4074/mpegts_with_dvbsubs.ts - in h264_parser.c:h264_parse(), after the ff_h264_decode_extradata() is called, the pps and sps from the local parser context are updated with the pps and sps from the used h264context. This fixes fate-flv-demux. - in h264_slice.c, "PPS changed between slices" error is not triggered anymore in one condition as it makes fate-h264-xavc-4389 fails with THREADS=N (Thanks to Michael) Merged-by: Clément Bœsch <clement@stupeflix.com> Merged-by: Michael Niedermayer <michael@niedermayer.cc> Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
| * h264: decouple h264_ps from the h264 decoderAnton Khirnov2016-04-24
| | | | | | | | | | | | | | | | | | Make the SPS/PPS parsing independent of the H264Context, to allow decoupling the parser from the decoder. The change is modelled after the one done earlier for HEVC. Move the dequant buffers to the PPS to avoid complex checks whether they changed and an expensive copy for frame threads.
* | avcodec/h264_refs: Fix pps_ref_count with multiple PPSMichael Niedermayer2016-06-02
| | | | | | | | | | Found-by: ubitux Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_refs: Remove unused pps_countMichael Niedermayer2016-06-02
| | | | | | | | | | Found-by: ubitux Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>