summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhdenc.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-041-1/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: support AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE in all no-delay encodersAnton Khirnov2023-01-291-1/+1
| | | | Including fake-delay encoders marked with FF_CODEC_CAP_EOF_FLUSH.
* avcodec/blockdsp: Remove unused AVCodecContext parameterAndreas Rheinhardt2022-09-211-1/+1
| | | | | | | Possible since be95df12bb06b183c8d2aea3b0831fdf05466cf3. Reviewed-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | 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: Constify frame->data pointers for encoders where possibleAndreas Rheinhardt2022-08-051-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+1
| | | | | | | | | | | 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>
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-151-2/+3
| | | | | | | | | | | | | | | | | | This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | 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/internal: Move FF_SIGNBIT and ff_log2_run to mathops.hAndreas Rheinhardt2022-03-211-1/+1
| | | | | | | It is a more fitting place for them. Also move the definition of ff_log2_run to mathtables.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt2022-03-211-1/+1
| | | | | | | This structure is no longer declared in a public header, so using an FF-prefix is more appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-9/+9
| | | | | | | | | | | | | | | | 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-211-0/+1
| | | | | | | | | | 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/dnxhdenc: fill unused bytes from put bits buffer with zerosPaul B Mahol2022-03-051-0/+1
|
* avcodec/dnxhdenc: retry increasing qscale to not overflow max_bitsPaul B Mahol2022-03-051-3/+5
| | | | | | | Increase mb_bits type from uint16_t to uint32_t to fix possible overflows in bit size calculations. Update fate test that needs change.
* avcodec/dnxhdenc: fix possible out of bound writes for big w/hPaul B Mahol2022-03-041-0/+3
| | | | It was caused by integer overflows.
* avcodec/mpegvideo: Move encoder-only stuff to a new headerAndreas Rheinhardt2022-02-131-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhddata: Unavpriv dnxhd_get_(hr_|)_frame_size()Andreas Rheinhardt2021-11-191-1/+1
| | | | | | It is no longer used in libavformat. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-021-4/+0
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEYAndreas Rheinhardt2021-09-281-1/+0
| | | | | | | 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>
* avcodec/dnxhdenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-101-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Use av_memdup() instead of av_malloc()+memcpy()Andreas Rheinhardt2021-05-101-2/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Fix segfault when using too many slice threadsAndreas Rheinhardt2021-05-101-1/+1
| | | | | | | | | | | | | | The DNXHD encoder's context contains an array of 32 pointers to DNXHDEncContexts used in case of slice threading; when trying to use more than 32 threads with slice threading, the encoder's init function errors out, but the close function takes avctx->thread_count at face value and tries to free inexistent elements of the array, leading to potential crashes. Fix this by modifying the check used to decide whether the slice contexts should be freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-051-2/+4
| | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | 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: Remove deprecated AVCodecContext.coded_frameAndreas Rheinhardt2021-04-271-17/+0
| | | | | | | | | | Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370. (The currently disabled filter vf_mcdeint and vf_uspp were users of this field; they have not been changed, so that whoever wants to fix them can see the state of these filters when they were disabled.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dnxhd: Make ff_dxnhd_get_cid_table return a pointer, not indexAndreas Rheinhardt2021-01-261-5/+3
| | | | | | | 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>
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-011-0/+1
| | | | That is a more appropriate place for it.
* avcodec/dnxhdenc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos labelLimin Wang2020-06-131-43/+22
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/internal: move packet related functions to their own headerJames Almer2020-06-021-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: deprecate Lossless and Intra Only encoder capabilitesJames Almer2020-05-211-1/+1
| | | | | | | Both are codec properties and not encoder capabilities. The relevant AVCodecDescriptor.props flags exist for this purpose. Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec, libpostproc: Remove outcommented START/STOP_TIMERAndreas Rheinhardt2020-03-141-3/+1
| | | | | | | 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>
* avcodec/dnxhdenc: Fix undefined left shifts of negative numbersAndreas Rheinhardt2019-09-281-3/+3
| | | | | | | Affected 61 FATE-tests: 60 vsynth tests and lavf-mxf_opatom. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dnxhdenc: return error if av_malloc failedLimin Wang2019-09-251-0/+2
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/dnxhd: change ff_dnxhd_get_hr_frame_size to avpriv_Jason Stevens2018-09-101-1/+1
| | | | | | | | refactor ff_dnxhd_get_hr_frame_size to avpriv_dnxhd_get_hr_frame_size, to allow cross library usage in libavformat/mxfenc this change makes this function no longer be always inlined. Signed-off-by: Jason Stevens <jay@wizardofthenet.com>
* avcodec/dnxhdenc: interlaced is not supported in DNxHRPaul B Mahol2018-09-061-0/+6
| | | | Fixes #7263.
* avcodec/dnxhdenc: stop leaking memory when initalization failsPaul B Mahol2018-08-311-9/+9
| | | | Fixes #6593.
* avcodec/dnxhdenc: do not free nonexistent slice threads data when frame ↵Paul B Mahol2018-06-011-2/+4
| | | | | | | | | threading is used Forgotten in 28e9ba951d1a0b0aca53b242aa64f484ca75e874. Fixes #7241. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '94eed68ace9f2416af8457fcbf142b175928c06b'James Almer2017-10-231-6/+0
|\ | | | | | | | | | | | | * commit '94eed68ace9f2416af8457fcbf142b175928c06b': lavc: Drop deprecated options moved to private contexts Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Drop deprecated options moved to private contextsVittorio Giovara2017-03-231-6/+0
| | | | | | | | Deprecated in 10/2014 and 07/2015.
| * lavc: Remove deprecated XvMC support hacksDiego Biurrun2017-03-231-1/+1
| | | | | | | | Deprecated in 11/2013.
* | avcodec/dnxhdenc: fix DNxHR 444 encoding crashesFrédéric Devernay2017-09-261-8/+8
| | | | | | | | Fixes #6649.
* | avcodec/dnxhdenc: call slice thread code only if slice threading is enabledPaul B Mahol2017-08-171-6/+10
| |
* | avcodec/dnxhdenc: enable frame threadingPaul B Mahol2017-07-271-1/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dnxhdenc: Assert that frame size is not assigned an error codeMichael Niedermayer2017-06-151-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/dnxhdenc: fix recent regressionPaul B Mahol2017-04-151-1/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dnxhd*: add ff_dnxhd_get_hr_frame_size()Paul B Mahol2017-04-141-9/+2
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dnxhdenc: make sure that mb_height > 255 can be storedPaul B Mahol2017-04-141-1/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dnxhdenc: fix indentation issuePaul B Mahol2017-04-011-3/+3
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dnxhdenc: DNxHR 444 and HQX supportPaul B Mahol2017-04-011-68/+212
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '47756f51fe836959ffa5c6e2baeacbd71e150069'Clément Bœsch2017-03-241-9/+0
|\ \ | |/ | | | | | | | | | | * commit '47756f51fe836959ffa5c6e2baeacbd71e150069': dnxhdenc: Drop pointless, commented-out debug output Merged-by: Clément Bœsch <u@pkh.me>