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: Make ff_alloc_packet() based encoders accept user buffersAndreas Rheinhardt
Up until now, these encoders received non-refcounted packets (whose data was owned by the corresponding AVCodecContext) from ff_alloc_packet(); these packets were made refcounted lateron by av_packet_make_refcounted() generically. This commit makes these encoders accept user-supplied buffers by replacing av_packet_make_refcounted() with an equivalent function that is based upon get_encode_buffer(). (I am pretty certain that one can also set the flag for mpegvideo- based encoders, but I want to double-check this later. What is certain is that it reallocates the buffer owned by the AVCodecContext which should maybe be moved to encode.c, so that proresenc_kostya.c and ttaenc.c can make use of it, too.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05avcodec: Constify frame->data pointers for encoders where possibleAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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-03avcodec/j2kenc: Remove unused-but-set variableAndreas Rheinhardt
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-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-03-16libavcodec: Split version.hMartin Storsjö
This avoids including version.h in all source files, avoiding unnecessary rebuilds when the version number is bumped. Only version_major.h is included by the main header, which defines availability of e.g. FF_API_* macros, and which is bumped much less often. This isn't done for libavutil/version.h, because that header needs to be included essentially everywhere due to LIBAVUTIL_VERSION_INT being used wherever an AVClass is constructed. Signed-off-by: Martin Storsjö <martin@martin.st>
2021-12-03all: Remove unused-but-set variablesAndreas Rheinhardt
Newer versions of Clang detect this and emit warnings for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-28avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEYAndreas Rheinhardt
It is now set generically for all those encoders whose corresponding AVCodecDescriptor has the AV_CODEC_PROP_INTRA_ONLY. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26avcodec/j2kenc: Fix AV_OPT_TYPE_CONST offsetsAndreas Rheinhardt
They are supposed to be zero. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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-07-03avcodec/j2kenc: Check for av_strtok() failureMichael Niedermayer
Fixes: CID1466601 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()Andreas Rheinhardt
Up until now, ff_alloc_packet2() has a min_size parameter: It is supposed to be a lower bound on the final size of the packet to allocate. If it is not too far from the upper bound (namely, if it is at least half the upper bound), then ff_alloc_packet2() already allocates the final, already refcounted packet; if it is not, then the packet is not refcounted and its data only points to a buffer owned by the AVCodecContext (in this case, the packet will be made refcounted in encode_simple_internal() in libavcodec/encode.c). The goal of this was to avoid data copies and intermediate buffers if one has a precise lower bound. Yet those encoders for which precise lower bounds exist have recently been switched to ff_get_encode_buffer() (which automatically allocates final buffers), leaving only two encoders to actually set the min_size to something else than zero (namely aliaspixenc and hapenc). Both of these encoders use a very low lower bound that is not helpful in any nontrivial case. This commit therefore removes the min_size parameter as well as the codepath in ff_alloc_packet2() for the allocation of final buffers. Furthermore, the function has been renamed to ff_alloc_packet() and moved to encode.h alongside ff_get_encode_buffer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-12avcodec/j2kenc: Make encoder init-threadsafeAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-12avcodec/mqc: Hardcode tables to save spaceAndreas Rheinhardt
mqc currently initializes three arrays at runtime; each of them has 2 * 47 elements, one is uint16_t, two are uint8_t, so that their combined size is 8 * 47. The source data for these initializations is contained in an array of 47 elements of size six. Said array is only used in order to initialize the other arrays, so the savings are just 2 * 47B. Yet this is dwarfed by the size of the code for performing the initializations: It is 109B (GCC 10.2, x64, -O3 albeit in an av_cold function); this does not even include the size of the code in the callers. So just hardcode these tables. This also fixes a data race, because the encoder always initialized these tables during init, although they might already be used at the same time by already running encoder/decoder instances. 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-04-27avcodec: Remove private options from AVCodecContextAndreas Rheinhardt
Several options that were too codec-specific were deprecated between 0e6c8532215790bbe560a9eea4f3cc82bb55cf92 and 0e9c4fe254073b209970df3e3cb84531bc388e99. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2020-09-19avcodec/j2kenc: Fix leaks on init failureAndreas Rheinhardt
The JPEG2000 encoder did not clean up after itself on error. This commit fixes this by modifying the cleanup function to be able to handle only partially allocated structures and by setting the FF_CODEC_CAP_INIT_CLEANUP flag. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30libavcodec/jpeg2000: fix tag tree resetGautam Ramakrishnan
The implementation of the tag tree did not set the correct reset value for the encoder. This lead to inefficent tag tree being encoded. This patch fixes the implementation of the ff_tag_tree_zero() function. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30libavcodec/j2kenc: Support for multiple layersGautam Ramakrishnan
This patch allows setting a compression ratio and to set multiple layers. The user has to input a compression ratio for each layer. The per layer compression ration can be set as follows: -layer_rates "r1,r2,...rn" for to create 'n' layers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30libavcodec/j2kenc: Fix tag tree codingGautam Ramakrishnan
The implementation of tag tree encoding was incorrect. However, this error was not visible as the current j2k encoder encodes only 1 layer. This patch fixes tag tree coding for JPEG2000 such tag tree coding would work for multi layer encoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-09libavcodec/j2kenc: Support for all Progression ordersGautam Ramakrishnan
This patch allows for selecting the progression order in the j2k encoder. However, all components and resolution levels will use the same progression order and will not feature the use of progression order change markers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-06libavcodec/j2kenc: Allow Encoder to use SOP and EPH markersGautam Ramakrishnan
This patch allows the encoder to use SOP and EPH markers. This would be useful as these markers provide better error detection mechanisms. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30libavcodec/j2kenc: Encoding up to 16 bitsGautam Ramakrishnan
This patch allows the JPEG2000 encoder to encode images to up to 16 bits. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-21avcodec/j2kenc: Fix undefined shifts of negative numbersAndreas Rheinhardt
Also add parentheses to some lines to make the operator precedence clearer. This affected the FATE-tests vsynth*-jpeg2000 and vsynth*-jpeg2000-97 (where * ranges over { 1, 2, 3, _lena }) as well as ticket #7983. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-25lavc/j2kenc: Support AV_PIX_FMT_PAL8.Carl Eugen Hoyos
2017-12-02avcodec/jpeg2000: Only allocate Jpeg2000Pass for the encoderMichael Niedermayer
Reduces memory needed. Fixes: OOM Fixes: 4427/clusterfuzz-testcase-minimized-5106919271301120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-02avcodec/j2kenc: Fix out of array access in encode_cblk()Michael Niedermayer
Fixes: 4427/clusterfuzz-testcase-minimized-5106919271301120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-24avcodec/j2kenc: Only allocate cblk.data onceMichael Niedermayer
Fixes: memleak Found-by: <jamrial> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-22avcodec/jpeg2000: Dynamically allocate codeblock dataMichael Niedermayer
Fixes: OOM Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992 Adds support for decoding codeblock data larger than 8kb Reduces decoder memory consumption Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-07avcodec: remove remaining uses of avcodec_get_chroma_sub_sampleMartin Vignali
Replace them with av_pix_fmt_get_chroma_sub_sample. Signed-off-by: James Almer <jamrial@gmail.com>
2016-04-01avcodec/j2kenc: Add attribution to OpenJPEG project:Aaron Boxer
http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-03Merge commit '2862b63783b5556f7f3fb2d097629bc6879f833a'Derek Buitenhuis
* commit '2862b63783b5556f7f3fb2d097629bc6879f833a': lavc: Move prediction_method to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-09-05lavc/j2kenc: Remove experimental flag.Carl Eugen Hoyos
The encoder produces valid and - if requested - lossless files.
2015-07-28Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer
* 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>
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-27Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer
* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer
This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-11avcodec/j2kenc: remove unused variableMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-06lavc/j2kenc: Enable yuv42x and yuv41x encoding.Carl Eugen Hoyos
Fixes ticket #535. Fixes ticket #4524.
2015-07-03avcodec/j2kenc: Support user specified tile dimensionsMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-30lavc/j2kenc: Make jp2 output compatible with Kakadu.Carl Eugen Hoyos
Fixes ticket #4689.
2015-06-30avcodec/j2kenc: store libavcodec ident in a comment unless bitexact mode is usedMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-26avcodec/jpeg2000: Remove CBLK limitMichael Niedermayer
This also reduces the amount of memory needed Fixes Ticket4672 The new code seems slightly faster as well, probably due to better cache usage Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-19avcodec/j2kenc: Use JP2 format by defaultMichael Niedermayer
Without the JP2 fields its not possible to identify the colorspace Fixes Ticket538 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-19avcodec/j2kenc: Support writing JP2 encapsulationMichael Niedermayer
The added option matches openjpeg Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-19avcodec/j2kenc: YUV should not use the ICTMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17avcodec/j2kenc: Properly flush the end of the truncated AC streamMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>