summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4video.h
Commit message (Collapse)AuthorAge
* avcodec/mpeg4video.h: Move encoder-only parts in a new fileAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video.h: Move decoder-only parts to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Move use_intra_dc_vlc to stack, fix data raceAndreas Rheinhardt2022-01-29
| | | | | | | | | | | | | | | | | | | | | | | use_intra_dc_vlc is currently kept in sync between frame threads in mpeg4_update_thread_context(), yet it is set when decoding blocks, i.e. after ff_thread_finish_setup(). This is a data race and therefore undefined behaviour. This race can be fixed easily by moving the variable from the context to the stack: use_intra_dc_vlc is only read in mpeg4_decode_block() and only if one is decoding an intra block. There are three callsites for this function: One in mpeg4_decode_partitioned_mb() which always sets use_intra_dc_vlc before the call and two in mpeg4_decode_mb(). One of these callsites is for intra blocks and use_intra_dc_vlc is set before it; the last callsite is for non-intra blocks, where use_intra_dc_vlc is ignored. So if it is used, it always uses a new value and can therefore be moved to the stack. The above also explains why this data race did not lead to FATE-test failures. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move MPEG-4 Simple Studio Profile fields to mpeg4videoAndreas Rheinhardt2022-01-29
| | | | | | | | | | This is possible now that dealing with the Simple Studio Profile has been moved to mpeg4videodec.c. It also allows to avoid allocations, because one can simply put the required buffers on the context (if one made these buffers part of MpegEncContext, the memory would be wasted for every codec other than MPEG-4). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move handling Simple Studio Profile to mpeg4videodecAndreas Rheinhardt2022-01-29
| | | | | | This is its only user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4?video: Move vo_type to Mpeg4DecContextAndreas Rheinhardt2022-01-29
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Split off data in a header of its ownAndreas Rheinhardt2022-01-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Fix data race when initializing VLCsAndreas Rheinhardt2022-01-09
| | | | | | | | | | | | | | | | | Both the MPEG-4 parser as well as the decoder initialized several VLCs. There is a "static int done = 0;" in order to guard against initializing these multiple times, but this does not work when several threads try to initialize these VLCs concurrently, which can happen when initializing several parsers at the same time (they don't use the global lock that is used for codecs without the FF_CODEC_CAP_INIT_THREADSAFE cap; actually, they don't use any lock at all). Since ff_mpeg4_decode_picture_header() now aborts early when called from the parser, it no longer needs to have these VLCs initialized at all. This commit therefore does exactly this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Skip unneeded element when parsing picture headerAndreas Rheinhardt2022-01-09
| | | | | | | | | | Namely, skip some elements that are only useful for a decoder when calling ff_mpeg4_decode_picture_header() from the MPEG-4 parser. In particular, this ensures that the VLCs need no longer be initialized by the parser. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Make initializing RLTable thread-safeAndreas Rheinhardt2021-04-27
| | | | | | | | | | | Up until now the RLTable ff_mpeg4_rl_intra was initialized by both mpeg4 decoder and encoder (except the VLCs that are only used by the decoder). This is an obstacle to making these codecs init-threadsafe, so move initializing this to a single function that is guarded by a dedicated AVOnce. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg4videodec: Make studio VLCs staticAndreas Rheinhardt2020-12-08
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg4video: Make tables used to initialize VLCs smallerAndreas Rheinhardt2020-12-08
| | | | | | | | | | Switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() allows to replace codes which are so long that they need to be stored in an uint16_t by symbols which fit into an uint8_t; and even these can be avoided in case of the sprite trajectory VLC. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg4videodec: Fix nonsense warningAndreas Rheinhardt2019-03-12
| | | | | | | | | | | | Since db772308941a2a338c7809f90d347219a6a93074 parsing of mpeg4-extradata lead to a "Failed to parse extradata" warning, because ff_mpeg4_decode_picture_header returns AVERROR_INVALIDDATA in case that no VOP was found. This patch adds a parameter to signify whether a header (where the absence of a VOP does not raise an error) or not is parsed. The first mode is of course used for parsing headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4video: Detect reference studio streams as studio streamsMichael Niedermayer2018-05-17
| | | | 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/mpeg4videodec: Use more specific error codesMichael Niedermayer2018-03-26
| | | | | | Forward error codes where possible. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Add support for parsing and exporting video_rangeMichael Niedermayer2017-12-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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 '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/mpeg4video: Check time_incrMichael Niedermayer2016-01-12
| | | | | | | | | | | | | | | | | | | | Fixes assertion failure Fixes out of memory access Fixes: test_casex.ivf Found-by: Tyson Smith <twsmith@mozilla.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4video: Reorder operations to reduce accesses to err_recognitionMichael Niedermayer2015-05-24
| | | | | | | | | | | | About 9 cpu cycle faster mpeg4_decode_mb() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '9c1db92ad372d4cd69e0490e691c56e4097cb193'Michael Niedermayer2015-05-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9c1db92ad372d4cd69e0490e691c56e4097cb193': mpegvideo: Drop err_recognition Conflicts: libavcodec/h263dec.c libavcodec/ituh263dec.c libavcodec/mpeg4video.h libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: Drop err_recognitionVittorio Giovara2015-05-22
| | | | | | | | It is just a duplicate of an AVCodecContext member so use it instead.
* | mpeg4: use a self-explanatory #define MAX_NVOP_SIZEAndreas Cadhalpun2015-04-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '93f29948e4b06acfb96e7f82d373ef86d6dc55f7'Michael Niedermayer2014-08-14
|\| | | | | | | | | | | | | | | | | | | * commit '93f29948e4b06acfb96e7f82d373ef86d6dc55f7': mpeg4video: Fix doxygen comment syntax to document correct struct member Conflicts: libavcodec/mpeg4video.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4video: Fix doxygen comment syntax to document correct struct memberNidhi Makhijani2014-08-14
| | | | | | | | | | | | Also fix some comment typos. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'ccbf370f2000b9b27f4af259c23007d67f7ea46e'Michael Niedermayer2014-07-29
|\| | | | | | | | | | | | | * commit 'ccbf370f2000b9b27f4af259c23007d67f7ea46e': mpegvideo: move vol_control_parameters to the only place it is used Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: move vol_control_parameters to the only place it is usedNidhi Makhijani2014-07-29
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/mpeg4video: fix 2 more incorrectly associated commentsMichael Niedermayer2013-12-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ff7ffe48097f32417781fe8b2b417eff05a52c55'Michael Niedermayer2013-12-06
|\| | | | | | | | | | | | | | | | | | | * commit 'ff7ffe48097f32417781fe8b2b417eff05a52c55': mpeg4videodec: move showed_packed_warning from MpegEncContext to Mpeg4DecContext Conflicts: libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move showed_packed_warning from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-12-05
| |
* | Merge commit 'f7d228676cb7669059889c4225c8a8dc56708c24'Michael Niedermayer2013-12-06
|\| | | | | | | | | | | | | | | | | | | * commit 'f7d228676cb7669059889c4225c8a8dc56708c24': mpeg4videodec: move intra_dc_threshold from MpegEncContext to Mpeg4DecContext Conflicts: libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move intra_dc_threshold from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-12-05
| |
* | Merge commit 'e41ff4210ac1192c62de3052b33a38c7bcf772f2'Michael Niedermayer2013-12-06
|\| | | | | | | | | | | | | | | | | | | * commit 'e41ff4210ac1192c62de3052b33a38c7bcf772f2': mpeg4videodec: move use_intra_dc_vlc from MpegEncContext to Mpeg4DecContext Conflicts: libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move use_intra_dc_vlc from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-12-05
| |
* | avcodec/mpeg4video: fix doxycomments so they are not associated with random ↵Michael Niedermayer2013-11-30
| | | | | | | | | | | | unrelated fields Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e026ee0446de27fc38e33e98704fada012fdc763'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit 'e026ee0446de27fc38e33e98704fada012fdc763': mpeg4videodec: move sprite_{shift,traj} from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move sprite_{shift,traj} from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-11-29
| |
* | Merge commit '513d849bb605d3d862da1ada709bd2ca1ac68f58'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit '513d849bb605d3d862da1ada709bd2ca1ac68f58': mpeg4videodec: move num_sprite_warping_points from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move num_sprite_warping_points from MpegEncContext to ↵Anton Khirnov2013-11-29
| | | | | | | | Mpeg4DecContext
* | Merge commit '9ba3fc3e3d12c9ef00dcb0222b7ea0ccb5c4a091'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit '9ba3fc3e3d12c9ef00dcb0222b7ea0ccb5c4a091': mpeg4videodec: move sprite_brightness_change from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move sprite_brightness_change from MpegEncContext to ↵Anton Khirnov2013-11-29
| | | | | | | | Mpeg4DecContext
* | Merge commit '58c120a9290eef057dbf26761a4f89b7f67bbde1'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit '58c120a9290eef057dbf26761a4f89b7f67bbde1': mpeg4videodec: move scalability from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move scalability from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-11-29
| |
* | Merge commit '6e81597d5a89f64dfab5c7e99e46b4355139e324'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit '6e81597d5a89f64dfab5c7e99e46b4355139e324': mpeg4videodec: move enhancement_type from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move enhancement_type from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-11-29
| |
* | Merge commit '3b1c0f686d5a162ceb5048910a7ce0bf7ed3a1ab'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit '3b1c0f686d5a162ceb5048910a7ce0bf7ed3a1ab': mpeg4videodec: move new_pred from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move new_pred from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-11-29
| |