Commit Graph

113197 Commits

Author SHA1 Message Date
Marth64 de9fe17a1f doc/codecs: fix missing guidance in channel_layout item and remove decomissioned request_channel_layout
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-01-04 01:08:34 +01:00
Marth64 6442d1ddd6 doc/faq: replace non-breaking spaces (0xA0) with normal space
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-01-04 01:07:10 +01:00
Marth64 f7fa760b39 doc/faq: fix scaling question typo
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-01-04 01:07:02 +01:00
Stefano Sabatini 59686eaf33 lavfi/drawtext: fix missed rename of is_newline
Fix fallout introduced in 732fb122e6, fix compilation with
--enable-libfribidi.
2024-01-03 16:49:16 +01:00
Nuo Mi 301ed950d1 vvcdec: add vvc decoder
vvc decoder plug-in to avcodec.
split frames into slices/tiles and send them to vvc_thread for further decoding
reorder and wait for the frame decoding to be done and output the frame

Features:
    + Support I, P, B frames
    + Support 8/10/12 bits, chroma 400, 420, 422, and 444 and range extension
    + Support VVC new tools like MIP, CCLM, AFFINE, GPM, DMVR, PROF, BDOF, LMCS, ALF
    + 295 conformace clips passed
    - Not support RPR, IBC, PALETTE, and other minor features yet

Performance:
    C code FPS on an i7-12700K (x86):
        BQTerrace_1920x1080_60_10_420_22_RA.vvc      93.0
        Chimera_8bit_1080P_1000_frames.vvc          184.3
        NovosobornayaSquare_1920x1080.bin           191.3
        RitualDance_1920x1080_60_10_420_32_LD.266   150.7
        RitualDance_1920x1080_60_10_420_37_RA.266   170.0
        Tango2_3840x2160_60_10_420_27_LD.266         33.7

    C code FPS on a M1 Mac Pro (ARM):
        BQTerrace_1920x1080_60_10_420_22_RA.vvc     58.7
        Chimera_8bit_1080P_1000_frames.vvc          153.3
        NovosobornayaSquare_1920x1080.bin           150.3
        RitualDance_1920x1080_60_10_420_32_LD.266   105.0
        RitualDance_1920x1080_60_10_420_37_RA.266   133.0
        Tango2_3840x2160_60_10_420_27_LD.266        21.7

    Asm optimizations still working in progress. please check
    https://github.com/ffvvc/FFmpeg/wiki#performance-data for the latest

Contributors (based on code merge order):
    Nuo Mi <nuomi2021@gmail.com>
    Xu Mu <toxumu@outlook.com>
    Frank Plowman <post@frankplowman.com>
    Shaun Loo <shaunloo10@gmail.com>
    Wu Jianhua <toqsxw@outlook.com>

Thank you for reporting issues and providing performance reports:
    Łukasz Czech <lukaszcz18@wp.pl>
    Xu Fulong <839789740@qq.com>

Thank you for providing review comments:
    Ronald S. Bultje <rsbultje@gmail.com>
    James Almer <jamrial@gmail.com>
    Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi e7ef457d6b vvcdec: add CTU thread logical
