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-10-24avcodec/dnxhddec: Only keep what is used from ScanTableAndreas Rheinhardt
Namely ScanTable.permutated. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-21avcodec/blockdsp: Remove unused AVCodecContext parameterAndreas Rheinhardt
Possible since be95df12bb06b183c8d2aea3b0831fdf05466cf3. Reviewed-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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-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-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-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-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-25avcodec/dnxhddec: ignore second flag for encoded fieldPaul B Mahol
And instead use previous field flag. Fixes decoding files produced by non-compliant encoders.
2021-08-03avcodec/dnxhddec: check and propagate function return valuemaryam ebr
Similar to CVE-2013-0868, here return value check for 'init_vlc' is needed. crafted DNxHD data can cause unspecified impact. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-10avcodec/dnxhddec: 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-01-26avcodec/dnxhd: Make ff_dxnhd_get_cid_table return a pointer, not indexAndreas Rheinhardt
All callers only use the index into ff_dnxhd_cid_table to get a pointer to the desired entry. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-01lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov
They are not properly namespaced and not intended for public use.
2020-04-10pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov
init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
2020-03-14libavcodec, libpostproc: Remove outcommented START/STOP_TIMERAndreas Rheinhardt
as well as includes of libavutil/timer.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-29avcodec/dnxhddec: properly set colorspacePaul B Mahol
2018-12-26avcodec/dnxhddec: fix block alignmentRamiro Polla
blockdsp requires 32 byte alignment. Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-03avcodec/dnxhddec: use init_get_bits8()Paul B Mahol
2018-09-06avcodec/dnxhddec: ask for samples with alphaPaul B Mahol
2018-01-05avcodec/dnxhddec: Check dc vlcMichael Niedermayer
Fixes: signed integer overflow: 1024 + 2147483640 cannot be represented in type 'int' Fixes: 4671/clusterfuzz-testcase-minimized-6027464343027712 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>
2017-11-30avcodec/dnxhddec: Do not overwrite colorspace if the container has set it.Steven Robertson
The existing logic overrides container metadata even in cases where the container metadata must be trusted (e.g. HDR). The original spec had no provision for specifying color volume, so many files rely on the assumption of Rec. 709. An update to the spec included a 'clv' field for explicitly signaling that the container should be trusted in an existing bitfield in the frame header, but the default of 0 from old encoders forces Rec. 709, which would break any HDR stream. Because there is no place in DNxHR for specifying a transfer function, DNxHR HDR files must include container-level color information. This patch maintains the existing behavior of choosing the 709 over the 601 matrix when container-level information is missing, and allows container-level information to win if present. Signed-off-by: Steven Robertson <steven@strobe.cc> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-27avcodec/dnxhddec: Move mb height check out of non hr branchMichael Niedermayer
Fixes: out of array access Fixes: poc.dnxhd Found-by: Bingchang, Liu@VARAS of IIE Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11avcodec/dnxhddec: fix -Wformat warning raised by DJGPPJames Almer
FF_ARRAY_ELEMS returns a size_t value. Reviewed-by: ubitux Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-11avcodec/dnxhddec: add support for very big resolutionsPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-03-31dnxhd: initialize DNXHDContext::avctx to each thread's respective one.Ronald S. Bultje
Otherwise all thread's private contexts have the avctx pointer set to the AVCodecContext of the first thread, which means all writes to ctx->avctx->* (in e.g. read_header) are effectively race conditions. Fixes fate-dnxhd under tsan.
2017-03-29Fix all -Wformat warnings raised by DJGPPClément Bœsch
2017-03-24Merge commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50'Clément Bœsch
* commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50': Adjust printf conversion specifiers to match variable signedness Merged-by: Clément Bœsch <u@pkh.me>
2017-02-22avcodec/dnxhddec: fix decoding of DNxHR HQX 10-bitPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-03lavc: Remove CR/LF from avpriv_request_sample() calls.Carl Eugen Hoyos
2016-10-28Adjust printf conversion specifiers to match variable signednessDiego Biurrun
2016-08-03libavcodec/dnxhd: Enable 12-bit DNxHR support.Steven Robertson
10- and 12-bit DNxHR use the same DC coefficient decoding process and VLC table, just with a different shift value. From SMPTE 2019-1:2016, 8.2.4 DC Coefficient Decoding: "For 8-bit video sampling, the maximum value of η=11 and for 10-/12-bit video sampling, the maximum value of η=13." A sample file will be uploaded to show that with this patch, things decode correctly: dnxhr_hqx_12bit_1080p_smpte_colorbars_davinci_resolve.mov Signed-off-by: Steven Robertson <steven@strobe.cc> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-25avcodec/dnxhddata: move avpriv_dnxhd_parse_header_prefix to a headerJames Almer
It's a small and simple function that can be inlined. This removes one private symbol and should reduce object dependencies with the next major bump Signed-off-by: James Almer <jamrial@gmail.com>
2016-07-20libavcodec/dnxhd: add dnxhr profilesMark Reid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-16libavcodec/dnxhd: add support more dnxhr header prefixesMark Reid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14libavcodec/dnxhd_parser: add parser and probe support raw 444 and dnxhr formatsMark Reid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-04avcodec/dnxhddec: Fix runtime error: left shift of negative valueMichael Niedermayer
Fixes: 2abd25478c62a675f335fac00b467023/asan_static-oob_10aff98_1227_8811480c6ef1e970a7977ceb7e5a9958.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-29avcodec/dnxhddec: Disable 12bit by defaultMichael Niedermayer
The DC VLC table used is too small, fixing this requires a sample, thus request a sample. Some samples are said to work even though the table has the wrong size, thus this is left enabled if the user enables experimental features. Fixes: 2abd25478c62a675f335fac00b467023/asan_static-oob_10aff98_1227_8811480c6ef1e970a7977ceb7e5a9958.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Approved-by: kurosu Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06avcodec/dnxhddec: Make mb_scan_index a fixed length arrayMichael Niedermayer
Fixes null pointer dereference Fixes: 5c9d1a6f74a12763fc7c9dd7834022b9/signal_sigsegv_11f78d9_1461_ecee3c5e7205457498e79b3ffaf21d0c.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-15dnxhd: interleave AC levels and flagsChristophe Gisquet
This allows more efficient access to the array as the level and flags are contiguous. Around 4% faster coefficient decoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08dnxhddec: better support for 4:4:4Christophe Gisquet
Profiles 1256 & 1270 (currently) signal at the frame header and MB levels the colorspace used, either RGB or YUV. While a MB-level varying colorspace is not supported, whether it is constant can be tracked so as to determine the exact colorspace. This requires having bitdepth and the ACT and 4:4:4 flags, in turn needing the CID. Because setting those before having validated enough things may result in invalid/unset DSP fucntions, setting the bitdepth in the context is delayed. It is not tested against a true RGB sequence, though. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05dnxhd: add better support for CIDs 1270 to 1274Jeremy James
These are DNxHR profiles with the following properties: - Variable size in a profile (property added in a previous commit), requiring variable-sized macroblock table; - Variable bitdepth, up to 12 bits. - Better validation of buffer sizes and positions Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05dnxhd: add CID 1270Christophe Gisquet
This a 4:4:4 10 bits profile, where image size is not fixed by the profile, and which strays a bit outside the old frame header parsing code. Fixes ticket #4581 (DNxHR is not stricly supported, but that sequence is). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05dnxhd: add decoder support for DNxHRJeremy James
Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05dnxhddec: Introduce DNXHD_VARIABLEChristophe Gisquet
Currently not used, but will be used to indicate that a CIDEntry field is not set, because it is variable, and that checks should be adapted. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05dnxhddec: cleanup frame header parsingChristophe Gisquet
Rely more on the actual syntax from the specs (also seen in the encoder code). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-02dnxhddec: init scantable once permutation is setChristophe Gisquet
Otherwise, the dsp may change without its permuation being applied. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>