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-19avcodec/encode: Enable encoders to control padding of last frameAndreas Rheinhardt
Some audio codecs work with atomic units that decode to a fixed number of audio samples with this number being so small that it is common to put multiple of these atoms into one packet. In these cases it makes no sense to pad the last frame to the big frame_size, so allow encoders to set the number of samples that they want the last frame to be padded to instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-19avcodec/encode: Redo checks for small last audio frameAndreas Rheinhardt
In particular, check that there is only one small last frame in case the encoder has the AV_CODEC_CAP_SMALL_LAST_FRAME set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-06avcodec/decode: remove superfluous initial channels fieldsJames Almer
They are internal, so there's no need to keep them around as they are just duplicate functionality. Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-27avcodec/internal: Move ff_dvdsub_parse_palette() to new header dvdsub.hAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27avcodec/internal: Move ff_side_data_update_matrix_encoding to decode.hAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27avcodec/internal: Move ff_samples_to_time_base() to encode.hAndreas Rheinhardt
It is only used by encoders; in fact, AVCodecContext.time_base is only used by encoders, so it is only useful for encoders. Also constify the AVCodecContext parameter in it. Also fixup the other headers a bit while removing now unnecessary internal.h inclusions. 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-08-27avcodec/internal: Move ff_set_sar() to decode.hAndreas Rheinhardt
Only used by decoders, as the SAR has to be set by the user when encoding. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt
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>
2022-08-27avcodec/internal: Move ff_reget_buffer() to decode.hAndreas Rheinhardt
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>
2022-08-27avcodec/internal: Move ff_get_format() to decode.hAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27avcodec/internal: Fix outdated commentAndreas Rheinhardt
The legacy API is long gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05avcodec/internal: Move ff_thread_can_start_frame() to threadframe.hAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-02lavc: add API for exporting reconstructed frames from encodersAnton Khirnov
2022-07-30avcodec: add common fflcms2 boilerplateNiklas Haas
Handling this in general code makes more sense than handling it in individual codec files, because it would be a lot of unnecessary code duplication for the plenty of formats that support exporting ICC profiles (jpg, png, tiff, webp, jxl, ...). encode.c and decode.c will be in charge of initializing this state as needed, so we merely need to make sure to uninit it afterwards from the common destructor path. Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-22avcodec/aacdec: remove skip samples multiplierJames Almer
The amount of padding samples reported by containers take into account the extended samplerate in HE-AAC. Fixes ticket #9671. Signed-off-by: James Almer <jamrial@gmail.com>
2022-05-12avcodec/internal: Hide stuff only used by the core decode APIAndreas Rheinhardt
The general decoding API uses bitstream filters and an AVFifo and therefore AVCodecInternal contains pointers to an AVBSFContext and to an AVFifo and lavc/internal.h includes lavc/bsf.h and lavu/fifo.h. Yet actually, only two files are supposed to use these, namely avcodec.c and (mainly) decode.c. For all the other files, it should be an opaque type that they should not touch and that they need not know anything about. This can be achieved by not including these headers and using the structs instead of the corresponding typedefs. This also forces translation units that really use the BSF and the FIFO APIs themselves to include the relevant headers directly instead of relying on indirect inclusions (up until now, even avcodec.c and decode.c relied on fifo.h to be included by internal.h). Of course, it also avoids unnecessary rebuilds when bsf.h or fifo.h change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-13lavc/encode: drop EncodeSimpleContextAnton Khirnov
It has only a single member.
2022-03-24avcodec/internal: Move FF_QSCALE_TYPE_* to mpegvideodec.hAndreas Rheinhardt
These values are only used by mpegvideo-based decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-24avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-22avcodec/internal: Move FF_DEFAULT_QUANT_BIAS to mpegvideoenc.hAndreas Rheinhardt
Only used there. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-22avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.hAndreas Rheinhardt
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>
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-15lavc: switch to the new channel layout APIVittorio Giovara
Since the request_channel_layout is used only by a handful of codecs, move the option to codec private contexts. Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
2022-02-08avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt
This is by definition the appropriate place for it. Remove all the now unnecessary libavcodec/internal.h inclusions; also remove other unnecessary headers from the affected files. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-07lavc/avcodec: switch to new FIFO APIAnton Khirnov
2022-01-04avcodec/utils: Unavpriv avpriv_toupper4()Andreas Rheinhardt
This function is quite small (96B with GCC 11.2 on x64 Ubuntu 21.10 at -O3), making it more economical to duplicate it into libavformat instead of exporting it as avpriv: Doing so saves 2x24B in .dynsim, 2x16B in .dynstr, 2x2B .gnu.version, 24B in .rela.plt, 16B in .plt, 16B in .plt.sec (if enabled), 4B .gnu.hash; besides the actual duplicated code this also adds 2x8B .eh_frame_hdr and 24B .eh_frame. In other words: Duplicating is neutral size-wise (it is also presumed neutral for other systems). Given that it avoids the runtime overhead of dynamic symbols, it is advantageouos to duplicate the function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-04avcodec/internal: Remove unused av_export_avcodecAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-07avcodec/internal: Allow receive_frame codecs to use decode_simple pktAndreas Rheinhardt
Decoders implementing the receive_frame API currently mostly use stack packets to temporarily hold the packet they receive from ff_decode_get_packet(). This role directly parallels the role of in_pkt, the spare packet used in decode_simple_internal for the decoders implementing the traditional decoding API. Said packet is unused by the generic code for the decoders implementing the receive_frame API, so allow them to use it to fulfill the function it already fulfills for the traditional API for both APIs. There is only one caveat in this: The packet is automatically unreferenced in avcodec_flush_buffers(). But this is actually positive as it means the decoders don't have to do this themselves (in case the packet is preserved between receive_frame calls). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-28avcodec/encode: Set AV_PKT_FLAG_KEY based upon AV_CODEC_PROP_INTRA_ONLYAndreas Rheinhardt
Currently, the AV_PKT_FLAG_KEY is automatically set for audio encoders; yet this is wrong, as both MLP and TrueHD have non-keyframes. So set it based upon AV_CODEC_PROP_INTRA_ONLY (from the corresponding AVCodecDescriptor) instead. This also sets it for some video codecs, which is intended. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26avcodec/internal: Update AVCodecInternal.is_copy documentationAndreas Rheinhardt
Forgotten in 1f4cf92cfbd3accbae582ac63126ed5570ddfd37. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-05Move ff_tlog() from lavc/internal.h to lavu/internal.hAndreas Rheinhardt
It is also used by libavfilter and it is only natural to define it alongside ff_dlog(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22avcodec/avcodec: Stop including bsf.h in avcodec.hAndreas Rheinhardt
Also include bsf.h directly wherever it is used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-21avcodec/decode: add an internal codec flag to signal a decoder sets all ↵James Almer
output frame properties Decoders like cuviddec ignore and overwrite all the properties set by the generic code as derived from AVCodecInternal.last_pkt_props. This flag ensures libavcodec will not store and potentially queue input packets that ultimately will not be used. Signed-off-by: James Almer <jamrial@gmail.com>
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-06-08avcodec/internal: Remove outdated documentation of ff_alloc_packet2()Andreas Rheinhardt
Its documentation described the way user-supplied buffers worked before 93016f5d1d280f9cb7856883af287fa66affc04c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28avcodec/avcodec: Store whether AVCodec->close needs to be calledAndreas Rheinhardt
Right now all AVCodecContexts except those using frame-threaded decoding call the codec's init function and expect its close function to be called. In order to make sure that the close function is not called for frame-threaded decoding ff_frame_thread_free() resets AVCodecContext.codec (and because of this it has to free the private AVOptions of the main AVCodecContext itself). This is not obvious and potentially fragile. Instead add a field to AVCodecInternal that indicates whether close should be called for this AVCodecContext. It is always zero when using frame-threaded decoding, so that resetting the codec is no longer necessary and has been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27avcodec: Remove deprecated old encode/decode APIsAndreas Rheinhardt
Deprecated in commits 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 and 31f6a4b4b83aca1d73f3cfc99ce2b39331970bf3. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-16lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal capAnton Khirnov
AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark codecs that spawn threads internally and are able to select an optimal threads count by themselves (all such codecs are wrappers around external libraries). It is used by lavc generic code to check whether it should handle thread_count=0 itself or pass the zero directly to the codec implementation. Within this meaning, it is clearly supposed to be an internal cap rather than a public one, since from the viewpoint of a libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens in the generic code or within the codec internals is not a meaningful difference for the caller. External aspects of this flag will be dealt with in the following commit.
2021-03-03avcodec/decode: port last_pkt_props to AVFifoBufferJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-01-26lavc: shedule old encoding/decoding API for removalAnton Khirnov
It has been deprecated for 4 years and certain new codecs do not work with it. Also include AVCodecContext.refcounted_frames, as it has no effect with the new API.
2020-12-04avcodec/utils: Remove ff_codec_open2_recursive()Andreas Rheinhardt
This function existed to enable codecs with non-threadsafe init functions to initialize other codecs despite the fact that normally no two codecs with non-threadsafe init functions can be initialized at the same time (there is a mutex guarding this). Yet there are no users of this function any more as all users have been made thread-safe (switching away from ff_codec_open2_recursive() was required for this as said function requires the caller to hold the lock to the mutex guarding the initializations and this is only true for codecs with the FF_CODEC_CAP_INIT_THREADSAFE flag unset); so remove it. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-28lavc: un-avpriv avpriv_bprint_to_extradata()Anton Khirnov
It has not been used outside of lavc since 6f69f7a8bf6. Also, move it to the only place where it is used.
2020-09-15avcodec/decode: use a packet list to store packet propertiesJames Almer
Keeping only the latest packet fed to the decoder works only for decoders that return a frame immediately after every consumed packet. Decoders that consume several packets before they return a frame will fill said frame with properties taken from the last consumed packet instead of the earliest. Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-20avcodec/decode: move the ff_decode_frame_props() prototype to the proper headerJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-16avcodec/utils: calculate frame number of HEVC if the framerate > 30FPSLimin Wang
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-08-15avcodec: move ff_alloc_a53_sei() to atsc_53James Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-01avcodec/internal: remove unused out_frame field from DecodeSimpleContextJames Almer
It was introduced in 061a0c14bb but apparently never used Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-28avcodec/utils: add ff_alloc_timecode_sei() for hevc timecode seiLimin Wang
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>