summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
Commit message (Collapse)AuthorAge
* avcodec/mpeg12data: Remove ff_rl_mpeg1Andreas Rheinhardt2022-10-27
| | | | | | 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-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl()Andreas Rheinhardt2022-10-27
| | | | | | | 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-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: Move ff_mpeg1_clean_buffers decl to a new headerAndreas Rheinhardt2022-10-04
| | | | | | 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-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use structure instead of VLC_TYPE array as VLC elementAndreas Rheinhardt2022-06-17
| | | | | | | | | | | | | | | | | | 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-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt2022-02-08
| | | | | | | | 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-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12: ReindentationAndreas Rheinhardt2020-12-31
| | | | | 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-31
| | | | | | | | | 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-31
| | | | | | | | | | | 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-12
| | | | | | | | | | 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-11
| | | | | | | | | | | | | | 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-04
| | | | | | | | | | 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-16
| | | | | | Based on 7c25ffe070c286874a8c3513f7504b90e1626b0c and 58dd885f9ae7feee002773253e345e11e7142739 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12: Fix error returnMichael Niedermayer2016-02-16
| | | | | | Also remove a tab 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 '378a00087fdadcc9b34165c05cd10a1a15f3fe61'Michael Niedermayer2015-06-01
|\| | | | | | | | | | | | | * 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-31
| |
* | Merge commit '6f57375d707de40dcec28d3cef886c364e032c21'Michael Niedermayer2015-05-28
|\| | | | | | | | | | | | | | | | | | | | | | | * 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-28
| |
* | avcodec/mpeg12: Try to fetch pts/dts from both the packet associated with ↵Michael Niedermayer2015-01-07
| | | | | | | | | | | | 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-07
| | | | | | | | | | | | 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-02
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | rl.h: remove deprecated and now unused vlc member.Reimar Döffinger2014-09-02
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '3dc6272bed7890a49080e18eacf3c7a4a6594b0d'Michael Niedermayer2014-04-05
|\| | | | | | | | | | | | | | | | | | | | | * 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-04
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-13
| | | | | | | | | | | | | | 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-17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-16
|\| | | | | | | | | | | | | | | | | | | * 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-15
| |
* | Merge commit '578ea75a9e4ac56e0bbbbe668700be756aa699f8'Michael Niedermayer2013-08-06
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-05
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-16
| |
* | Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-04
| |
* | Merge commit '1b6d66745ac1768adb387c2227cdcf4452271149'Michael Niedermayer2013-03-28
|\| | | | | | | | | | | | | | | | | | | | | * 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>
| * Split MPEG-1/2 decoder code off from MPEG-1/2 common codeDiego Biurrun2013-03-27
| |
* | Merge commit '1db6a080bddd14fed6b29140ecd2e21e42b1c022'Michael Niedermayer2013-03-28
|\| | | | | | | | | | | | | | | | | | | | | * commit '1db6a080bddd14fed6b29140ecd2e21e42b1c022': dca: Move ff_dca_convert_bitstream() to the DCA common code vdpau: wrap codec specific functions in appropiate #ifs Conflicts: libavcodec/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vdpau: fix obsolete mpeg1 vdpau decoder when mpeg2 is disabledJanne Grunau2013-03-26
| |
* | Merge commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0'Michael Niedermayer2013-03-26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0': lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo Conflicts: libavcodec/h264_parser.c libavcodec/internal.h libavcodec/mpeg12.c libavcodec/utils.c libavformat/mpegtsenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideoMartin Storsjö2013-03-26
| | | | | | | | | | | | | | Also move the declaration to internal.h, and add restrict qualifiers to the declaration (as in the implementation). Signed-off-by: Martin Storsjö <martin@martin.st>
* | mpeg2: 12LSB w/h of 0 is not allowed in compliant videos thus this also ↵Michael Niedermayer2013-03-18
| | | | | | | | | | | | needs AV_EF_COMPLIANT Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-03-18
|\| | | | | | | | | | | | | | | | | | | | | * qatar/master: print_options: do not generate docs for options without enc or dec flags mpeg12: do not fail on zero dimensions in the sequence header. Conflicts: libavcodec/mpeg12.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg12: do not fail on zero dimensions in the sequence header.Anton Khirnov2013-03-18
| | | | | | | | | | | | | | | | | | | | | | | | The total frame size is a combination of the 12 bits in the sequence header and 2 more bits in the the sequence extension. While the specification explicitly forbids the dimensions from the sequence header from being 0 (thus ruling out multiples of 4096), such videos apparrently exist in the wild so we should attempt to decode them. Based on a patch by Michael Niedermayer <michaelni@gmx.at> Fixes Bug 416.