summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Require compilers to support C11.c11Anton Khirnov2024-02-09
| | | | | | | | | It should be available in all relevant modern compilers and will allow us to use features like anonymous unions. Note that stdatomic.h is still emulated on MSVC, as current versions require the /experimental:c11atomics, and do not support ATOMIC_VAR_INIT() anyway.
* lavc/refstruct: do not use max_align_t on MSVCJames Almer2024-02-09
| | | | | | It is not available there, even when C11/17 is requested. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: deprecate avcodec_close()Anton Khirnov2024-02-09
| | | | | Its use has been discouraged since 2016, but now is no longer used in avformat, so there is no reason to keep it public.
* lavf/demux: stop calling avcodec_close()Anton Khirnov2024-02-09
| | | | | | Replace it with recreating the codec context. This is the last remaining blocker for deprecating avcodec_close().
* lavf/flacdec: stop accessing FFStream.avctxAnton Khirnov2024-02-09
| | | | | | | The demuxer opens an internal parser instance in read_timestamp(), which requires a codec context. There is no need for it to access the FFStream one which is used for other purposes, it can allocate its own internal one.
* lavf/mpegts: drop a cargo-culted checkAnton Khirnov2024-02-09
| | | | | | This check has survived the transition to AVCodecParameters, but is no longer relevant after it, since the codec context is no longer updated or accessed at all from the demuxer.
* fftools/ffmpeg_demux: set stream index right before sending packet to schedulerAnton Khirnov2024-02-09
| | | | | This avoids assuming that it survives unchanged through bitstream filters, if present.
* fftools/cmdutils: Don't cast const awayAndreas Rheinhardt2024-02-09
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rcwtenc: Pass RCWTContext directly in rcwt_init_cluster()Andreas Rheinhardt2024-02-09
| | | | | | | It does not use the AVFormatContext at all. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rcwtenc: Remove redundant zeroing of bufferAndreas Rheinhardt2024-02-09
| | | | | | | | Resetting the counter of used elements is enough as nothing is ever read from the currently unused elements. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rcwtenc: Fix potential out-of-bounds writeAndreas Rheinhardt2024-02-09
| | | | | | | | | | | | | | | | | | The rcwt muxer uses several counters for how much data it has already cached: One byte counter and one counter for how many complete blocks (of three bytes each). These counters can become inconsistent when the muxer is fed incomplete blocks as the muxer presumes that it is about to write a new block at the start of each write_packet call. E.g. sending 65535*3+1 1-byte packets (with data[0] e.g. 0x03) will trigger an out-of-bounds write. This patch fixes this by processing the data in complete blocks only. This also allows to simplify the code, e.g. to remove one of the counters. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Remove AVCodec.pix_fmts arraysAndreas Rheinhardt2024-02-09
| | | | | | | | | | They are not intended for decoders (for which there is the get_format callback in case the user has a choice). Also note that the list was wrong for MPEG4, because it did not contain the high bit depth pixel formats used for studio profiles. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1dec: Remove AVCodec.pix_fmts arraysAndreas Rheinhardt2024-02-09
| | | | | | | They are not intended for decoders (for which there is the get_format callback in case the user has a choice). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1dec: Don't call ff_get_format() twiceAndreas Rheinhardt2024-02-09
| | | | | | | | | | | It is currently called once in the codecs' init function and once when (re)initializing the VC-1 decode context (which happens upon frame size changes as well as before decoding the first frame). The first one is unnecessary now that vc1_decode_frame() no longer requires avctx->hwaccel to be already set for hwaccel to work properly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1dec: Set pointers for hwaccel even without hwaccelAndreas Rheinhardt2024-02-09
| | | | | | | | | | | | | | | | | | | | VC-1 uses a 0x03 escaping scheme like H.26x and our decoder unescapes data for this purpose, but hardware accelerations just want the data as-is and therefore get fed the original data. The pointers to the actual data are only setcorrectly if avctx->hwaccel is set (after all, they are only used in this case). There are two problems with this: The first is that the branch is pointless; the second is that it is harmful, because a hardware acceleration may be added after the packet has been parsed (in case there is a reconfiguration e.g. due to frame size changes) in which case decoding the first few frames won't work. So delete these branches. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mmaldec: Avoid using AVCodec.pix_fmtsAndreas Rheinhardt2024-02-09
| | | | | | | | It is entirely unnecessary to use it given that all decoders here share the same set of supported pixel formats. So just hardcode this list. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Remove redundant pix_fmts from decodersAndreas Rheinhardt2024-02-09
| | | | | | | | | | | | | | | AVCodec.pix_fmts is only intended for encoders (decoders use the get_format callback to let the user choose a pix fmt). So remove them for the decoders for which this is possible without further complications; keep them for now in the codecs that actually use them (by passing avctx->codec->pix_fmts to ff_get_formatt()). Also notice that some of these lists were wrong; e.g. 317b7b06fd97cd39feac7df57db22a30550351ff added support for YUV444P16 for cuviddec, but forgot to add it to pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fate/video: add DXV3 HQ testsConnor Worley2024-02-08
| | | | Signed-off-by: Connor Worley <connorbworley@gmail.com>
* fate/video: add DXV3 DXT1 encoding testConnor Worley2024-02-08
| | | | Signed-off-by: Connor Worley <connorbworley@gmail.com>
* lavc/dxv: fix incorrect back-reference index calculation in DXT5 decodingConnor Worley2024-02-08
| | | | | | | | | This bug causes the DXT5 decoder to produce incorrect block texture data. After the fix, textures are visually correct and match data decoded by Resolume Alley (extracted with Nvida Nsight for comparison). Current FATE DXT5 samples did not cover this case. Signed-off-by: Connor Worley <connorbworley@gmail.com>
* lavc/dxv: treat DXT5-tagged files as DXT4Connor Worley2024-02-08
| | | | | | | | | | | DXV files seem to misnomer DXT5 and really encode DXT4 with premultiplied alpha. At least, this is what Resolume alley does. To check, encode some input with alpha as "Normal Quality, With Alpha" in Alley, then decode the output with this change -- results are true to the original input compared to git-master. Signed-off-by: Connor Worley <connorbworley@gmail.com>
* lavc/texturedsp: fix premult2straight inversionConnor Worley2024-02-08
| | | | | | This function should convert premultiplied alpha to straight, but does the opposite. Signed-off-by: Connor Worley <connorbworley@gmail.com>
* avfilter/fifo: Remove (a)fifo filtersAndreas Rheinhardt2024-02-08
| | | | | | Obsolete since 4ca1fb9d2a91757c8c4c34dd456abf340e3f765f. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/nvdec: Constify bitstream pointeeAndreas Rheinhardt2024-02-08
| | | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/qsvenc: Add workaround for VP9 keyframeHaihao Xiang2024-02-08
| | | | | | | | | The runtime doesn't set the frame type to MFX_FRAMETYPE_IDR on the returned mfx bitstream for a keyframe, it set the frame type to MFX_FRAMETYPE_I only. This patch added workaround for VP9 keyframe to make the coded stream seekable. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/dxva2: fix different 'const' qualifiers warningTong Wu2024-02-08
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/d3d12va_decode: fix different 'const' qualifiers warningTong Wu2024-02-08
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/d3d12va_vc1: add support for D3D12_VIDEO_DECODE_PROFILE_VC1_D2010 guid.Aleksoid2024-02-08
| | | | | | | | | | | | | | | | | | The VC1_D2010 profile, also known as VC1_VLD2010, has the same functionality and specification as the VC1_D profile. Support for this profile serves only as a positive indication that the accelerator has been designed with awareness of the modifications specified in the August 2010 version of this specification. Hardware accelerator drivers that expose support for this profile must not also expose the previously specified VC1_D GUID, unless the accelerator works properly with existing software decoders that use VC1_D and that do not incorporate the corrections added to the August 2010 version of this specification. As a result, we could give VC1_VLD2010 a higher priority and initialize it first. Signed-off-by: Aleksoid <Aleksoid1978@mail.ru> Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/x86/vvc/vvcdsp_init: fix unresolved external symbol on ARCH_X86_32Wu Jianhua2024-02-07
| | | | Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
* avcodec/nvdec: don't free NVDECContext->bitstreamJames Almer2024-02-07
| | | | | | | | | | Ensure all hwaccels that allocate a buffer use NVDECContext->bitstream_internal instead. Otherwise, if FFHWAccel->end_frame() isn't called before FFHWAccel->uninit(), an attempt to free a stale pointer to memory not owned by the hwaccel could take place. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* x86/tx_float: enable SIMD for sizes over 131072Lynne2024-02-07
| | | | | | The tables for the new sizes were added last year due to being required for SDR. However, the assembly was never updated to use them.
* avdevice/caca: Allow to list multiple dither option types at onceAndreas Rheinhardt2024-02-07
| | | | | | | | | This can be achieved by using AV_OPT_TYPE_FLAGS instead of AV_OPT_TYPE_STRING. It also avoids strcmp() when accessing the option. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/opt: Fix AV_OPT_TYPE_CONST default valueAndreas Rheinhardt2024-02-07
| | | | | | | | | | | | | | | It uses the int64_t instead of the double member. (This code can currently not be reached: av_opt_get() calls av_opt_find2() with NULL as unit in which case AV_OPT_TYPE_CONST options are never returned, leading av_opt_get() to always return AVERROR_OPTION_NOT_FOUND when searching for AV_OPT_TYPE_CONST*. For the same reason the code read_number() will never be called from get_number() when searching for an option of type AV_OPT_TYPE_CONST. The other callers of read_number() also only call it with types other than AV_OPT_TYPE_CONST.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/nutenc: Fix indentationAndreas Rheinhardt2024-02-07
| | | | | | | Forgotten after 82beb46e65e5f820b187355bf757725c22a59c45. Also use loop-scope for iterators while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/ccfifo: Improve included headersAndreas Rheinhardt2024-02-07
| | | | | | | We don't need to include fifo.h, because we don't need AVFifo as a complete type. Also add the other used headers directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/ccfifo: Inline trivial functionsAndreas Rheinhardt2024-02-07
| | | | | | | | | Besides being extremly simple this also avoids including ff_ccfifo_ccdetected() unnecessarily (it is only used by decklink). This is possible because this is not avpriv, but duplicated into lavd if necessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Don't allocate priv_pts separatelyAndreas Rheinhardt2024-02-07
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Avoid av_strdup(NULL)Andreas Rheinhardt2024-02-07
| | | | | | | It is not documented to be safe. Also copy these lists in a more generic manner. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/options: Only allocate AVCodecContext for demuxersAndreas Rheinhardt2024-02-07
| | | | | | | | | | | The muxer's AVCodecContext is currently used for exactly one thing: To store a time base in it that has been derived via heuristics in avformat_transfer_internal_stream_timing_info(); said time base can then be read back via av_stream_get_codec_timebase(). But one does not need a whole AVCodecContext for that, a simple AVRational is enough. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Remove obsolete commentAndreas Rheinhardt2024-02-07
| | | | | | | Forgotten in 3f991325b5ef472cf51b7d8433a2380bef2c94ff, obsolete since 3749eede66c3774799766b1f246afae8a6ffc9bb. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Remove dead check, write-only assignmentAndreas Rheinhardt2024-02-07
| | | | | | | | | | | | | For muxers, the internal AVCodecContext is basically unused except in avformat_transfer_internal_stream_timing_info() (which sets time_base and ticks_per_frame) and av_stream_get_codec_timebase() (a getter for time_base). This makes ticks_per_frame write-only, so don't set it. Also remove an always-false check for the AVCodecContext's codec_tag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* doc/formats: clarify meaning of igndts as per definition in avformat.hMarth642024-02-07
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* lavc/vvc: Validate alf_list indexesFrank Plowman2024-02-06
| | | | Signed-off-by: Frank Plowman <post@frankplowman.com>
* avcodec/libaomdec: print libaomdec version in verbose levelJames Almer2024-02-06
| | | | | | | info level will be too noisy if several instances of the decoder are fired at the same time, as will be the case with tiled AVIF. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libdav1d: print libdav1d version in verbose levelJames Almer2024-02-06
| | | | | | | info level will be too noisy if several instances of the decoder are fired at the same time, as will be the case with tiled AVIF. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/vvc: Fix slice_idx out-of-bounds memsetFrank Plowman2024-02-06
| | | | | | | | | | | | | | | | If the number of CTUs reduces between one picture and the next, the slice_idx table is reduced in size in the frame_context_for_each_tl call on vvcdec.c:321. When initialising the slice_idx table on vvcdec.c:325, the old code uses fc->tab.sz.ctu_count when calculating the table size. fc->tab.sz.ctu_count holds the old ctu count at this point however, not being updated to hold the new ctu count until vvcdec.c:342. This causes an out-of-bounds write. Patch fixes the problem by using pps->ctb_count, which was just used when allocating the table, in place of fc->tab.sz.ctu_count when initialising the table. Signed-off-by: Frank Plowman <post@frankplowman.com>
* avfilter/vsrc_testsrc: switch to YUV colorspace negotiation APINiklas Haas2024-02-06
| | | | | | Instead of overriding the frame properties in fill_picture(), advertise the supported YUV colorspace and range at format negotiation time. (The correct metadata will now be set automatically by ff_get_video_buffer)
* avfilter: pass link YUV colorspace to ff_draw_init2Niklas Haas2024-02-06
| | | | | | | | | | | | | This makes all ff_draw_* based filters aware of YUV colorspaces and ranges. Needed for YUVJ removal. Also fixes a bug where e.g. vf_pad would generate a limited range background even after conversion to full-scale grayscale. The FATE changes were a consequence of the aforementioned bugfix - the gray scale files are output as full range (due to conversion by libswscale, which hard-codes gray = full), and appropriately tagged as such, but before this change the padded version incorrectly used a limited range (16) black background for these formats.
* .mailmap: update my mailmap entryCosmin Stejerean2024-02-06
|
* avcodec/libjxlenc: support negative linesizesLeo Izen2024-02-05
| | | | | | | | | | libjxl doesn't support negative strides, but JPEG XL has an orientation flag inside the codestream. We can use this to work around the library limitation, by taking the absolute value of the negative row stride, sending the image up-side-down, and telling the library that the image has a vertical-flip orientation. Signed-off-by: Leo Izen <leo.izen@gmail.com>