This is the main entry point for the CTU (Coding Tree Unit) decoder.
The code will divide the CTU decoder into several stages.
It will check the stage dependencies and run the stage decoder.

Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi 07f75d5e02 vvcdec: add CTU parser
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi b49575f4cf vvcdec: add dsp init and inv transform
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi 02c1455b44 vvcdec: add LMCS, Deblocking, SAO, and ALF filters
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi c05ba94ce8 vvcdec: add intra prediction
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Nuo Mi 2592cc1f96 vvcdec: add inv transform 1d
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:11 +08:00
Nuo Mi ea49c83bad vvcdec: add inter prediction
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:11 +08:00
Nuo Mi 603d0bd171 vvcdec: add motion vector decoder
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:11 +08:00
Nuo Mi c1a3d17491 vvcdec: add reference management
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:11 +08:00
Nuo Mi 976d3b7d69 vvcdec: add cabac decoder
add Context-based Adaptive Binary Arithmetic Coding (CABAC) decoder

Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:06 +08:00
Nuo Mi e97a5bbb13 vvcdec: add parameter parser for sps, pps, ph, sh
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 16:31:59 +08:00
Nuo Mi 49db9fc171 vvcdec: add vvc_data
Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 16:31:59 +08:00
Stefano Sabatini 43042931fb doc/filters/drawtext: apply second level of escaping on colon
Fix escaping on example.
2024-01-02 22:04:06 +01:00
Stefano Sabatini 4d301be9e5 doc/filters/setpts: add random jitter generation example 2024-01-01 20:12:53 +01:00
Stefano Sabatini 7769afcab4 lavu/eval: add randomi function to compute random value in interval 2024-01-01 20:12:52 +01:00
Stefano Sabatini 933c7ff0b9 lavfi/setpts: use macro to access variables array 2024-01-01 20:12:52 +01:00
Stefano Sabatini 030e140145 lavfi: add quirc filter 2024-01-01 20:12:52 +01:00
Stefano Sabatini 899302bb5f lavfi: add qrencode source and filter 2024-01-01 20:12:52 +01:00
Stefano Sabatini 732fb122e6 lavfi: introduce textutils
Generalize drawtext utilities to make them usable in other filters.
This will be needed to introduce the QR code source and filter without
duplicating functionality.
2024-01-01 20:12:52 +01:00
Stefano Sabatini c2ab41b7e0 lavfi/overlay: factorize definition of planar and packed blending functions 2024-01-01 20:12:52 +01:00
James Almer 85b8d59ec7 avcodec/d3d12va_mpeg2: change the type for the ID3D12Resource_Map input data argument
Fixes -Wincompatible-pointer-types warnings.

Reviewed-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-01 09:46:41 -03:00
James Almer e9722735fa avcodec/d3d12va_mpeg2: remove unused variables
Reviewed-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-01 09:46:06 -03:00
Gyan Doshi e1c1dc8347 configure: correct lensfun header function check
The function lf_db_new was deprecated in lensfun 09dcd3e7ad in 2017
in favour of lf_db_create. The AVfilter was adjusted in 8b78eb312d
but the configure check wasn't changed.

lensfun removed lf_db_new declaration in lf 35c0017593 so configure
fails to find lensfun.
2024-01-01 15:31:36 +05:30
Lynne b95ee2ec5f configure: update copyright year 2024-01-01 00:58:30 +01:00
Niklas Haas 44a33fccd8 avfilter/vf_format: allow empty pix_fmts list
Which will impose no restriction. This makes sense when using e.g.
`color_ranges=pc` to limit the color range, without also limiting the
pixel format.
2023-12-31 13:36:22 -08:00
Niklas Haas 796669d483 avfilter/vf_format: add color_ranges/spaces
Needed for fftools/ffmpeg_filter to be able to force specific output
formats via the filter chain.
2023-12-31 13:36:22 -08:00
Niklas Haas 2a942b4b3a avfilter/vf_format: re-use AVFilterFormats for pix_fmt parsing
Rewrite the format parsing code to make it more easily generalizable. In
particular, `invert_formats` does not depend on the type of format list
passed to it, which allows me to re-use this helper in an upcoming
commit.

Slightly shortens the code, at the sole cost of doing several malloc
(ff_add_format) instead of a single malloc.
2023-12-31 13:36:22 -08:00
Niklas Haas 475a99628d avfilter/buffersink: add color space/range accessors
Needed for fftools.
2023-12-31 13:36:12 -08:00
Niklas Haas e82277b548 avfilter/vf_libplacebo: switch to colorspace negotiation API 2023-12-31 13:35:35 -08:00
Niklas Haas ff506b8d8f avfilter/vf_libplacebo: don't force dovi frames to bt.2020-ncl
This is at odds with the YUV matrix negotiation API, in which such
dynamic changes in YUV encoding are no longer easily possible. There is
also no really strong motivating reason to do this, since the choice of
YUV matrix is essentially arbitrary and not actually related to the
Dolby Vision decoding process.
2023-12-31 13:35:35 -08:00
Niklas Haas 2ebcbe97fc avfilter/vf_zscale: switch to colorspace negotiation API
Following the same design as vf_scale.
2023-12-31 13:35:35 -08:00
Niklas Haas 3f2c49acfb avfilter/vf_zscale: remove unused variables
Only assigned, never read.
2023-12-31 13:35:35 -08:00
Niklas Haas 45e09a3041 vf_scale: use colorspace negotiation API
This filter will always accept any input format, even if the user sets
a specific in_range/in_color_matrix. This is to preserve status quo with
current behavior, where passing a specific in_color_matrix merely
overrides the incoming frames' attributes. (Use `vf_format` to force
a specific input range)

