summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
...
* lavc: fix and extend AVCodecContext.get_format doxyAnton Khirnov2021-06-26
| | | | | | | Remove some incorrect (or at least misleading) statements, such as the formats being ordered by quality, or the first format being the native one. Neither of those are true for hardware acceleration, which is the main use of this callback.
* avcodec/libx264: Separate headers not supported in AVC-Intra modeLimin Wang2021-06-25
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/libx264: Add support for Sony XAVC Class 300 and 480Limin Wang2021-06-25
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: Pass HDR10+ metadata to packet side data in VP9 encoderMohammad Izadi2021-06-24
| | | | | | | | | | | | | HDR10+ metadata is stored in the bit stream for HEVC. The story is different for VP9 and cannot store the metadata in the bit stream. HDR10+ should be passed to packet side data an stored in the container (mkv) for VP9. This CL is taking HDR10+ from AVFrame side data in libvpxenc and is passing it to the AVPacket side data. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/crystalhd: signal that the decoder sets all output frame propertiesJames Almer2021-06-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: signal that the decoder sets all output frame propertiesJames Almer2021-06-21
| | | | | | Fixes memleaks described in ticket #9082. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: remove unused AVCodec.decode() callbackJames Almer2021-06-21
| | | | | | The AVCodec.receive_frame() callback takes precedence. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: reindent after the previous commitJames Almer2021-06-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: add an internal codec flag to signal a decoder sets all ↵James Almer2021-06-21
| | | | | | | | | | 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>
* avcodec/decode: fetch packets from the pkt_props FIFO on every frame returnedJames Almer2021-06-21
| | | | | | | Fixes memleaks on decoders that don't call ff_decode_frame_props(), like libdav1d. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_sei: Use get_bits_long() for time_offset_valueMichael Niedermayer2021-06-20
| | | | | | | | Fixes: assertion failure Fixes: crash_1 Found-by: Thuan Pham <tpham.unimelb@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/qsvdec: fix ptsHaihao Xiang2021-06-20
| | | | | | | | | | | | | | | | | The time base used for compressed bitstream and video frame in the SDK is { 1, 90000 }. [1][2] This can avoid the error message below from the muxer. $> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -f null - ... [null @ 0x561c24f6f2f0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2 >= 2 [1]https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxbitstream [2]https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxframedata Signed-off-by: Zhong Li <zhongli_dev@126.com>
* avcodec/ccaption_dec: Make real-time latency configurablePavel Koshevoy2021-06-18
| | | | | | | | | | | Un-hardcode the 200ms minimum latency between emitting subtitle events so that those that wish to receive a subtitle event for every screen change could do so. The problem with delaying realtime output by any amount is that it is unknown when the next byte pair that would trigger output will happen. It may be within 200ms, or it may be several seconds later -- that's not realtime at all.
* avcodec/iff: Only write palette to plane 1 if its PAL8Michael Niedermayer2021-06-18
| | | | | | | | Fixes: null pointer passed as argument 1, which is declared to never be null Fixes: 33791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5107575256383488.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libvpxenc: Show encoder config as a warning in case of failed ↵Matthieu Patou2021-06-14
| | | | | | initialization Suggested-By: ffmpeg@fb.com
* lavc/libaomenc: Show encoder config as a warning in case of failed ↵Matthieu Patou2021-06-14
| | | | | | initialization Suggested-By: ffmpeg@fb.com
* lavc/videotoolboxenc.c: Fix preprocessor macro for OSX 10.10.5 and probably ↵Thilo Borgmann2021-06-14
| | | | older versions
* avcodec/faxcompr: Check available bits in decode_uncompressed()Michael Niedermayer2021-06-12
| | | | | | | | | Fixes: Timeout Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112 Fixes: 34966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4587409334468608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Check if bits are available before reading in cmode == 9 ↵Michael Niedermayer2021-06-12
| | | | | | | | | | || cmode == 10 Fixes: Timeout Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: do "calc from frame_bytes, channels, and block_align" in 64bitMichael Niedermayer2021-06-12
| | | | | | | | Fixes: signed integer overflow: 104962766 * 32 cannot be represented in type 'int' Fixes: 33614/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6252129036664832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ttadata: Add sentinel at the end of ff_tta_shift_1Michael Niedermayer2021-06-12
| | | | | | | | Fixes: out of array access Fixes: 34933/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5629322560929792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cuviddec: correctly set key_frame with interlaced contentstuhlo2021-06-11
| | | | | | | | | | | Fixes #9283 This fixes setting of 'key_frame' flag in AVFrame when input h264 packets represents individual fields of interlaced video. In this case, pairs of two consecutive fields represents a single decoded picture and have identical 'CurrPicIdx', however, only the first field is entirely intra-coded and has the flag 'intra_pic_flag' set and the second field was resetting the flag before it was even read in the function 'cuvid_output_frame'. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* lavc/get_bits: avoid avcodec.h dependencyAnton Khirnov2021-06-10
| | | | Include only defs.h, needed for AV_INPUT_BUFFER_PADDING_SIZE.
* lavc/hevc_sei: include buffer.h explicitlyAnton Khirnov2021-06-10
| | | | Do not rely on including it indirectly through get_bits.h->avcodec.h
* lavc/mlp_parse: add required includes explicitlyAnton Khirnov2021-06-10
|
* lavc/dolby_e_parser: #include avcodec.h explicitlyAnton Khirnov2021-06-10
| | | | | This file uses definitions from it, but relies on an indirect include through get_bits.h
* lavc/cbs_internal: clean up headersAnton Khirnov2021-06-10
| | | | Include all required headers explicitly, avoid avcodec.h dependency.
* lavc/cbs: avoid avcodec.h dependencyAnton Khirnov2021-06-10
| | | | Include only the headers that are actually needed.
* lavc/cbs_bsf.h: explicitly #include all required headersAnton Khirnov2021-06-10
|
* lavc: move av_get_profile_name() from avcodec.h to codec.hAnton Khirnov2021-06-10
|
* lavc: move av_get_audio_frame_duration2() from avcodec.h to codec_par.hAnton Khirnov2021-06-10
|
* lavc: move av_get_pcm_codec() from avcodec.h to codec_id.hAnton Khirnov2021-06-10
|
* lavc: move avcodec_profile_name() from avcodec.h to codec_id.hAnton Khirnov2021-06-10
|
* lavc: move av_get_[exact_]bits_per_sample() to codec_id.hAnton Khirnov2021-06-10
|
* lavc: move small misc definitions into a separate headerAnton Khirnov2021-06-10
| | | | This will allow to avoid #including the entire avcodec.h in some places.
* avcodec/dpx: fix off by 1 in bits_per_color checkMichael Niedermayer2021-06-08
| | | | | | | Fixes: CID1476303 Bad bit shift operation Fixes: 34871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-6331163028357120 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc2enc: Check for non negative slice boundsMichael Niedermayer2021-06-08
| | | | | | | Fixes: invalid shifts Fixes: Ticket 8221 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/avcodec: Don't free options on failure in avcodec_open2()Andreas Rheinhardt2021-06-08
| | | | | | | | | | Instead return the dictionary in the state it is at the time the error occurred. This is more in line with the description of this parameter and allows to notify the user of unrecognized options if an error happens lateron (which might very well be due to e.g. misspelled options). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Avoid redundant copies of options in avcodec_open2Andreas Rheinhardt2021-06-08
| | | | | | | It is no longer necessary now that ff_frame_thread_encoder_init() no longer receives an options dictionary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Remove redundant memcpyAndreas Rheinhardt2021-06-08
| | | | | | | | | | In case the underlying AVCodec has no private class, the private data of both the main as well as each worker AVCodecContext is just zeroed (the codec's init function has not been called on any of them and without a private class there is no way to legitimately set anything before the aforementioned init function). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Avoid dictionariesAndreas Rheinhardt2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | avcodec_open2() allows to provide options via an AVDictionary; but it is also allowed to set options by simply setting the value of the AVCodecContext or via the AVOptions API if the codec has a private class. Any options provided via an AVDictionary have already been applied before ff_frame_thread_init(), so in order to copy all the options from the main AVCodecContext and its private context, it is enough to av_opt_copy() these options. The current code does this, but it does more: It also copies the user-provided AVDictionary and uses it for the initialization of each of the worker-AVCodecContexts. This is completely unnecessary, because said options have already been copied from the main context. Furthermore, these options were also examined to decide if frame threading should be used for huffman encoding in case this would incur nondeterminism. This is wrong, because options not set via an AVDictionary are ignored. Instead inspect the values stored in the contexts directly. (In order to maintain the current behaviour, the default value of the "non_deterministic" option has been changed to false, because the absence of an entry with said key in the AVDictionary had the consequence of disallowing nondeterminism.) Finally, the AVDictionary has been removed from the signature of ff_frame_thread_encoder_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()Andreas Rheinhardt2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avcodec/internal: Remove outdated documentation of ff_alloc_packet2()Andreas Rheinhardt2021-06-08
| | | | | | | Its documentation described the way user-supplied buffers worked before 93016f5d1d280f9cb7856883af287fa66affc04c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/omx: Zero packet paddingAndreas Rheinhardt2021-06-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/omx: ReindentationAndreas Rheinhardt2021-06-08
| | | | | | | Also combine two if blocks that check for the same condition and don't check had_partial if we already have a complete packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/omx: Remove remnants of old preallocated buffersAndreas Rheinhardt2021-06-08
| | | | | | | | | There are no preallocated buffer packets any more; this feature only worked with the old encode API and only until said API was turned into a wrapper for the new API in 93016f5d1d280f9cb7856883af287fa66affc04c. So remove its remnants. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dvenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-06-08
| | | | | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; this also makes it easy to allow user-supplied buffers. Only one thing needed to be changed: The earlier code relied on the buffer having been initially zeroed by av_fast_padded_malloc(), so one now needs to zero the packet at first. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/nvenc: add option to disable all extra SEI dataTimo Rothenpieler2021-06-06
| | | | | | | | | | | With these triggering a lot of crashes recently, an option to globally disable all of them is added as a tool to work around those crashes in case the SEI data is not needed by the user. Also re-enables s12m for hevc_nvenc, since the issue is not specifically with that, but it affects all SEI data. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: extract sei data prep into own functionTimo Rothenpieler2021-06-04
|
* avcodec/nvenc: write out user data unregistered SEIBrad Hards2021-06-04
| | | | | Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>