summaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: Fix a typo.Carl Eugen Hoyos2016-02-141-1/+1
|
* avcodec: only warn about hwaccel with frame threadsAndreas Cadhalpun2016-02-141-3/+2
| | | | | | | | | | | | | VLC uses hwaccel with frame threads and it works fine, but returning an error here made it fail. This regression was introduced in commit 31741ae. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Warning message text by nevcairiel Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Add AV_PIX_FMT_GBRAP16?E to avcodec_align_dimensions2()Michael Niedermayer2016-02-071-0/+2
| | | | | Found-by: kierank Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Check the return code of av_image_fill_linesizes()Michael Niedermayer2016-02-031-1/+3
| | | | | | Fixes CID1271741 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/utils: fix instanciate/instantiate typoClément Bœsch2016-01-301-1/+1
|
* libavcodec/util: Fix timebase overflow checkDerek Buitenhuis2016-01-271-1/+1
| | | | | | It could accidentally divide by zero if num was zero. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit '7486418683bd2477772e03aab573cf846c12fb0d'Derek Buitenhuis2016-01-271-0/+10
|\ | | | | | | Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavc: Make sure that the effective timebase would not overflowArttu Ylä-Outinen2016-01-191-0/+10
| | | | | | | | | | | | | | In the unlikely situation the user decides to set ticks_per_frame and timebase to a value large enough to overflow. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-6/+6
| | | | | | | | | | | | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/utils: run ff_frame_thread_encoder_init() only for encodersMichael Niedermayer2016-01-251-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Print the whitelists if entities are not found on themMichael Niedermayer2016-01-241-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Check bits_per_raw_sample on video encoder openMichael Niedermayer2016-01-071-0/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef'Hendrik Leppkes2016-01-011-10/+1
|\ \ | |/ | | | | | | | | | | * commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef': lavc: get the profile name through the codec descriptor in avcodec_string() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: get the profile name through the codec descriptor in avcodec_string()Anton Khirnov2015-12-121-11/+1
| |
* | Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-011-0/+15
|\ \ | |/ | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add profiles to AVCodecDescriptorAnton Khirnov2015-12-121-0/+15
| | | | | | | | | | The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
| * lavc: print the name of the codec, not its implementation, in avcodec_stringAnton Khirnov2015-12-121-2/+5
| |
* | avcodec: properly check pkt_timebase for validityHendrik Leppkes2015-12-281-1/+1
| | | | | | | | | | | | Unset/invalid timebases have a zero numerator. This makes the checks consistent with other timebase checks and fixes an integer division by 0.
* | Merge commit '11c9bd633f635f07a762be1ecd672de55daf4edc'Hendrik Leppkes2015-12-171-0/+26
|\ \ | |/ | | | | | | | | | | * commit '11c9bd633f635f07a762be1ecd672de55daf4edc': libopenh264enc: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libopenh264enc: export CPB props side dataAnton Khirnov2015-12-061-0/+26
| |
* | Merge commit 'f0b769c16daafa64720dcba7fa81a9f5255e1d29'Hendrik Leppkes2015-12-171-0/+14
|\ \ | |/ | | | | | | | | | | * commit 'f0b769c16daafa64720dcba7fa81a9f5255e1d29': lavc: add a packet side data type for VBV-like parameters Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add a packet side data type for VBV-like parametersAnton Khirnov2015-12-061-0/+14
| |
* | Merge commit '84adab333cddeefc3cfd843089dee23f58bd372c'Hendrik Leppkes2015-12-171-1/+7
|\ \ | |/ | | | | | | | | | | * commit '84adab333cddeefc3cfd843089dee23f58bd372c': lavc: add stream-global packet side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add stream-global packet side dataAnton Khirnov2015-12-061-1/+8
| | | | | | | | This is similar to what is done for AVStream.
* | lavc/utils: use AVPixFmtDescriptor to probe palette formatsMatthieu Bouron2015-12-151-2/+11
| | | | | | | | | | Also use the input frame format instead of the AVCodecContext one according to the documentation of AVCodecContext.get_buffer2().
* | lavc, lavu: use avutil/thread.h instead of redundant conditional includesClément Bœsch2015-12-071-8/+1
| |
* | avcodec/utils: Fix overflow in get_bit_rates computationsMichael Niedermayer2015-12-051-1/+1
| | | | | | | | | | | | | | Fixes: 129ca3e28d73af7b1e24a9d4118e7a2d/signal_sigabrt_7ffff6ae7cc9_836_762b310fc3ef6087bd7771e5d8e90b9b.asf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Clear dimensions in ff_get_buffer() on failureMichael Niedermayer2015-11-281-1/+3
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: 482d8f2fd17c9f532b586458a33f267c/asan_heap-oob_4a52b6_7417_1d08d477736d66cdadd833d146bb8bae.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()Michael Niedermayer2015-11-281-2/+2
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 3a45b2ae02f2cf12b7bd99543cdcdae5/asan_heap-oob_1dff502_8022_899f75e1e81046ebd7b6c2394a1419f4.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Better check for channels in av_get_audio_frame_duration()Michael Niedermayer2015-11-141-1/+1
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: add ADPCM AICA decoderPaul B Mahol2015-10-291-0/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-271-2/+2
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-271-4/+4
|\ \ | |/ | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-261-4/+4
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* | avcodec: disallow hwaccel with frame threadsHendrik Leppkes2015-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HWAccels with frame threads are fundamentally flawed in avcodecs current design, and there are several known problems ranging from image corruption to driver crashes. These problems come down to two design problems in the interaction of threads and HWAccel decoding: (1) While avcodec prevents parallel decoding and as such simultaneous access to the hardware accelerator from the decoding threads, it cannot account for the user code and its access to the hardware surfaces and the hardware itself. This can result in image corruption or even driver crashes if the user code locks image surfaces while they are being used by the decoder threads as reference frames. The current HWAccel API does not offer any way to ensure exclusive access to the hardware or the surfaces if frame threading is used. (2) Initialization of the HWAccel with frame threads is non-trivial, and many decoders had and still have issues that cause excess calls to the get_format callback. This will potentially cause duplicate HWAccel initialization, which in extreme cases can even lead to driver crashes if the HWAccel is re-initialized while the user code is actively accessing the hardware surfaces associated with it, or lead to image corruption due to lost reference frames. While both of these issues are solvable, fixing (1) would at least require a huge API redesign which would move a lot of complexity into the user code. The only reason the combination of frame threads and HWAccel was considered useful is to allow a seamless fallback to multi-threaded software decoding if the HWAccel is not available, however the issues outlined above far outweigh this. The proper solution for a fallback is to re-open the AVCodecContext with threading enabled if the HWAccel failed, which is a practice commonly used by various user applications using avcodec today already. Reviewed-by: Gwenole Beauchesne <gb.devel@gmail.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | avcodec: add SDX2 DPCM decoderPaul B Mahol2015-10-261-0/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa'Hendrik Leppkes2015-10-221-9/+10
|\ \ | |/ | | | | | | | | | | * commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa': utils: Use data buffers directly instead of an AVPicture Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * utils: Use data buffers directly instead of an AVPictureVittorio Giovara2015-10-221-9/+10
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'a17a7661906ba295d67afd80ac0770422e1b02b3'Hendrik Leppkes2015-10-221-4/+4
|\ \ | |/ | | | | | | | | | | * commit 'a17a7661906ba295d67afd80ac0770422e1b02b3': lavc: Add data and linesize to AVSubtitleRect Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Add data and linesize to AVSubtitleRectVittorio Giovara2015-10-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Use the new fields directly instead of the ones from AVPicture. This removes a layer of indirection which serves no pratical purpose whatsoever, and will help in removing AVPicture structure completely later. Every subtitle encoder/decoder seamlessly points to the new arrays, so it is possible to deprecate AVSubtitleRect.pict. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * avcodec: Do not lock during init if there is no init functionDerek Buitenhuis2015-10-131-2/+2
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * avcodec: Do not lock during open for codecs marked as having threadsafe initDerek Buitenhuis2015-10-041-17/+21
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec: rename avpriv_color_frame to ff_color_frameAndreas Cadhalpun2015-10-221-1/+1
| | | | | | | | | | | | | | It is only used inside libavcodec. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec: add ADPCM PSX decoderPaul B Mahol2015-10-161-0/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec: Don't lock on init for codecs without an init functionDerek Buitenhuis2015-10-121-2/+2
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec: remove leftover iff_byterun1 decoderAndreas Cadhalpun2015-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | It was merged with the iff_ilbm decoder in commit 929a24efff9a208a52748605eb412ffb915c1403. Define AV_CODEC_ID_IFF_BYTERUN1 as AV_CODEC_ID_IFF_ILBM for API compatibility. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec: Don't lock during open if the codec has threadsafe initDerek Buitenhuis2015-10-021-7/+12
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit 'a5d58fea68b9212e0065a71939e921505504a9bb'Hendrik Leppkes2015-09-291-20/+0
|\ \ | |/ | | | | | | | | | | * commit 'a5d58fea68b9212e0065a71939e921505504a9bb': lavc: reimplement avcodec_get_type() using codec descriptors Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: reimplement avcodec_get_type() using codec descriptorswm42015-09-281-14/+0
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | lavc/utils: Correctly show bit_rate >INT_MAX.Carl Eugen Hoyos2015-09-151-4/+4
| | | | | | | | Fixes ticket #2089.
OpenPOWER on IntegriCloud