summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12dec.c
Commit message (Collapse)AuthorAge
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* avcodec/mpeg12dec: Add CPB coded side dataNicolas Gaullier2020-03-20
| | | | | | | This fixes mpeg2video stream copies to mpeg muxer like this: ffmpeg -i xdcamhd.mxf -c:v copy output.mpg Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/mpeg12dec: Do not alter avctx->rc_buffer_sizeNicolas Gaullier2020-03-20
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/mpeg12dec: Fix invalid shift in mpeg2_fast_decode_block_intra()Michael Niedermayer2020-03-11
| | | | | | | | | Fixes: left shift of negative value -695 Fixes: 19232/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5702856963522560 Fixes: 19555/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5741218147598336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12dec: always submit the first field to hwaccelZhong Li2020-01-02
| | | | | | | | | | | | Though this patch to fix ticket #6668, I belive it is unnecessary to set SLICE_FLAG_ALLOW_FIELD flag to other hwaccels(dxva, vdpau, etc). Please also refer the orginal comment of 9cb150c9ab520eba5636bbcf925db6a70e67f3e5 Should also fix ticket #8442. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/mpeg12dec: Sanitize start codes earlierAndreas Rheinhardt2019-09-26
| | | | | | | | | | | | | | | | | | | | | | The MPEG-1/2 decoder uses avpriv_find_start_code to search for start codes and worked with the resulting start code before checking that it is really a start code of a slice. In particular, if the picture is so big that a slice_vertical_position_extension is present, it added the slice_vertical_position_extension as if it had a slice. Then a left shift is performed, without making sure that the value to be shifted is nonnegative. Afterwards the end result is checked, but even if a start code of a non-slice has been found, it might pass these checks: If slice_vertical_position_extension is present a start code < SLICE_MIN_START_CODE can lead to a macroblock-row index that appears valid. Furthermore, the left shift might make an invalid start code appear valid by discarding the highest bit. This has been fixed by checking directly after avpriv_find_start_code has returned. Fixes ticket #8162 (which is about the undefined left shifts). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/mpeg12dec: Check input for minimal frame sizeMichael Niedermayer2019-09-24
| | | | | | | | | Fixes: Timeout (35sec -> 6sec) Fixes: 16901/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEGVIDEO_fuzzer-5729024726269952 Fixes: 16901/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEGVIDEO_fuzzer-5642388592132096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mpeg4video: Add support for MPEG-4 Simple Studio Profile.Kieran Kunhya2018-04-02
| | | | This is a profile supporting > 8-bit video and has a higher quality DCT
* avcodec/mpeg2dec: Fix field selection for skipped macroblocksNekopanda2018-02-11
| | | | | | | | | | For B field pictures, the spec says, > The prediction shall be made from the field of the same parity as the field being predicted. I did it. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12dec: fix preprocessor check for mpeg1_nvdec hwaccelJames Almer2018-01-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-26
| | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* avcodec: Implement mpeg1 nvdec hwaccelPhilip Langdale2017-11-20
| | | | | Once I remembered that there's a separate decoder type for mpeg1, even though params struct is shared with mpeg2, everything worked.
* avcodec: Implement mpeg2 nvdec hwaccelPhilip Langdale2017-11-18
| | | | | | This is mostly straight-forward. The weird part is that it should just work for mpeg1, but I see corruption in my test cases, so I'm going to try and fix that separately.
* avcodec/mpeg12dec: ensure a53_caption_size is reset on malloc failuresAman Gupta2017-11-15
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12dec: parse A53 caption data embedded in SCTE-20 user dataAman Gupta2017-11-15
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'James Almer2017-10-23
|\ | | | | | | | | | | | | * commit 'dd343fd986459f467a2d1d70c26101dff1d47d68': lavu: Drop deprecated VDPAU pixel formats Merged-by: James Almer <jamrial@gmail.com>
* | Merge commit '5182a28b5de060c51c21b36053ab205bfbbbbe31'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit '5182a28b5de060c51c21b36053ab205bfbbbbe31': lavc: Drop deprecated global afd field Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Drop deprecated global afd fieldVittorio Giovara2017-03-23
| | | | | | | | Deprecated in 08/2014.
* | Merge commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198': lavc: Remove deprecated XvMC support hacks Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Remove deprecated XvMC support hacksDiego Biurrun2017-03-23
| | | | | | | | Deprecated in 11/2013.
| * mpeg12dec: move setting first_field to mpeg_field_start()Anton Khirnov2016-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For field picture, the first_field is set based on its previous value. Before this commit, first_field is set when reading the picture coding extension. However, in corrupted files there may be multiple picture coding extension headers, so the final value of first_field that is actually used during decoding can be wrong. That can lead to various undefined behaviour, like predicting from a non-existing field. Fix this problem, by setting first_field in mpeg_field_start(), which should be called exactly once per field. CC: libav-stable@libav.org Bug-ID: 999
| * mpeg12dec: avoid signed overflow in bitrate calculationAnton Khirnov2016-12-19
| | | | | | | | | | | | CC: libav-stable@libav.org Bug-Id: 981 Found-By: Agostino Sarubbo
* | Fix visual glitch with XvMC, caused by wrong idct permutation.Ivan Kalvachev2017-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past XvMC forced simple_idct since it was using FF_IDCT_PERM_NONE. However now we have SIMD variants of simple_idct that are using FF_IDCT_PERM_TRANSPOSE and if they are selected XvMC would get coefficients in the wrong order. The patch creates new FF_IDCT_NONE that is used only for this kind of hardware decoding and that fallbacks to the old C only simple idct. Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Merges Libav commit f9e7a2f95a7194a8736cc1416a03a1a0155a3e9f. Also adds untested VP9 support. The check for DXVA2 COBJs is removed. Just update your MinGW to something newer than a 5 year old release. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec: Rename ff_mpv_decode_mb() to ff_mpv_reconstruct_mbMichael Niedermayer2017-06-19
| | | | | | | | | | | | The new name more accuratly describes what the function does Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fixes runtime error: division by zeroMichael Niedermayer2017-05-11
| | | | | | | | | | | | | | Fixes: 1464/clusterfuzz-testcase-minimized-4925445571084288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fix runtime error: left shift of negative value -1Michael Niedermayer2017-03-13
| | | | | | | | | | | | | | Fixes: 764/clusterfuzz-testcase-6273034652483584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13Michael Niedermayer2017-03-04
| | | | | | | | | | | | | | Fixes: 709/clusterfuzz-testcase-4789836449841152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fix runtime error: left shift of negative value -2Michael Niedermayer2017-02-26
| | | | | | | | | | | | | | | | 671/clusterfuzz-testcase-4990381827555328 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fix runtime error: left shift of negative valueMichael Niedermayer2017-02-19
| | | | | | | | | | | | | | Fixes: 608/clusterfuzz-testcase-603978286392934 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Provide debug level log on skiped P/B framesMichael Niedermayer2017-02-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAMMichael Niedermayer2016-12-10
| | | | | | | | | | | | | | | | | | | | This decreases the amount of computations and memory needed for analysing mpeg1/2 streams the properties update is moved from code that is skiped if skip_frame is set to code that is not skiped so the change doesnt loose that from being executed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mpeg12dec: unref discarded picture from extradataAndreas Cadhalpun2016-10-21
| | | | | | | | | | | | | | | | Otherwise another frame gets referenced into picture, triggering an assert (from commit 13aae8) in av_frame_ref. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavc: fix typosMoritz Barsnick2016-10-09
| | | | | | | | | | Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: add comments documenting the format of the DVD CC ↵Jonathan Campbell2016-09-13
| | | | | | | | | | | | | | | | user-data packet. this is to aid development and maintenance of that code. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/get_bits: add a logging context to check_marker()Clément Bœsch2016-06-22
| | | | | | | | Based on d338abb664febbc2c7266af7818aab1f12dbc161
* | 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>
| * lavu: deprecate AV_PIX_FMT_VAAPI_*, replace with AV_PIX_FMT_VAAPIMark Thompson2016-03-19
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/mpeg12dec: Print position in end mismatch errorMichael Niedermayer2016-05-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Do not choke on extra m704 alpha dataMichael Niedermayer2016-05-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12dec: Fix missing slice handling without paddingMichael Niedermayer2016-02-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg12: Remove duplicate block_last_index setting codeMichael Niedermayer2016-02-16
| | | | | | | | | | | | Based on 7c25ffe070c286874a8c3513f7504b90e1626b0c and 58dd885f9ae7feee002773253e345e11e7142739 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '7c25ffe070c286874a8c3513f7504b90e1626b0c'Derek Buitenhuis2016-02-16
|\| | | | | | | | | | | | | * commit '7c25ffe070c286874a8c3513f7504b90e1626b0c': mpeg1: Make intra-block decoding independent of MpegEncContext Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * mpeg1: Make intra-block decoding independent of MpegEncContextVittorio Giovara2016-02-09
| | | | | | | | | | | | | | This allows untangling the eatqi decoder from the MPEG-1 decoder. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '249827f736db4c94dfcb24a3883aa4c04f9b119b'Derek Buitenhuis2016-02-16
|\| | | | | | | | | | | | | * commit '249827f736db4c94dfcb24a3883aa4c04f9b119b': mpeg12dec: Refactor mpeg1_decode_block_intra() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * mpeg12dec: Refactor mpeg1_decode_block_intra()Diego Biurrun2016-02-09
| | | | | | | | | | Reduce variable scope, improve variable name, drop pointless ff_dlog(), merge variable declaration and initialization, whitespace cosmetics.
* | Merge commit 'cdbaa436042ba59c3b2bd7e9652e9a14136fd604'Derek Buitenhuis2016-02-16
|\| | | | | | | | | | | | | * commit 'cdbaa436042ba59c3b2bd7e9652e9a14136fd604': mpeg12dec: Always close reader on error Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * mpeg12dec: Always close reader on errorVittorio Giovara2016-02-09
| | | | | | | | | | | | | | A reader left open may lead to hangs. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | mpeg12dec: Export GOP timecodes as side dataDerek Buitenhuis2016-02-01
| | | | | | | | | | | | | | The codec context field was rightly deprecated, and the data may change per-frame. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>