Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-03avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt
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>
2022-08-27avcodec/internal: Move ff_set_dimensions() to decode.hAndreas Rheinhardt
Decoder-only, as the dimensions are set by the user when encoding. Also fixup the other headers a bit while removing unnecessary internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-30avcodec/codec_internal: add cap for ICC profile supportNiklas Haas
Codecs that can read/write ICC profiles deserve a special capability so the common logic in encode.c/decode.c can decide whether or not there needs to be any special handling for ICC profiles. The motivation here is to be able to use it to decide whether or not an ICC profile needs to be generated in the encode path, but it might as well get added to decoders as well for purely informative reasons. It's not entirely clear to me whether the "thp" and "smvjpeg" variants of "mjpeg" should have this capability set or not, given that the code technically supports it but I somehow doubt these files may contain them. In either case, this cap is purely informative for decoders so it doesn't matter too much either way. It's also not entirely clear whether the "amv" encoder should signal ICC profile support, but again erring on the side of caution, we probably *shouldn't* be generating (and encoding!) ICC profiles for this type of media file. Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-18avcodec: Make init-threadsafety the defaultAndreas Rheinhardt
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>
2022-07-09avcodec: Add const to decoder packet data pointersAndreas Rheinhardt
The packets given to decoder need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-05avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt
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>
2022-04-05avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt
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>
2022-03-21avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt
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>
2022-03-21avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt
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>
2022-02-14avcodec/exif: Don't include tiff.h in exif.hAndreas Schneider
The exif.h header doesn't use anything from tiff.h. We also just need to include tiff_common.h in .c files where it actually used. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-09avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt
The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26webp: fix transforms after a palette with pixel packing.Maryla
When a color indexing transform with 16 or fewer colors is used, WebP uses "pixel packing", i.e. storing several pixels in one byte, which virtually reduces the width of the image (see WebPContext's reduced_width field). This reduced_width should always be used when reading and applying subsequent transforms. Updated patch with added fate test. The source image dual_transform.webp can be downloaded by cloning https://chromium.googlesource.com/webm/libwebp-test-data/ Fixes: 9368 Signed-off-by: James Zern <jzern@google.com>
2021-09-20Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt
They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-22avcodec/webp: Check available space in loop in decode_entropy_coded_image()Michael Niedermayer
Fixes: Timeout Fixes: 35401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5714401821851648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-12avcodec/webp: Mark decoder as init-threadsafeAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27avcodec: Constify AVCodecsAndreas Rheinhardt
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>
2021-03-17avcodec/webp: use av_packet_alloc() to allocate packetsJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2020-10-27avcodec/webp: Replace never-true check by assertAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-27avcodec/webp: Return directly when creating Huff table failsAndreas Rheinhardt
Neither the auxiliary VLC table nor the code_lengths array need to be freed if creating the auxiliary VLC table fails. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-27avcodec/webp: Use uint8_t for code lengthsAndreas Rheinhardt
They are always in the range 0..15, so using an int is not necessary. Furthermore, using an int would not work if sizeof(int) != 4 as ff_init_vlc_sparse() can only handle uint8_t, uint16_t and uint32_t lengths. Reviewed-by: zhilizhao(赵志立) <quinkblack@foxmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-12avcodec/webp: Use LE VLC table for LE bitstream readerAndreas Rheinhardt
The WebP format uses Huffman tables and the decoder therefore uses VLC tables. Given that WebP is a LE format, a LE bitreader is used; yet the VLC table is not created for a LE reader (the process used to create the tables puts the last bit to be read in the lowest bit) and therefore custom code for reading the VLCs that reverses the bits read is used instead of get_vlc2(). This commit changes this to use a table designed for LE bitreader which allows to use get_vlc2() directly. The necessary reversing of the codes is delegated to ff_init_vlc_sparse() (and is therefore only done during init and not when actually reading the VLCs). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-10avcodec/webp: fix decoding for trailing junkPascal Massimino
some bitstream have trailing junk, despite being valid webp data. In case of apparent error, abort the loop and let *got_frame decide whether this is an error or not. fixes trac #8107 (/#7612) Another possibility would be turning the loop into: while (!*got_frame) {...} Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-27vp8: Add hwaccel hooksMark Thompson
Also adds some extra fields to the main context structure that may be needed by a hwaccel decoder. The current behaviour of the WebP decoder is maintained by adding an additional field to the VP8 decoder private context to indicate that it is actually being used as WebP (no hwaccel is supported for that case).
2017-10-26avcodec/exif: remove GetByteContext usage from avpriv_exif_decode_ifd()James Almer
This prevents potential ABI issues with GetByteContext. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-26avcodec/webp: add support for ICCP chunksJames Almer
Export the raw data as ICC Profile frame side data. Reviwed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-28avcodec/webp: Fixes null pointer dereferenceMichael Niedermayer
Fixes: 1470/clusterfuzz-testcase-minimized-5404421666111488 Fixes: 1472/clusterfuzz-testcase-minimized-5677426430443520 Fixes: 1875/clusterfuzz-testcase-minimized-5536474562822144 Approved-by: BBB Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-14avcodec/webp: Fix signedness in prefix_code checkMichael Niedermayer
Fixes: out of array read Fixes: 1557/clusterfuzz-testcase-minimized-6535013757616128 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-13avcodec/webp: Add missing input paddingMichael Niedermayer
Fixes: 1536/clusterfuzz-testcase-minimized-5973925404082176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-10avcodec/webp: Always set pix_fmtMichael Niedermayer
Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-09avcodec/webp: Update canvas size in vp8_lossy_decode_frame() as in ↵Michael Niedermayer
vp8_lossless_decode_frame() Fixes: 1407/clusterfuzz-testcase-minimized-6044604124102656 Fixes: 1420/clusterfuzz-testcase-minimized-6059927359455232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-09avcodec/webp: Factor update_canvas_size() outMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-09avcodec/webp: Check for VP8X after other VP8 chunksMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-06avcodec/webp: Fix null pointer dereferenceMichael Niedermayer
Fixes: 1369/clusterfuzz-testcase-minimized-5048908029886464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-23avcodec: do not use AVFrame accessorMuhammad Faiz
Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-06-29Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch
* commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-07get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun
This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
2016-04-17lavc/webp: Print a warning for unsupported chunks.Carl Eugen Hoyos
2016-02-21avcodec/webp: move exif_metadata outside of WebPContextJames Almer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-27Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer
* 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>
2015-07-27lavc: AV-prefix all codec capabilitiesVittorio Giovara
Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-16lavc: Add properties field to AVCodecContext.Carl Eugen Hoyos
The new field can hold information about losslessness and closed captions for now.
2015-07-03webp: fix infinite loop in webp_decode_frameAndreas Cadhalpun
The loop always needs at least 8 bytes for chunk_type and chunk_size. If fewer are left, bytestream2_get_le32 just returns 0 without reading any bytes, leading to an infinite loop. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-03webp: Make sure enough bytes are availableAndreas Cadhalpun
Every chunk needs at least 8 bytes for chunk_type and chunk_size. Prevent a possible infinite loop. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-19webp: ensure that each transform is only used onceAndreas Cadhalpun
According to the WebP Lossless Bitstream Specification "each transform is allowed to be used only once". If a transform is more than once this can lead to memory corruption. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-06webp: ensure that each transform is only used onceAndreas Cadhalpun
According to the WebP Lossless Bitstream Specification "each transform is allowed to be used only once". If a transform is more than once this can lead to memory corruption. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05webp: validate the distance prefix codeAndreas Cadhalpun
According to the WebP Lossless Bitstream Specification the highest allowed value for a prefix code is 39. If prefix_code is too large, the calculated extra_bits has an invalid value and triggers an assertion in get_bits. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-03avcodec/webp: validate the distance prefix codeAndreas Cadhalpun
According to the WebP Lossless Bitstream Specification the highest allowed value for a prefix code is 39. If prefix_code is too large, the calculated extra_bits has an invalid value and triggers an assertion in get_bits. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04avcodec/webp: use init_get_bits8()Paul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2014-10-05avcodec/webp: add assert to ensure palette is not larger than 256Michael Niedermayer
it should not be possible to be larger as its stored as 8bit value but we would be overwriting a stack buffer if it is ... Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05avcodec/webp: add optimization: use local palette with extra paddingPascal Massimino
for big enough pictures. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>