summaryrefslogtreecommitdiff
path: root/libavcodec/h264_refs.c
Commit message (Collapse)AuthorAge
...
* | Merge commit 'e481458bc308ee838deaeacac51929514762e7a7'Derek Buitenhuis2016-04-26
|\| | | | | | | | | | | | | * commit 'e481458bc308ee838deaeacac51929514762e7a7': h264: factor out pred weight table parsing into a separate file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: factor out pred weight table parsing into a separate fileAnton Khirnov2016-03-28
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit '29c2d06d67724e994980045afa055c6c34611b30'Derek Buitenhuis2016-02-24
|\| | | | | | | | | | | | | * commit '29c2d06d67724e994980045afa055c6c34611b30': cosmetics: Drop empty comment lines Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * cosmetics: Drop empty comment linesDiego Biurrun2016-02-18
| |
* | avcodec/h264_refs: Fix and add back trace code removed in ↵Michael Niedermayer2016-01-04
| | | | | | | | e1c5170c638e39a8017827339ac687c5f6ff9b35
* | Merge commit '2080bea4a74b6b1598caa806a11ea807ba546f94'Hendrik Leppkes2016-01-04
|\| | | | | | | | | | | | | * commit '2080bea4a74b6b1598caa806a11ea807ba546f94': h264_refs: Remove broken trace debug code Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264_refs: Remove broken trace debug codeDiego Biurrun2016-01-03
| |
| * h264: improve behaviour with invalid reference listsAnton Khirnov2016-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | Before 741b494fa8cd28a7d096349bac183893c236e3f9, when the reference list modification description was invalid, the code would substitute the corresponding reference from the initial ("default") reference list. After that commit, it will just return an error. Since there are apparently invalid samples in the wild that used to play fine with the old code, it is a good idea to re-add some sort of error resilience here. So, when the reference list modification results in a missing frame, substitute a previous reference frame for it. The relevant sample again decodes fine with the same output as previously.
* | avcodec/h264: Fix regression caused by removial of default_ref_listMichael Niedermayer2016-01-04
| | | | | | | | | | | | This fixes a regression of the sample from Ticket 2371 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: Use get_ue_golomb_long() when neededMark Harris2015-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_ue_golomb() cannot decode values larger than 8190 (the maximum value that can be golomb encoded in 25 bits) and produces the error "Invalid UE golomb code" if a larger value is encountered. Use get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294) when valid h264/hevc values can exceed 8190. This updates decoding of the following values: (maximum) first_mb_in_slice 36863* for level 5.2 abs_diff_pic_num_minus1 131071 difference_of_pic_nums_minus1 131071 idr_pic_id 65535 recovery_frame_cnt 65535 frame_packing_arrangement_id 4294967294 frame_packing_arrangement_repetition_period 16384 display_orientation_repetition_period 16384 An alternative would be to modify get_ue_golomb() to handle encoded values of up to 49 bits as was done for get_se_golomb() in a92816c. In that case get_ue_golomb() could continue to be used for all of these except frame_packing_arrangement_id. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_refs: Fix long_idx checkMichael Niedermayer2015-12-19
| | | | | | | | | | | | | | | | Fixes out of array read Fixes mozilla bug 1233606 Found-by: Tyson Smith Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '741b494fa8cd28a7d096349bac183893c236e3f9'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit '741b494fa8cd28a7d096349bac183893c236e3f9': h264: eliminate default_ref_list Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264: eliminate default_ref_listAnton Khirnov2015-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec, the reference list for a slice should be constructed by first generating an initial (what we now call "default") reference list and then optionally applying modifications to it. Our code has an optimization where the initial reference list is constructed for the first inter slice and then rebuilt for other slices if needed. This, however, adds complexity to the code, requires an extra 2.5kB array in the codec context and there is no reason to think that it has any positive effect on performance. Therefore, simplify the code by generating the reference list from scratch for each slice.
* | avcodec/h264_refs: Check that long references match before useMichael Niedermayer2015-11-29
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: 59bb925e90201fa0f87f0a31945d43b5/asan_heap-oob_4a52e5_3388_66027f11e3d072f1e02401ecc6193361.jvt Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264, videotoolbox: do not return invalid frames on failurewm42015-11-20
| | | | | | | | | | | | | | | | | | | | | | | | If videotoolbox_common_end_frame failed, then the AVFrame was returned to the API user with the dummy buffer (in AVFrame.buf[0]) still set, and the decode call indicating success. These "half-set" AVFrames with dummy buffer are a videotoolbox specific hack, because the decoder requires an allocated AVFrame for its internal logic. Videotoolbox on the other hand allocates its frame itself internally, and outputs it only on end_frame. At this point, the dummy buffer is replaced with the real frame (unless decoding fails).
* | avcodec/h264_refs: Allow slightly larger pps_ref_count[0] in PAFF RAP ↵Michael Niedermayer2015-07-29
| | | | | | | | | | | | | | | | detection heuristic Fixes Ticket4738 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_refs: extend RAP heuristic to multiple PPSMichael Niedermayer2015-07-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_refs: discard mismatching referencesMichael Niedermayer2015-06-30
| | | | | | | | | | | | | | | | Fixes inconsistency and out of array access Fixes: asan_heap-oob_17301a3_2100_cov_3226131691_ff_add_pixels_clamped_mmx.m2ts Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6d4d3fee63c46d921c4870feab79269af94e84e1'Michael Niedermayer2015-06-27
|\| | | | | | | | | | | | | | | * commit '6d4d3fee63c46d921c4870feab79269af94e84e1': h264: make sure the current picture is not made a long ref multiple times See: 34ea5f418ef815c629b6ab38a6a2711fd7463290 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: make sure the current picture is not made a long ref multiple timesAnton Khirnov2015-06-27
| | | | | | | | | | | | Fixes possible invalid reads, once one of those refs is freed, but the others remain. CC: libav-stable@libav.org
* | Merge commit 'a0f2946068c62e18cb05ac25c0df3d86077251a6'Michael Niedermayer2015-04-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a0f2946068c62e18cb05ac25c0df3d86077251a6': h264: use properly allocated AVFrames Conflicts: libavcodec/h264.c libavcodec/h264.h libavcodec/h264_refs.c libavcodec/h264_slice.c libavcodec/svq3.c libavcodec/vda_h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: use properly allocated AVFramesAnton Khirnov2015-04-29
| |
* | avcodec: use av_mod_uintp2() where usefulJames Almer2015-04-21
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | avcodec/h264_refs: More completely clear slice contexts in ↵Michael Niedermayer2015-04-04
| | | | | | | | | | | | ff_h264_remove_all_refs() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_refs: Do not set reference to things which dont existMichael Niedermayer2015-04-04
| | | | | | | | | | | | | | | | Fixes deadlock Fixes Ticket4428 Fixes Ticket4429 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_refs: fix null pointer dereference with -DTRACEMichael Niedermayer2015-03-31
| | | | | | | | | | Found-by: carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/h264_refs: Fix compilation with -DTRACE.Carl Eugen Hoyos2015-03-29
| |
* | Merge commit 'a12d3188cbec15e22070e139fa5cc541da07e2c3'Michael Niedermayer2015-03-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a12d3188cbec15e22070e139fa5cc541da07e2c3': h264: use a smaller struct for the ref lists Conflicts: libavcodec/h264_direct.c libavcodec/h264_mb.c libavcodec/h264_picture.c libavcodec/h264_refs.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: use a smaller struct for the ref listsAnton Khirnov2015-03-21
| | | | | | | | | | | | There is no need to store a whole H264Picture, with a full AVFrame embedded in it. This should allow getting rid of the embedded AVFrame later.
* | Merge commit 'f42485dbce614b3f63182845da43db690b427b7c'Michael Niedermayer2015-03-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f42485dbce614b3f63182845da43db690b427b7c': h264: use a separate GetBitContext for slice data Conflicts: libavcodec/h264.c libavcodec/h264_cavlc.c libavcodec/h264_parser.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: use a separate GetBitContext for slice dataAnton Khirnov2015-03-21
| |
* | Merge commit '95eb35f30513e335990ad0d5dca6ddc318477291'Michael Niedermayer2015-03-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '95eb35f30513e335990ad0d5dca6ddc318477291': h264: move the ref lists variables into the per-slice context Conflicts: libavcodec/h264.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_direct.c libavcodec/h264_mb.c libavcodec/h264_picture.c libavcodec/h264_refs.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move the ref lists variables into the per-slice contextAnton Khirnov2015-03-21
| |
* | Merge commit '56febc993b928ccc039a32158ca60b234c311875'Michael Niedermayer2015-03-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '56febc993b928ccc039a32158ca60b234c311875': h264: move the slice type variables into the per-slice context Conflicts: libavcodec/h264.c libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move the slice type variables into the per-slice contextAnton Khirnov2015-03-21
| |
* | Merge commit '92c6c2a605f9b077b8fbc25b7ed6625541232b87'Michael Niedermayer2015-03-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '92c6c2a605f9b077b8fbc25b7ed6625541232b87': h264: split weighted pred-related vars into per-slice context Conflicts: libavcodec/h264.c libavcodec/h264.h libavcodec/h264_mb.c libavcodec/svq3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: split weighted pred-related vars into per-slice contextAnton Khirnov2015-03-21
| |
* | avcodec/h264: Move COPY_PICTURE() to h264.h so it can be used from other ↵Michael Niedermayer2015-02-08
| | | | | | | | | | | | parts of the h264 decoder Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_refs: set last_pic_for_ec only if it has not been set previouslyMichael Niedermayer2015-02-05
| | | | | | | | | | | | | | | | | | This ensures we do not loose the frame in case or multiple clears Fixes out of array read Fixes: asan_heap-oob_2fa47ea_2100_cov_1278768963_ff_add_pixels_clamped_mmx.m2ts Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264: Keep a reference to the last picture for ECMichael Niedermayer2015-01-11
| | | | | | | | | | | | | | This and the next commit improve error concealment for green-block-artifacts-from-canon-100-hs.MOV Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867': cosmetics: Write NULL pointer inequality checks more compactly Conflicts: libavcodec/dvdsubdec.c libavcodec/h263dec.c libavcodec/libxvid.c libavcodec/rv10.c libavcodec/utils.c libavformat/format.c libavformat/matroskadec.c libavformat/segment.c libavutil/opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer inequality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/h264: in the absence of recovery points, be more tolerant on ↵Michael Niedermayer2014-06-04
| | | | | | | | | | | | | | accepting plain I frames Fixes: Ticket3652 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'cba4e6062a02d5bf684e13a770be88aa1fec717e'Michael Niedermayer2014-04-02
|\| | | | | | | | | | | | | | | | | | | | | * commit 'cba4e6062a02d5bf684e13a770be88aa1fec717e': More correct printf format specifiers Conflicts: libavcodec/h264_ps.c libavcodec/h264_refs.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * More correct printf format specifiersDiego Biurrun2014-04-02
| | | | | | | | This avoids compiler warnings about argument and specifier type mismatch.
* | Merge commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b'Michael Niedermayer2014-03-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b': mpegvideo: move mpegvideo formats-related defines to mpegutils.h Conflicts: libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_mvpred.h libavcodec/svq1enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>