aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpeg12dec: Don't store block_last_index unnecessarilyAndreas Rheinhardt2025-06-211-2/+2
| | | | | | | | | | | Given that the MPEG-1/2 decoders unquantize the blocks on their own, block_last_index is only used to signal to ff_mpv_reconstruct_mb() whether a block is skipped or not; but this is only checked for inter macroblocks, so it is unnecessary to set block_last_index for intra macroblocks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Avoid temporary stack VLC array during RL VLC initAndreas Rheinhardt2025-03-171-15/+12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Merge VLCElem and RL_VLC_ELEMAndreas Rheinhardt2025-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | It will simplify creating RL-VLCs (which until now used a stack-based VLC as temporary buffer). Notice that there would be another option to merge them, namely: struct VLCElem { union { VLCBaseType sym; int16_t level; }; int8_t len; uint8_t run; }; The main difference to the current patch is that this would change the type of the length field of VLCElem to int8_t from int16_t. It turns out that that this would entail additional sign extensions on ppc, see https://godbolt.org/z/behWYEYE7. I have therefore refrained from doing so, although it would make the patch simpler. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Use VLC symbol tableAndreas Rheinhardt2024-06-201-9/+33
| | | | | | | Possible by using MB_TYPE_CODEC_SPECIFIC for MB_TYPE_ZERO_MV and due to the MB_TYPE_*_MV flags fitting into an int16_t. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Remove always-false checkAndreas Rheinhardt2024-04-081-2/+0
| | | | | | Forgotten in 7800cc6e82068c6dfb5af53817f03dfda794c568. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Avoid unnecessary VLC structuresAndreas Rheinhardt2023-10-311-29/+29
| | | | | | | | Everything besides VLC.table is basically write-only and even VLC.table can be removed by accessing the underlying tables directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use proper namespaceAndreas Rheinhardt2023-09-111-8/+8
| | | | | | | | | | | | | | | | Therefore use a proper prefix for this API, e.g. ff_init_vlc_sparse -> ff_vlc_init_sparse ff_free_vlc -> ff_vlc_free INIT_VLC_LE -> VLC_INIT_LE INIT_VLC_USE_NEW_STATIC -> VLC_INIT_USE_STATIC (The ancient INIT_VLC_USE_STATIC has been removed in 595324e143b57a52e2329eb47b84395c70f93087, so that the NEW has been dropped.) Finally, reorder the flags and change their values accordingly. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: remove FF_API_FLAG_TRUNCATEDJames Almer2023-02-091-66/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg12data: Remove ff_rl_mpeg1Andreas Rheinhardt2022-10-271-0/+1
| | | | | | No longer used anywhere. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Use ff_rl_mpeg1.table_(run|level) directlyAndreas Rheinhardt2022-10-271-4/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl()Andreas Rheinhardt2022-10-271-9/+14
| | | | | | | This allows to exploit that ff_rl_mpeg1 and ff_rl_mpeg2 only differ in their VLC table. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Avoid indirection when accessing rl_vlc tablesAndreas Rheinhardt2022-10-271-8/+11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Move ff_mpeg1_clean_buffers decl to a new headerAndreas Rheinhardt2022-10-041-0/+1
| | | | | | It allows to avoid including mpegvideo.h when including mpeg12.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Inline ff_mpeg12_common_init() into mpeg12enc.cAndreas Rheinhardt2022-10-041-9/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use structure instead of VLC_TYPE array as VLC elementAndreas Rheinhardt2022-06-171-3/+3
| | | | | | | | | | | | | | | | | | In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12.h: Move decoder-only stuff to a new headerAndreas Rheinhardt2022-02-131-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt2022-02-081-5/+1
| | | | | | | | This is by definition the appropriate place for it. Remove all the now unnecessary libavcodec/internal.h inclusions; also remove other unnecessary headers from the affected files. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/(h263|mpeg4?video)_parser: Make *_find_frame_end() staticAndreas Rheinhardt2021-09-201-0/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: ReindentationAndreas Rheinhardt2020-12-311-25/+25
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12: Make initializing VLCs thread-safeAndreas Rheinhardt2020-12-311-7/+8
| | | | | | | | | This automatically makes the eamad, eatqi, ipu and mdec decoders init-threadsafe; in addition to the actual mpeg[12]video decoders, of course. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12: Don't initialize encoder-only parts of RLTableAndreas Rheinhardt2020-12-311-4/+0
| | | | | | | | | | | ff_mpeg12_init_vlcs() currently initializes index_run, max_level and max_run of ff_rl_mpeg1/2; yet the only user of these fields is the MPEG-1/2 encoder which already initializes these tables on its own. So remove the initializations in ff_mpeg12_init_vlcs(); this also simplifies making ff_mpeg12_init_vlcs() thread-safe. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpeg12: Reduce size of motion-vector VLCAndreas Rheinhardt2020-10-121-1/+1
| | | | | | | | | | It currently uses 9 bits per table, but there are no codes with nine bits at all, while there are codes with eight, ten and eleven bits. So reducing the table size to eight bits will not reduce the amount of codes that can be parsed in the first step, but it allows to reduce the size of the motion-vector VLC. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add Newtek SpeedHQ decoderSteinar H. Gunderson2017-01-111-11/+4
| | | | | | | | | | | | | | This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), including correct decoding of the alpha channel. 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), about evenly split between bitstream reader and IDCT. There is currently no attempt at slice or frame threading, even though the format trivially supports both. NewTek very helpfully provided a full set of SHQ samples, as well as source code for an SHQ2 encoder (not included) and assistance with understanding some details of the format.
* avcodec/vdpau: clean up vdpau_internal.hJames Almer2016-08-041-1/+0
| | | | | | | | | | Also don't include it on files that don't need it. This reduces differences with libav Tested-by: Timothy Gu <timothygu99@gmail.com> Reveiwed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg12: Remove duplicate block_last_index setting codeMichael Niedermayer2016-02-161-5/+3
| | | | | | Based on 7c25ffe070c286874a8c3513f7504b90e1626b0c and 58dd885f9ae7feee002773253e345e11e7142739 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12: Fix error returnMichael Niedermayer2016-02-161-2/+2
| | | | | | Also remove a tab Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '7c25ffe070c286874a8c3513f7504b90e1626b0c'Derek Buitenhuis2016-02-161-0/+97
|\ | | | | | | | | | | | | * 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-091-0/+88
| | | | | | | | | | | | | | 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 '378a00087fdadcc9b34165c05cd10a1a15f3fe61'Michael Niedermayer2015-06-011-0/+1
|\| | | | | | | | | | | | | * commit '378a00087fdadcc9b34165c05cd10a1a15f3fe61': mpegvideo: Move tables to a separate file Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: Move tables to a separate fileVittorio Giovara2015-05-311-0/+1
| |
* | Merge commit '6f57375d707de40dcec28d3cef886c364e032c21'Michael Niedermayer2015-05-281-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '6f57375d707de40dcec28d3cef886c364e032c21': rl: Rename ff_*_rl() to ff_rl_*() Conflicts: libavcodec/mpeg4videodec.c libavcodec/rl.c libavcodec/rl.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rl: Rename ff_*_rl() to ff_rl_*()Anton Khirnov2015-05-281-2/+2
| |
* | avcodec/mpeg12: Try to fetch pts/dts from both the packet associated with ↵Michael Niedermayer2015-01-071-1/+1
| | | | | | | | | | | | the picture start code as well as earlier start codes Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/parser: add fuzzy mode to ff_fetch_timestamp()Michael Niedermayer2015-01-071-1/+1
| | | | | | | | | | | | This will be needed for the following timestamp fix Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | rl.h: Use on-stack temporary VLC tables instead of having them static.Reimar Döffinger2014-09-021-11/+10
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | rl.h: remove deprecated and now unused vlc member.Reimar Döffinger2014-09-021-6/+7
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '3dc6272bed7890a49080e18eacf3c7a4a6594b0d'Michael Niedermayer2014-04-051-1/+0
|\| | | | | | | | | | | | | | | | | | | | | * commit '3dc6272bed7890a49080e18eacf3c7a4a6594b0d': Remove a number of unnecessary dsputil.h #includes Conflicts: libavcodec/h264pred.c libavcodec/vc1dsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove a number of unnecessary dsputil.h #includesDiego Biurrun2014-04-041-1/+0
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-141-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Deprecate obsolete XvMC hardware decoding support Conflicts: libavcodec/mpeg12.c libavcodec/mpeg12dec.c libavcodec/mpegvideo.c libavcodec/options_table.h libavutil/pixdesc.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Deprecate obsolete XvMC hardware decoding supportDiego Biurrun2013-11-131-1/+0
| | | | | | | | | | | | | | XvMC has long ago been superseded by newer acceleration APIs, such as VDPAU, and few downstreams still support it. Furthermore XvMC is not implemented within the hwaccel framework, but requires its own specific code in the MPEG-1/2 decoder, which is a maintenance burden.
* | Revert "Merge commit of 'vdpau: remove old-style decoders'"Michael Niedermayer2013-08-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bf36dc50ea448999c8f8c7a35f6139a7040f6275, reversing changes made to b7fc2693c70fe72936e4ce124c802ac23857c476. Conflicts: libavcodec/h264.c Keeping support for the old VDPAU API has been requested by our VDPAU maintainer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '38f64c03301ac66d7b54b3e4bd2bf6454f9fb2d3'Michael Niedermayer2013-08-161-1/+24
|\| | | | | | | | | | | | | | | | | | | * commit '38f64c03301ac66d7b54b3e4bd2bf6454f9fb2d3': mpeg12decdata.h: Move all tables to the only place they are used Conflicts: libavcodec/mpeg12decdata.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg12decdata.h: Move all tables to the only place they are usedDiego Biurrun2013-08-151-1/+24
| |
* | Merge commit '578ea75a9e4ac56e0bbbbe668700be756aa699f8'Michael Niedermayer2013-08-061-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '578ea75a9e4ac56e0bbbbe668700be756aa699f8': vdpau: remove old-style decoders Conflicts: libavcodec/allcodecs.c libavcodec/h263dec.c libavcodec/h264.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/vc1dec.c libavcodec/vdpau.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vdpau: remove old-style decodersRémi Denis-Courmont2013-08-051-1/+0
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'Michael Niedermayer2013-05-161-2/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110': vf_aspect: use the name 's' for the pointer to the private context Remove commented-out debug #define cruft Conflicts: libavcodec/4xm.c libavcodec/dvdsubdec.c libavcodec/ituh263dec.c libavcodec/mpeg12.c libavfilter/avfilter.c libavfilter/vf_aspect.c libavfilter/vf_fieldorder.c libavformat/rtmpproto.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove commented-out debug #define cruftDiego Biurrun2013-05-161-4/+0
| |
* | Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'Michael Niedermayer2013-05-051-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487': avcodec: Add av_cold attributes to init functions missing them Conflicts: libavcodec/aacpsy.c libavcodec/atrac3.c libavcodec/dvdsubdec.c libavcodec/ffv1.c libavcodec/ffv1enc.c libavcodec/h261enc.c libavcodec/h264_parser.c libavcodec/h264dsp.c libavcodec/h264pred.c libavcodec/libschroedingerenc.c libavcodec/libxvid_rc.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/proresdsp.c libavcodec/rangecoder.c libavcodec/videodsp.c libavcodec/x86/proresdsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Add av_cold attributes to init functions missing themDiego Biurrun2013-05-041-2/+3
| |
* | Merge commit '1b6d66745ac1768adb387c2227cdcf4452271149'Michael Niedermayer2013-03-281-2562/+11
|\| | | | | | | | | | | | | | | | | | | | | * commit '1b6d66745ac1768adb387c2227cdcf4452271149': Split MPEG-1/2 decoder code off from MPEG-1/2 common code Conflicts: libavcodec/Makefile libavcodec/mpeg12.c Merged-by: Michael Niedermayer <michaelni@gmx.at>