summaryrefslogtreecommitdiff
path: root/libavcodec/mss2.c
Commit message (Collapse)AuthorAge
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-31
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mss[12]: Cleanup generically on init failureAndreas Rheinhardt2024-03-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Make applying decode_error_flags optionalAndreas Rheinhardt2023-09-15
| | | | | | | | | | Add a pointer parameter that if supplied will be used to return the updated decode_error_flags. This will allow to fix several races when using frame-threading; these resulted from AVFrame that the earlier code updated concurrently being used as source in an av_frame_ref() call in the decoder's update_thread_context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use proper namespaceAndreas Rheinhardt2023-09-11
| | | | | | | | | | | | | | | | 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>
* all: Use av_frame_replace() where appropriateAndreas Rheinhardt2023-09-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-04
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegvideo_dec: Don't use MotionEstContext as scratch spaceAndreas Rheinhardt2022-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoders that might use quarter pixel motion estimation (namely MPEG-4 as well as the VC-1 family) currently use MpegEncContext.me.qpel_(put|avg) as scratch space for pointers to arrays of function pointers. (MotionEstContext contains such pointers as it supports quarter pixel motion estimation.) The MotionEstContext is unused apart from this for the decoding part of mpegvideo. Using the context at all is for decoding is actually unnecessary and easily avoided: All codecs with quarter pixels set me.qpel_avg to qdsp.avg_qpel_pixels_tab, so one can just unconditionally use this in ff_mpv_reconstruct_mb(). MPEG-4 sets qpel_put to qdsp.put_qpel_pixels_tab or to qdsp.put_no_rnd_qpel_pixels_tab based upon whether the current frame is a b-frame with no_rounding or not, while the VC-1-based decoders set it to qdsp.put_qpel_pixels_tab unconditionally. Given that no_rounding is always zero for VC-1, using the same check for VC-1 as well as for MPEG-4 would work. Since ff_mpv_reconstruct_mb() already has exactly the right check (for hpeldsp), it can simply be reused. (This change will result in ff_mpv_motion() receiving a pointer to an array of NULL function pointers instead of a NULL pointer for codecs without qpeldsp (like MPEG-1/2). It doesn't matter.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1dec: Factor (re)initializing code outAndreas Rheinhardt2022-11-06
| | | | | | | This is in preparation for removing the msmpeg4 dependency from VC-1. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mss2: initialise wmv9_mask variablePeter Ross2022-11-01
| | | | initialised to -1 which indicates wmv9 mask not present
* avcodec/mss2: calculate draw region and revise split positionPeter Ross2022-10-26
| | | | | | | | for videos with wmv9 rectangles, the region drawn by ff_mss12_decode_rect may be less than the entire video area. the wmv9 rectangles are used to calculate the ff_mss12_decode_rect draw region. Fixes tickets #3255 and #4043
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-03
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-27
| | | | | | | | | Only used by decoders (encoders have ff_encode_alloc_frame()). Also clean up the other headers a bit while removing now redundant internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_reget_buffer() to decode.hAndreas Rheinhardt2022-08-27
| | | | | | | | | Only used by decoders. Also clean up the headers a bit while removing now unnecessary internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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
| |