summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/h264_slice: Fix dequant table init with field picturesMichael Niedermayer2016-02-121-1/+1
| | | | | | Fixes regression of Ticket4389 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: assert relation between current_slice ans slice_ctxMichael Niedermayer2016-02-121-0/+3
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_slice: remove duplicate unconditional picture_structure setting ↵Michael Niedermayer2016-02-121-1/+0
| | | | | | code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-3/+3
| | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avcodec/h264_slice: Fix integer overflow in implicit weight computationMichael Niedermayer2016-01-051-2/+2
| | | | | | Fixes mozilla bug 1230423 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Use get_ue_golomb_long() when neededMark Harris2015-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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_slice: Simplify ref2frm indexingMichael Niedermayer2015-12-181-9/+9
| | | | | | | This also suppresses a ubsan warning Fixes Mozilla bug 1230247 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '792b9c9dfcf44b657d7854368d975b5ca3bc22ca'Hendrik Leppkes2015-12-171-3/+1
|\ | | | | | | | | | | | | * commit '792b9c9dfcf44b657d7854368d975b5ca3bc22ca': h264: set frame_num in start_frame(), not decode_slice_header() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264: set frame_num in start_frame(), not decode_slice_header()Anton Khirnov2015-12-061-3/+1
| | | | | | | | | | That is a more appropriate place for it, since it is not allowed to change between slices.
* | Merge commit '741b494fa8cd28a7d096349bac183893c236e3f9'Hendrik Leppkes2015-12-171-16/+1
|\ \ | |/ | | | | | | | | | | * commit '741b494fa8cd28a7d096349bac183893c236e3f9': h264: eliminate default_ref_list Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264: eliminate default_ref_listAnton Khirnov2015-12-061-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/cabac: Check initial cabac decoder stateMichael Niedermayer2015-11-271-1/+3
| | | | | | | | | | | | | | | | | | Fixes integer overflows Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Found-by: xiedingbao (Ticket4727) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_slice: Limit max_contexts when slice_context_count is initializedMichael Niedermayer2015-11-241-0/+1
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2049_f2192b6829ab6e0eefcb035329c03c60.264 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_slice: Clear top_borders on allocationMichael Niedermayer2015-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In case of bitstream errors the deblock filter and slices can access uninitialized top_borders from previous slices which did not fill them as they stoped halfway due to error or where entirely missing. This also makes code using these tables deterministic in case of missing or damaged slices Found-by: Tyson Smith Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_slice: Disable slice threads if there are multiple access units ↵Michael Niedermayer2015-10-311-0/+9
| | | | | | | | | | | | | | | | | | in a packet Fixes null pointer dereference Fixes Ticket4977 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: rename avpriv_color_frame to ff_color_frameAndreas Cadhalpun2015-10-221-1/+1
| | | | | | | | | | | | | | It is only used inside libavcodec. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Revert "avcodec/h264: remove redundant and bogus get_format call"wm42015-10-151-0/+14
| | | | | | | | | | | | This reverts commit be583c6fd3a6f06844b56619653b9b0e4561870d. This was not approved, and was accidentally pushed. I'm very sorry.
* | avcodec/h264: remove redundant and bogus get_format callwm42015-10-151-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AVCodecContext.get_format callback is not only used for pixel format negotiation with the API user, but also for hwaccel init. For the latter, it's required that some codec parameters, in particular the codec profile, are set when the callback is invoked. This patch removes a get_format invocation where this is not guaranteed. The codec parameters, including the profile, are really set further below. (The same code path that sets the profile also calls get_format properly too.) This just happened to work by coincidence in most cases. For example, if the API user just copied or reused the AVStream's AVCodecContext when decoding, the profile would be set properly. But in some cases it fails., such as with the sample WolfensteinTwitch.mp4 on the samples server. Remove the redundant get_format call. Apparently it serves no purpose anymore, although it is possible that this was different at the time it was added in commit ffd77f94a26be22b8ead3178ceec3ed39e68abc5. This fixes hwaccel usage for API users which do not set the profile when setting up the AVCodecContext (which is allowed).
* | avcodec/h264_slice: replace assert by normal error checkMichael Niedermayer2015-09-021-1/+4
| | | | | | | | | | | | | | | | Fixes assertion failure Fixes: c6075771557e4f3b7b74e63d2d24fb01/signal_sigabrt_7ffff6ac8cc9_133_cov_2853689970_CREDITS.FST Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | vaapi: define a unique pixel format for VA-API (AV_PIX_FMT_VAAPI).Gwenole Beauchesne2015-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format that is aliased to the older VLD variant. This is an API change. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* | lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.Ronald S. Bultje2015-08-181-4/+12
| |
* | lavc: propagate hwaccel errorswm42015-08-061-2/+6
| | | | | | | | | | | | | | | | At least the new videotoolbox decoder does not actually set a frame if end_frame fails. This causes the API to return success and signals that a picture was decoded, even though AVFrame->data[0] is NULL. Fix this by propagating end_frame errors.
* | avcodec: add new Videotoolbox hwaccel.Sebastien Zwickert2015-08-031-0/+4
| |
* | avcodec/h264_slice: Also check sei_recovery_frame_cnt for skip_frame nokeyMichael Niedermayer2015-07-281-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_slice: do not skip 2nd field if first was not skippedMichael Niedermayer2015-07-281-8/+10
| | | | | | | | | | Found-by: John Högberg <john.hogberg@ericsson.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-5/+5
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/h264_slice: Fix container croppingMichael Niedermayer2015-07-081-1/+4
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: asan_heap-oob_394322e_138_cov_4265020547_CVPCMNL1_SVA_C.264 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3e3056f2a020dd77efdf379dbd4c06a65b4a499a'Michael Niedermayer2015-06-301-5/+2
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '3e3056f2a020dd77efdf379dbd4c06a65b4a499a': h264: Allow stream and container cropping at the same time Conflicts: libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: Allow stream and container cropping at the same timeVittorio Giovara2015-06-301-5/+2
| | | | | | | | | | | | | | | | The container cropping is applied only when difference is within 16 pixels, and the smallest value between the two is chosen. Bug-Id: 383 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/hMichael Niedermayer2015-06-301-2/+2
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: asan_heap-oob_4d5bb0_682_cov_3124593265_Fraunhofer__a_driving_force_in_innovation__small.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_slice: Reformat IN_RANGE() uses to be readableMichael Niedermayer2015-06-271-4/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_slice: Silence pointer type warningsMichael Niedermayer2015-06-271-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_slice: assert that the first slice implies unfinished setupMichael Niedermayer2015-06-271-1/+5
| | | | | | | | | | | | If this assert fails there is very likely a bug in the code Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5ec0bdf2c524224f30ba4786f47324970aed4aaa'Michael Niedermayer2015-06-271-40/+69
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '5ec0bdf2c524224f30ba4786f47324970aed4aaa': h264: do not update the context fields copied between threads after finish_setup() Conflicts: libavcodec/h264.h libavcodec/h264_slice.c See: f111831ed61103f9fa8fdda41473a23da016bdaa and others Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: do not update the context fields copied between threads after ↵Anton Khirnov2015-06-271-47/+78
| | | | | | | | | | | | finish_setup() Should fix a large number of possible races with frame threading.
* | Merge commit 'e49e0f58e273237f83b4486f3536931ed1943d18'Michael Niedermayer2015-06-271-17/+23
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'e49e0f58e273237f83b4486f3536931ed1943d18': h264: make sure the slices do not overlap during slice threading Conflicts: libavcodec/h264.h libavcodec/h264_slice.c See: 43b434210e597d484aef57c4139c3126d22b7e2b Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: make sure the slices do not overlap during slice threadingAnton Khirnov2015-06-271-6/+40
| | | | | | | | | | | | Based on a patch by Michael Niedermayer <michaelni@gmx.at>. CC: libav-stable@libav.org Found-by: Kieran Kunhya <kierank@obe.tv>
| * h264: er: Copy from the previous reference only if compatibleAndreas Cadhalpun2015-06-151-2/+5
| | | | | | | | | | | | | | | | Also use the frame pixel format instead of the one from the codec context, which is more robust. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * h264: Fix HWACCEL_MAX for D3D11Michael Niedermayer2015-06-011-0/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | h264: er: Copy from the previous reference only if compatibleAndreas Cadhalpun2015-06-151-2/+5
| | | | | | | | | | | | | | | | | | Also use the frame pixel format instead of the one from the codec context, which is more robust. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | h264: update avctx width/height/pix_fmt when returning frameAndreas Cadhalpun2015-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Inconsistencies between the dimensions/pixel format of avctx and the frame can confuse API users. For example this can crash the demuxing_decoding example. Back up the previous values and restore them, when decoding the next frame. This is necessary, because these can be different between the returned frame and the last decoded frame. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec/h264_slice: Use AVFrame diemensions for grayscale handlingMichael Niedermayer2015-06-101-3/+3
| | | | | | | | | | | | | | The AVFrame values are closer to the AVFrame bitmap changed instead of the AVCodecContext values, so this should be more robust Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '0181ae9af2de1526464d23209b82e6674d362f5d'Michael Niedermayer2015-05-301-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '0181ae9af2de1526464d23209b82e6674d362f5d': h264: Make sure reinit failures mark the context as not initialized Conflicts: libavcodec/h264_slice.c See: e8714f6f93d1a32f4e4655209960afcf4c185214 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: Make sure reinit failures mark the context as not initializedLuca Barbato2015-05-301-0/+1
| | | | | | | | | | Bug-Id: CVE-2015-3417 CC: libav-stable@libav.org
* | avcodec/h264: Fix HWACCEL_MAX for D3D11Michael Niedermayer2015-05-261-0/+1
| | | | | | | | | | Found-by: philipl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd8039ef8d221ea273aa4f1e62e5df21bf618c772'Michael Niedermayer2015-05-251-0/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd8039ef8d221ea273aa4f1e62e5df21bf618c772': D3D11va: add a Direct3D11 video decoder similar to DXVA2 Conflicts: Changelog configure libavcodec/Makefile libavcodec/allcodecs.c libavcodec/dxva2_vc1.c libavcodec/version.h libavutil/pixdesc.c libavutil/pixfmt.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * D3D11va: add a Direct3D11 video decoder similar to DXVA2Steve Lhomme2015-05-251-0/+3
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/h264_slice: Fix ranges in assertMichael Niedermayer2015-05-151-2/+2
| | | | | | | | | | | | Fixes CID1297592, CID1297593 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
OpenPOWER on IntegriCloud