Because changing colorspace and color_range now requires reconfiguring
the link, we can lift sws_setColorspaceDetails out of scale_frame and
into config_props. (This will also get re-called if the input frame
properties change)
2023-12-31 13:35:35 -08:00
Niklas Haas 9613ba95c1 fftools/ffmpeg_filter: configure buffersrc with csp/range
Propagates input metadata to the input filter graph.
2023-12-31 13:35:35 -08:00
Niklas Haas 2d555dc82d avfilter/buffersrc: add color_space/range parameters
To allow adding proper negotiation, in particular, to fftools.

These values will simply be negotiated downstream for YUV formats, and
ignored otherwise.
2023-12-31 13:35:17 -08:00
Niklas Haas 9d0f361f7f fftools/ffmpeg_filter: don't clear buffersrc params
This memset is bogus, it accomplishes nothing in the best case and
regresses future additions to AVBufferSrcParameters in the worst case.
2023-12-31 13:35:17 -08:00
Niklas Haas 8c7934f73a avfilter: add negotiation API for color space/range
Motivated by YUVJ removal. This change will allow full negotiation
between color ranges and matrices as needed. By default, all ranges and
matrices are marked as supported.

Because grayscale formats are currently handled very inconsistently (and
in particular, assumed as forced full-range by swscale), we exclude them
from negotiation altogether for the time being, to get this API merged.

After filter negotiation is available, we can relax the
grayscale-is-forced-jpeg restriction again, when it will be more
feasible to do so without breaking a million test cases.

Note that this commit updates one FATE test as a consequence of the
sanity fallback for non-YUV formats. In particular, the test case now
writes rgb24(pc, gbr/unspecified/unspecified) to the matroska file,
instead of rgb24(unspecified/unspecified/unspecified) as before.
2023-12-31 13:35:03 -08:00
Niklas Haas e687a84854 avfilter/formats: set audio fmt lists for vaf filters
Currently, the logic inside the FF_FILTER_FORMATS_QUERY_FUNC branch
prevents this code from running in the event that we have a filter with
a single video input and a single audio output, as the resulting audio
output link will not have its channel counts / samplerates correctly
initialized to their default values, possibly triggering a segfault
downstream.

An example of such a filter is vaf_spectrumsynth. Although this
particular filter already sets up the channel counts and samplerates as
part of the query function and therefore avoids triggering this bug, the
bug still exists in principle. (And importantly, sets a wrong precedent)
2023-12-31 13:33:01 -08:00
Niklas Haas 0e9cf1abf5 avfilter: always call ff_default_query_formats
Even if a query func is set. This is safe to do, because
ff_default_query_formats is documented not to touch any filter lists
that were already set by the query func.

The reason to do this is because it allows us to extend
AVFilterFormatsConfig without having to touch every filter in existence.
An alternative implementation of this commit would be to explicitly add
a `ff_default_query_formats` call at the end of every query_formats
function, but that would end up functionally equivalent to this change
while touching a whole lot more code paths for no reason.

As a bonus, eliminates some code/logic duplication from this function.
2023-12-31 13:33:01 -08:00
Niklas Haas 1b0ca47707 avfilter/formats: document ff_default_query_formats
In particular, make it clear that this function will not touch format
lists which were already set by the caller before calling into this
function.
2023-12-31 13:32:29 -08:00
Cedric Le Barz 238f9de876 Add jpeg2000 subdescriptor (V2).
Signed-off-by: Cedric Le Barz <clebarz@ektacom.com>
2023-12-31 14:18:01 +01:00
Michael Niedermayer e063c1d079
avcodec/mpegvideo_enc: Use ptrdiff_t for stride
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-30 21:50:05 +01:00
Michael Niedermayer a066b8a809
avcodec/mpegvideo_enc: Dont copy beyond the image
Fixes: out of array access
Fixes: tickets/10754/poc17ffmpeg

Discovered by Zeng Yunxiang.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-30 21:50:04 +01:00
Michael Niedermayer 68146f06f8
avfilter/vf_minterpolate: Check pts before division
Fixes: FPE
Fixes: tickets/10758/poc20ffmpeg

Discovered by Zeng Yunxiang

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-30 21:50:04 +01:00
Michael Niedermayer 08bd2cbfeb
avfilter/avf_showwaves: Check history_nb_samples
Fixes: out of array access
Fixes: tickets/10756/poc18ffmpeg

Discovered by Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-30 21:50:04 +01:00