summaryrefslogtreecommitdiff
path: root/libavcodec/internal.h
Commit message (Collapse)AuthorAge
* avcodec: remove unnecessary calls to ff_init_buffer_info()James Almer2018-02-14
| | | | | | | | And remove the function altogether while at it. It's a duplicate of another. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: remove complex debug code around avcodec init lockingwm42017-12-26
| | | | | | | | | | | | | | | | | | | | | This is just a lot of complicated and confusing code that had no purpose anymore. Also, the functions return values were checked only sometimes. Locking shouldn't fail anyway, so remove the return values. Barely any other pthread lock calls check the return value (including more important code that is more likely to fail horribly if locking fails). It could be argued that it might be helpful in some debugging situations, or when the user built FFmpeg without thread support against all good advice. But there are dummy atomics too, so the atomic check won't help with ensuring correctness absolutely. You gain very little. Also, for debugging, you can just raise the ASSERT_LEVEL, and then libavutil/thread.h will redefine the locking functions to explicitly check the return values.
* lavc, lavf: move avformat static mutex from avcodec to avformatwm42017-12-26
| | | | | | | | It's completely absurd that libavcodec would care about libavformat locking, but it was there because the lock manager was in libavcodec. This is more stright forward. Changes ABI, but we don't require ABI compatibility currently.
* avcodec: add stride alignment needed for AVX-512James Darnley2017-12-24
|
* Revert "libavcodec/utils.c: simplify avcodec locking with atomics"Hendrik Leppkes2017-12-11
| | | | | | | | | | This reverts commit 590136e78da3d091ea99ab5432543d47a559a461. Atomics are not required for this variable, because it is protected through the lock manager, and the use of atomics here is not compatible with the c11 emulation wrappersi. Fixes FATE on MSVC, among other setups which use the compat wrappers.
* lavc: Use hardware config information in ff_get_format()Mark Thompson2017-11-26
| | | | | | | | | | | | | | | This removes the dependency that hardware pixel formats previously had on AVHWAccel instances, meaning only those which actually do something need exist after this patch. Also updates avcodec_default_get_format() to be able to choose hardware formats if either a matching device has been supplied or no additional external configuration is required, and avcodec_get_hw_frames_parameters() to use the hardware config rather than searching the old hwaccel list. The FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS mechanism is deleted because it no longer does anything (the codec already contains the pointers to the matching hwaccels).
* libavcodec/utils.c: simplify avcodec locking with atomicsRostislav Pehlivanov2017-11-26
| | | | | | Also makes it more robust than using volatiles. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* Merge commit '3152058bf1dca318898550efacf0286f4836cae6'James Almer2017-11-19
|\ | | | | | | | | | | | | * commit '3152058bf1dca318898550efacf0286f4836cae6': libavcodec: Don't use dllexport, only dllimport when building DLLs Merged-by: James Almer <jamrial@gmail.com>
| * libavcodec: Don't use dllexport, only dllimport when building DLLsMartin Storsjö2017-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only purpose of dllexport (which is set while building the library that exports the symbols) is to have the linker automatically export such symbols into a DLL without using a def file - it doesn't affect the generated code. For both MSVC and mingw builds, this isn't essential since we override what symbols to export via an autogenerated def file instead. Update a comment in configure to refer to the right concept. With lld, this avoids warnings about duplicate export directives, when some symbols are requested to be exported both via dllexport attributes and via the autogenerated def file. This also reduces the number of lines of code marginally. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'accb06120c13a4ead442464d96f2fa318fa07a4e'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'accb06120c13a4ead442464d96f2fa318fa07a4e': configure: Use dllexport/dllimport for data symbols across DLLs with mingw Merged-by: James Almer <jamrial@gmail.com>
| * configure: Use dllexport/dllimport for data symbols across DLLs with mingwMartin Storsjö2017-08-31
| | | | | | | | | | | | | | | | | | | | | | This avoids having to use pseudo relocations. The version script used for exporting functions is skipped as soon as the set of object files contains symbols marked with dllexport, therefore we need to use makedef to produce the full list of symbols to be exported. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0': msvc: Properly specify dllexport for data symbols shared across dll boundaries Merged-by: James Almer <jamrial@gmail.com>
| * msvc: Properly specify dllexport for data symbols shared across dll boundariesMartin Storsjö2017-08-31
| | | | | | | | | | | | | | | | | | We currently only have exported data symbols within libavcodec, but the concept is easy to extend to other libraries if necessary. The attribute declaration needs to be in a private header though, since we can't use CONFIG_SHARED in public installed headers. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec: allow multiple hwaccels for the same codec/pixfmtwm42017-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVHWAccels are looked up using a (codec_id, pixfmt) tuple. This means it's impossible to have 2 decoders for the same codec and using the same opaque hardware pixel format. This breaks merging Libav's CUVID hwaccel. FFmpeg has its own CUVID support, but it's a full stream decoder, using NVIDIA's codec parser. The Libav one is a true hwaccel, which is based on the builtin software decoders. Fix this by introducing another field to disambiguate AVHWAccels, and use it for our CUVID decoders. FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS makes this mechanism backwards compatible and optional.
* | Merge commit '94eed68ace9f2416af8457fcbf142b175928c06b'James Almer2017-10-23
|\| | | | | | | | | | | | | * 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-23
| | | | | | | | Deprecated in 10/2014 and 07/2015.
* | Merge commit 'cbebc3251bc2544b469e0dcb176bc04779d8866c'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit 'cbebc3251bc2544b469e0dcb176bc04779d8866c': lavc: Drop deprecated public symbols Merged-by: James Almer <jamrial@gmail.com>
* | avcodec: remove ABI portion of the side data merging APIJames Almer2017-10-22
| | | | | | | | | | | | The actual API is left in place until the deprecation period ends. Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/pthread_slice: add ff_slice_thread_execute_with_mainfunc()Ilia Valiakhmetov2017-09-08
| | | | | | | | | | Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | avcodec/internal: move FF_QSCALE_TYPE defines from avcodec.hJames Almer2017-09-01
| | | | | | | | | | | | Their use in the public header is deprecated and will be removed, but they are still needed by some codecs at least as long as qscale related deprecated fields in the AVFrame struct remain in the tree.
* | Merge commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5'James Almer2017-05-08
|\| | | | | | | | | | | | | * commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5': lavc: add an option for exporting cropping information to the caller Merged-by: James Almer <jamrial@gmail.com>
| * lavc: add an option for exporting cropping information to the callerAnton Khirnov2017-01-12
| | | | | | | | | | Also, add generic code for handling cropping, so the decoders can export just the cropping size and not bother with the rest.
* | avcodec: Avoid splitting side data repeatedlyMichael Niedermayer2017-05-06
| | | | | | | | | | | | | | | | Fixes Timeout Fixes: 508/clusterfuzz-testcase-6245747678773248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/internal: update FF_CODEC_CAP_SETS_PKT_DTS doxyJames Almer2017-05-01
| | | | | | | | The code it refers to was moved to decode.c in 00fb745a10a151791ce2e49ba3e463bd17ea9251
* | avcodec/pthread_frame, decode: allow errors to happen on drainingMuhammad Faiz2017-04-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So, all frames and errors are correctly reported in order. Also limit the numbers of error during draining to prevent infinite loop. This fix fate failure with THREADS>=4: make fate-h264-attachment-631 THREADS=4 This also reverts a755b725ec1d657609c8bd726ce37e7cf193d03f. Suggested-by: wm4, Ronald S. Bultje, Marton Balint Reviewed-by: w4 <nfxjfg@googlemail.com> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | Merge commit '972c71e9cb63e24f57ee481e413199c7d88a8813'James Almer2017-04-22
|\| | | | | | | | | | | | | * commit '972c71e9cb63e24f57ee481e413199c7d88a8813': lavc: add support for filtering packets before decoding Merged-by: James Almer <jamrial@gmail.com>
| * lavc: add support for filtering packets before decodingAnton Khirnov2016-12-14
| |
* | Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'James Almer2017-04-22
|\| | | | | | | | | | | | | | | | | * commit '061a0c14bb5767bca72e3a7227ca400de439ba09': decode: restructure the core decoding code CUVID decoder adapted by wm4. Merged-by: James Almer <jamrial@gmail.com>
| * decode: restructure the core decoding codeAnton Khirnov2016-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the new decoding API is pretty much just a wrapper around the old deprecated one. This is problematic, since it interferes with making full use of the flexibility added by the new API. The old API should also be removed at some future point. Reorganize the code so that the new send_packet/receive_frame functions call the actual decoding directly and change the old deprecated avcodec_decode_* functions into wrappers around the new API. The new internal API for decoders is now changing as well. Before this commit, it mirrors the public API, so the decoders need to implement send_packet() and receive_frame() callbacks. This turns out to require awkward constructs in both the decoders and the generic code. After this commit, the decoders only implement the receive_frame() callback and call a new internal function, ff_decode_get_packet() to obtain input data, in the same manner to how the bitstream filters now work. avcodec will now always make a reference to the input packet, which means that non-refcounted input packets will be copied. Keeping the previous behaviour, where this copy could sometimes be avoided, would make the code significantly more complex and fragile for only dubious gains, since packets are typically small and everyone who cares about performance should use refcounted packets anyway.
* | Merge commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f'James Almer2017-04-22
|\| | | | | | | | | | | | | | | | | | | * commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f': decode: be more explicit about storing the last packet properties Also copy pkt->size in extract_packet_props(), as it's needed for AVFrame.pkt_size Merged-by: James Almer <jamrial@gmail.com>
| * decode: be more explicit about storing the last packet propertiesAnton Khirnov2016-12-14
| | | | | | | | | | | | | | | | | | | | | | The current code stores a pointer to the packet passed to the decoder, which is then used during get_buffer() for timestamps and side data passthrough. However, since this is a pointer to user data which we do not own, storing it is potentially dangerous. It is also ill defined for the new decoding API with split input/output. Fix this problem by making an explicit internally owned copy of the packet properties.
* | avcodec: estimate output bitrate for uncompressed video codecsTobias Rapp2017-03-17
| | | | | | | | | | | | | | | | | | | | | | Allows to get a more realistic total bitrate (and estimated file size) in avi_write_header. Previously a static default value of 200k was assumed. Adds an internal helper function for bitrate guessing. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/internal: Constify AVPacket* in AVCodecInternal.Carl Eugen Hoyos2017-03-16
| | | | | | | | | | Fixes a gcc warning: libavcodec/utils.c:2244:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
* | Merge commit '89aebc5bcc6e23a0a79c3f51c3a55c3571692ba0'James Almer2017-03-15
|\| | | | | | | | | | | | | * commit '89aebc5bcc6e23a0a79c3f51c3a55c3571692ba0': lavc: align the linesize to 32 when AVX is enabled Merged-by: James Almer <jamrial@gmail.com>
| * lavc: introduce a new decoding/encoding API with decoupled input/outputwm42016-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the decoding API was restricted to outputting 0 or 1 frames per input packet. It also enforces a somewhat rigid dataflow in general. This new API seeks to relax these restrictions by decoupling input and output. Instead of doing a single call on each decode step, which may consume the packet and may produce output, the new API requires the user to send input first, and then ask for output. For now, there are no codecs supporting this API. The API can work with codecs using the old API, and most code added here is to make them interoperate. The reverse is not possible, although for audio it might. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | aacdec: do not mutate input packet metadatawm42017-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently the demuxer outputs the wrong padding for HE-AAC (based on the raw sample rate, or so). aacdec contains a hack to adjust the muxer padding accordingly before it's used to trim the decoder output. This modified the packet side data, which in combination with the old decoding API would change the packet the user passed to the decoder. This is clearly not allowed, and it breaks running some gapless fate tests with "-fflags +keepside" applied (without keepside, the packet metadata is typically newly allocated, essentially making a copy and not modifying the user's input packet). This should probably be fixed in the demuxer (and consequently also the muxer), but for now only fix the immediate problem. Regression since 946ed78f5f8 (2012).
* | Fix -Werror=parentheses errorThierry Foucu2016-11-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: move subframe warning to libavcodecwm42016-10-01
| | | | | | | | | | | | | | | | | | | | | | With the new decode API, doing this in ffmpeg.c is impractical. There was resistance against removing the warning, so put it into libavcodec. Not bothering with reducing the warning to verbose log level for subsequent wanrings. The warning should be rare, and only happen when developing new codecs for the old API. Includes a change suggested by Michael Niedermayer.
* | libavcodec: factor out SEI generation for A53 captionsAndrey Turkin2016-06-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc: introduce a new decoding/encoding API with decoupled input/outputwm42016-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the decoding API was restricted to outputting 0 or 1 frames per input packet. It also enforces a somewhat rigid dataflow in general. This new API seeks to relax these restrictions by decoupling input and output. Instead of doing a single call on each decode step, which may consume the packet and may produce output, the new API requires the user to send input first, and then ask for output. For now, there are no codecs supporting this API. The API can work with codecs using the old API, and most code added here is to make them interoperate. The reverse is not possible, although for audio it might. From Libav commit 05f66706d182eb0c36af54d72614bf4c33e957a9. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()Michael Niedermayer2016-04-21
| | | | | | | | | | | | With this the use of the caps_internal from libavformat can be avoided Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '34138ece23c8ddae543269212a051c00d49e67d7'Hendrik Leppkes2015-12-18
|\| | | | | | | | | | | | | * commit '34138ece23c8ddae543269212a051c00d49e67d7': log: Use a do {} while (0) for tlog Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * log: Use a do {} while (0) for tlogLuca Barbato2015-12-08
| | | | | | | | Avoid the warning `-Wempty-body`.
* | Merge commit '11c9bd633f635f07a762be1ecd672de55daf4edc'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit '11c9bd633f635f07a762be1ecd672de55daf4edc': libopenh264enc: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libopenh264enc: export CPB props side dataAnton Khirnov2015-12-06
| |
| * log: Use a do {} while (0) for dlogLuca Barbato2015-12-05
| | | | | | | | Avoid the warning `-Wempty-body`.
* | lavc: move exp2fi to ff_exp2fi in internal.hGanesh Ajjanagadde2015-12-16
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avcodec/internal: Fix skiped typoMichael Niedermayer2015-11-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/internal: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAMMatthieu Bouron2015-11-15
| | | | | | | | | | The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame setting.
* | avcodec: rename avpriv_color_frame to ff_color_frameAndreas Cadhalpun2015-10-22
| | | | | | | | | | | | | | It is only used inside libavcodec. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>