summaryrefslogtreecommitdiff
path: root/libavcodec/mss2.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mss2: Remove write-only QpelDSPContextAndreas Rheinhardt2022-05-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4dec: Make initializing VLCs thread-safeAndreas Rheinhardt2022-02-18
| | | | | | | | | | | This automatically makes the remaining mpegvideo-decoders (namely msmpeg4v[1-3], mss2, VC-1, VC-1 Image, WMV-[1-3] and WMV-3 Image) init-threadsafe. These were the last native codecs that were not init-threadsafe; only wrappers for external libraries and for hardware accelerations are now not init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move decoder-only stuff to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4.h: Move decoder-only parts to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mss2: Remove redundant initialization of vc1 dspAndreas Rheinhardt2021-04-12
| | | | | | ff_vc1_init_common() already does it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1: Don't pretend ff_vc1_init_common() can failAndreas Rheinhardt2021-04-12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/vc1: Remove bits variableMichael Niedermayer2020-01-11
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/decode: add a flags parameter to ff_reget_buffer()James Almer2019-09-04
| | | | | | | | | | Some decoders may not need a writable buffer in some specific cases, but only a reference to the existing buffer with updated frame properties instead, for the purpose of returning duplicate frames. For this, the FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential allocations and buffer copies when they are not needed. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mss1: check for overread and forward errorsMichael Niedermayer2019-08-05
| | | | | | | | | Fixes: Timeout (106sec -> 14ms) Fixes: 15576/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS1_fuzzer-5688080461201408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mss2: Provide non NULL context to av_log()Michael Niedermayer2019-01-01
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fix MSVC compilation errorsMateusz2017-12-10
| | | | | | | | | After commit 3701d49 'error_resilience: remove avpriv_atomic usage' we have included windows.h in much more files and we should avoid conflicts with defines/function declarations. Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22'James Almer2017-03-21
|\ | | | | | | | | | | | | * commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22': mss*: Change type of array stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
| * mss*: Change type of array stride parameters to ptrdiff_tDiego Biurrun2016-09-29
| | | | | | | | ptrdiff_t is the correct type for array strides and similar.
* | mss2: only use error correction for matching block countsAndreas Cadhalpun2016-11-25
| | | | | | | | | | | | | | | | This fixes a heap-buffer-overflow in ff_er_frame_end when decoding mss2 with coded_width/coded_height larger than width/height. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '59c6509d9f0236acbc317198eab76dab8320bced'Clément Bœsch2016-06-29
|\| | | | | | | | | | | | | * commit '59c6509d9f0236acbc317198eab76dab8320bced': mss2: Drop a silly assert Merged-by: Clément Bœsch <clement@stupeflix.com>
| * mss2: Drop a silly assertDiego Biurrun2016-06-07
| |
* | Merge commit 'f9fbd474676e903e12efe83203697d60a9d28cf9'Derek Buitenhuis2016-02-24
|\| | | | | | | | | | | | | * commit 'f9fbd474676e903e12efe83203697d60a9d28cf9': msmpeg4data: Move WMV2 data tables to their own file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * msmpeg4data: Move WMV2 data tables to their own fileDiego Biurrun2016-02-19
| |
* | avcodec/mss2: Check for repeat overflowMichael Niedermayer2016-01-10
| | | | | | | | | | | | | | Fixes: mss2_left_shift.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/mss2: Fix integer overflowMichael Niedermayer2015-07-01
| | | | | | | | | | | | | | | | This also simplifies the code Fixes: signal_sigabrt_7ffff6ac8cc9_2943_cov_3588637614_mss2_speech.wmv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '31a117a0e6d6eafdf997bfe0843f3e3d39cc0332'Michael Niedermayer2015-06-01
|\| | | | | | | | | | | | | * commit '31a117a0e6d6eafdf997bfe0843f3e3d39cc0332': mpegvideo: msmpeg4: Move function declarations Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: msmpeg4: Move function declarationsVittorio Giovara2015-05-31
| |
* | avcodec/mss2: use < 0 instead of != 0 to check for error of vlc initializationMichael Niedermayer2015-05-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '835f798c7d20bca89eb4f3593846251ad0d84e4b'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '835f798c7d20bca89eb4f3593846251ad0d84e4b': mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixes Conflicts: libavcodec/h261dec.c libavcodec/intrax8.c libavcodec/mjpegenc.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videoenc.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/x86/mpegvideoenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixesDiego Biurrun2014-08-15
| |
* | Merge commit '7b9ef8d701c319c26f7d0664fe977e176764c74e'Michael Niedermayer2014-06-23
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '7b9ef8d701c319c26f7d0664fe977e176764c74e': mpeg: Split error resilience bits off into a separate file Conflicts: configure libavcodec/Makefile libavcodec/mpegvideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg: Split error resilience bits off into a separate fileDiego Biurrun2014-06-22
| |
* | Merge commit '368f50359eb328b0b9d67451f56fda20b3255f9a'Michael Niedermayer2014-05-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '368f50359eb328b0b9d67451f56fda20b3255f9a': dsputil: Split off quarterpel bits into their own context Conflicts: configure libavcodec/dsputil.c libavcodec/h263dec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/vc1dec.c libavcodec/vc1dsp.c libavcodec/x86/dsputil_init.c libavcodec/x86/qpeldsp.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split off quarterpel bits into their own contextDiego Biurrun2014-05-29
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-04-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegvideo: operate with pointers to AVFrames instead of whole structs Conflicts: libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/intrax8.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/mpegvideo_xvmc.c libavcodec/msmpeg4.c libavcodec/ratecontrol.c libavcodec/vaapi.c libavcodec/vc1dec.c libavcodec/vdpau_vc1.c See: fc567ac49e17151f00f31b59030cd10f952612ef Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: operate with pointers to AVFrames instead of whole structswm42014-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | The most interesting parts are initialization in ff_MPV_common_init() and uninitialization in ff_MPV_common_end(). ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL checks for Picture.f, because these functions can be called on uninitialized or partially initialized Pictures. NULL pointer checks are added to ff_thread_release_buffer() stub function. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/mss2: fix chroma dimensionsMichael Niedermayer2014-01-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ebfe622bb1ca57cecb932e42926745cba7161913'Michael Niedermayer2014-01-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ebfe622bb1ca57cecb932e42926745cba7161913': mpegvideo: drop support for real (non-emulated) edges Conflicts: libavcodec/mpegvideo.c libavcodec/mpegvideo_motion.c libavcodec/wmv2.c If this is slower on a major platform then it should be investigated and potentially reverted. See: 8fc52a5ef94712d900fc8fe7503cf9c9ba635143 See: 3969b4b861ce8152e3195e8f8c3437abd273b90a Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: drop support for real (non-emulated) edgesAnton Khirnov2014-01-09
| | | | | | | | | | | | | | Several decoders disable those anyway and they are not measurably faster on x86. They might be somewhat faster on other platforms due to missing emu edge SIMD, but the gain is not large enough (and those decoders relevant enough) to justify the added complexity.
* | Avoid using empty macro arguments.Reimar Döffinger2013-12-31
| | | | | | | | | | | | | | | | | | These are not supported by all compilers (gcc 2.95 but also older SPARC compilers, see gcc bug #33304 for example), and there is no real need for them. One use of this feature remains in libavdevice/v4l2.c which can't be replaced quite as easily. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '66499f34b56fc6a9fdef25543bd9d576fc787895'Michael Niedermayer2013-12-06
|\| | | | | | | | | | | | | | | | | | | * commit '66499f34b56fc6a9fdef25543bd9d576fc787895': mpegvideo: do not set current_picture_ptr in decoders Conflicts: libavcodec/mss2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: do not set current_picture_ptr in decodersAnton Khirnov2013-12-05
| | | | | | | | | | | | | | | | | | | | | | This code was originally added in 5f1948111a4920ff74e31b4284ab0200f7938539 to h263 to set decoded frame pts to some random numbers (removed in a1c5cc429d99216406170eac7e8352860076d3e8) and then cargo culted to other decoders. The code is left in h263dec for now, since some part of the decoder (apparently OBMC) relies on the specific previous frame to be reused.
* | Merge commit 'c2f7417eeb9cc31f75e71f7be2780f90f1628d7e'Michael Niedermayer2013-11-30
|\| | | | | | | | | | | | | * commit 'c2f7417eeb9cc31f75e71f7be2780f90f1628d7e': vc1: move MpegEncContext.resync_marker into VC1Context. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vc1: move MpegEncContext.resync_marker into VC1Context.Anton Khirnov2013-11-29
| | | | | | | | | | The field still remains in MpegEncContext because it is used by the mpeg4 decoder.
* | Merge commit '730bac7bab3c7dcd9fcb7c70f154e5f4cfaef9a7'Michael Niedermayer2013-11-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '730bac7bab3c7dcd9fcb7c70f154e5f4cfaef9a7': mss4: use the AVFrame API properly. mss3: use the AVFrame API properly. mss2: use the AVFrame API properly. mss1: use the AVFrame API properly. Conflicts: libavcodec/mss1.c libavcodec/mss2.c libavcodec/mss3.c libavcodec/mss4.c See: 02fe531afefa7ac3fcc552f8e83461a4bfa7f868 See: ff1c13b133d548b3ce103f91999b6cc1bb7e65cc See: 310bf283542ff81a9ec8fa7492fe7d625e80562f Merged-by: Michael Niedermayer <michaelni@gmx.at>