Commit Graph

113104 Commits

Author SHA1 Message Date
Leo Izen f6ef6a853c
avcodec/libjxldec: produce rgbf32 and rgbaf32 frames
These pixel formats have always been supported by libjxl, but at the
time this plugin was written, they were not in FFmpeg yet. Now that
they are in FFmpeg, we should support them.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-12-22 22:08:29 -05:00
Leo Izen 4013b8d3f0
avcodec/pngdec: improve handling of bad cICP range tags
FFmpeg doesn't support tv-range RGB throughout most of its pipeline, so
we should keep the warning. However, in case something does support it
we should at least keep it tagged properly. Additionally, the encoder
writes this tag if the space is tagged as such so this makes a round
trip work as it should.

Also, PNG doesn't support nonzero matrices but we only warn and ignore
in that case, so we have no reason to error out for illegal cICP ranges
either (i.e. greater than 1).

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Kacper Michajłow <kasper93@gmail.com>
2023-12-22 22:07:35 -05:00
sunyuechi 3d39b8d4e7 lavc/takdsp: R-V V decorrelate_sm
C908:
decorrelate_sm_c: 130.0
decorrelate_sm_rvv_i32: 43.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
(with minor changes)
2023-12-22 17:40:00 +02:00
Andreas Rheinhardt 0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
James Almer 46775e64f8 avcodec/takdsp: fix const correctness
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-22 09:28:04 -03:00
James Almer c5029bb193 checkasm/takdsp: add decorrelate_sf test
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-22 09:26:38 -03:00
Martin Storsjö 935837c3d3 checkasm: Fix the takdsp tests
For memcpy and memcmp, we need to multiply by the element size,
otherwise we're copying and comparing only a fraction of the buffer.

For decorrelate_sr, the buffer p1 is the one that is mutated;
copy and check p1 instead of p2.

For decorrelate_sm, both buffers are mutated, so copy and check
both of them.

For decorrelate_sm, the memcpy initialization of p1 and p1_2 was
reversed - p1 is filled with randomize, but then memcpy copies from
p1_2 to p1. As p1_2 is uninitialized at this point, clang concluded
that the copy was bogus and omitted it entirely, triggering failures
in this test on x86 (where there was an existing assembly implementation
to test).

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 14:20:31 +02:00
Anton Khirnov 6325aede08 fftools/ffmpeg: remove deprecated -[av]bsf
They were marked as deprecated over 10 years ago.
2023-12-22 11:39:57 +01:00
Anton Khirnov 7f982065a8 fftools/ffmpeg: mark -vsync for future removal
It has already been deprecated over a year ago.
2023-12-22 11:39:57 +01:00
Anton Khirnov 8d8c2b410f fftools/ffmpeg_opt: fix -dn flags
It's a data, not video option.
2023-12-22 11:39:57 +01:00
Anton Khirnov 84352c9891 fftools/ffmpeg_opt: print a section for data-stream options
Only show it with show_advanced (triggered by -h long), since data
streams themselves are an advanced topic.
2023-12-22 11:39:57 +01:00
Anton Khirnov 74df1b73d4 fftools/ffmpeg_opt: refine printing type-specific options
* filter subtitle/data options out of main, video and audio sections
* add filters that were missing entirely from the subtitle section
* add a missing section for advanced subtitle options
2023-12-22 11:39:57 +01:00
Anton Khirnov 0125cab385 fftools/ffmpeg_opt: mark more options as OPT_EXPERT
Reduces the basic help output to a reasonable size and stops confusing
users with options the vast majority will not need.
2023-12-22 11:39:57 +01:00
Anton Khirnov c5a87d8bdb fftools/opt_common: mark some options as OPT_EXPERT
So they don't clutter the standard help output.

-loglevel is marked because there is no need to show two options (-v and
-loglevel) that do the same thing.
2023-12-22 11:39:57 +01:00
Anton Khirnov 86e8439994 fftools/ffmpeg_opt: update program description to match manpage
Cf. 2244722f1f
2023-12-22 11:39:57 +01:00
Anton Khirnov 41716214c2 fftools/ffmpeg: improve WARN_MULTIPLE_OPT_USAGE()
Currently it requires every single OPT_SPEC option to be accompanied by
an array of alternate names for this option. The vast majority of
options have no alternate names, resulting in a large numbers of
unnecessary single-element arrays that merely contain the option name.

Extend the option parsing API to allow marking options as having
alternate names, or as being the canonical name for some existing
alternatives. Use this new information to avoid the need for
abovementioned unnecessary single-element arrays.
2023-12-22 11:39:57 +01:00
Anton Khirnov 148fac277a fftools/ffmpeg: change the MATCH_PER_TYPE_OPT macro into a function
There is no reason for it to be a macro anymore, this makes the code
using it cleaner and simpler.
2023-12-22 11:39:57 +01:00
Anton Khirnov 0ba70a6792 fftools/cmdutils: add a struct for a list of SpecifierOpt
Significantly simplifies the code dealing with OPT_SPEC.
2023-12-22 11:39:57 +01:00
Anton Khirnov 5792382269 fftools/cmdutils: check valid flags for OPT_TYPE_FUNC
SPEC and OFFSET do not make sense for functions.
2023-12-22 11:39:57 +01:00
Anton Khirnov 2f1bc3b424 fftools/cmdutils: include OPT_PERFILE in OPT_OFFSET
And analogously OPT_OFFSET in OPT_SPEC. Previously the inclusion would
be implicit and required all code to remember this.
2023-12-22 11:39:57 +01:00
Anton Khirnov 66fcfc0009 fftools/cmdutils: renumber option flags sequentially
Also, document them.
2023-12-22 11:39:57 +01:00
Anton Khirnov 5b1b132072 fftools/cmdutils: rename HAS_ARG to OPT_FUNC_ARG
For consistent namespacing with other option flags. Also, document and
enforce that it can only be set for func-type options.
2023-12-22 11:39:57 +01:00
Anton Khirnov d2e479a429 fftools: split off option types from other flags
These values are not actually flags, as only one of them can be
meaningfully set.
2023-12-22 11:39:57 +01:00
Anton Khirnov 074abeb57e fftools/ffmpeg_opt: move deprecated options to the end of the list
This way they don't clutter this already-cluttered code even further.
2023-12-22 11:39:57 +01:00
Anton Khirnov b472c46a70 fftools/cmdutils: simplify handling of the HAS_ARG option flag
This option flag only carries nontrivial information for options that
call a function, in all other cases its presence can be inferred from
the option type (bool options do not have arguments, all other types do)
and is thus nothing but useless clutter.

Change the option parsing code to infer its value when it can, and drop
the flag from options where it's not needed.
2023-12-22 11:39:57 +01:00
Anton Khirnov 25c98566e8 fftools/ffmpeg_opt: drop HAS_ARG from auto{scale,rotate}
It causes those options to be parsed as either
* -autofoo 0/1 (with an argument)
* -noautofoo   (without an argument)
This is unnecessary, confusing, and against the documentation; these are
also the only two bool options that take an argument.

This should not affect the users, as these options are on by default,
and are supposed to be used as -nofoo per the documentation.
2023-12-22 11:39:57 +01:00
Anton Khirnov dc2fc5a919 fftools/ffmpeg_filter: only set framerate for video
Otherwise an unitialized stack value would be copied to FPSConvContext.
As it's then never used, it tends not to be a problem in practice,
however it is UB and some compilers warn about it.
2023-12-22 11:39:57 +01:00
Anton Khirnov 6916105b11 fftools/ffmpeg_demux: set discard on the AVStream directly
Avoid taking an ugly detour through the decoder AVCodecContext.
2023-12-22 11:39:21 +01:00
Anton Khirnov b26407ccb8 lavf: allow setting AVStream.discard as an AVOption 2023-12-22 11:39:08 +01:00
Martin Storsjö 4f493659fd configure: Fix linking d3d12va in UWP mode
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 12:04:17 +02:00
Martin Storsjö 6d04518788 configure: Remove/factorize a redundant check for UWP mode
The check for UWP mode was duplicated from right above, in
d54127c41a.

Also, instead of several lines with "enabled uwp && ...", make one
"if enabled uwp; then" block.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 12:04:12 +02:00
Andreas Rheinhardt 45b4781e9a avcodec/v4l2_m2m: Remove redundant av_frame_unref()
This frame will be freed in the next line.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-21 23:29:02 +01:00
Vittorio Giovara 05bfc03752 Add new vf_tiltandshift filter
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2023-12-21 17:16:16 -05:00
Rémi Denis-Courmont 0f05f9ed3e mlp: move pack_output pointer to decoder context
The current pack_output function pointer is a property of the decoder,
rather than a constant method provided by the DSP code. Indeed, except
for an unused initialisation, the field is never used in DSP code.
2023-12-21 22:42:34 +02:00
sunyuechi c933ff2779 lavc/takdsp: R-V V decorrelate_sr
C908:
decorrelate_sr_c: 95.5
decorrelate_sr_rvv_i32: 28.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi 864174dd00 lavc/takdsp: R-V V decorrelate_ls
C908:
decorrelate_ls_c: 69.7
decorrelate_ls_rvv_i32: 27.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi 21e2b6b501 checkasm/takdsp: add decorrelate_sm test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi c064823b95 checkasm/takdsp: add decorrelate_sr test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
sunyuechi 3bdb0fe511 checkasm/takdsp: add decorrelate_ls test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-12-21 22:42:34 +02:00
Rémi Denis-Courmont cdd38a2ffe lavc/aacpsdsp: fix R-V V stereo interpolate
The penultimate loop iteration could pick any vl such that:
 vlenb/4 < vl <= vlenb/2
Thus if the total length is not a multiple of vlenb/2, the vfadd.vf
on the penultimate iteration would yield corrupt values for the last
iteration.

To avoid this, force vl = vlen/2 until the last iteration. Unfortunately
this latent bug is not reproducible with either hardware or QEMU as of now.
2023-12-21 17:54:23 +02:00
Rémi Denis-Courmont db32f75c63 lavc/opusdsp: simplify R-V V postfilter
This skips the round-trip to scalar register for the sliding 'x'
coefficients, improving performance by about 5%. The trick here is that
the vector slide-up instruction preserves elements in destination vector
until the slide offset.

The switch from vfslide1up.vf to vslideup.vi also allows the elimination
of data dependencies on consecutive slides. Since the specifications
recommend sticking to power of two offsets, we could slide as follows:

        vslideup.vi v8, v0, 2
        vslideup.vi v4, v0, 1
        vslideup.vi v12, v8, 1
        vslideup.vi v16, v8, 2

However in the device under test, this seems to make performance slightly
worse, so this is left for (in)validation with future better hardware.
2023-12-21 17:54:08 +02:00
Paul B Mahol 04cb307508 avformat/iamf_parse: fix yet annother logical coding error
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 12:24:54 -03:00
Paul B Mahol 0c03f4c6b9 avformat/iamfenc: fix logical coding error 2023-12-21 12:22:10 -03:00
Paul B Mahol 7a9aafde3d avformat/iamf_parse: fix another logical coding error
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 11:39:24 -03:00
James Almer 061c864a95 avformat/options: skip the none type group in stream_group_child_iterate()
Otherwise the function will not iterate through valid group types.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:34:11 -03:00
James Almer fa961bb383 ffmpeg_mux_init: use strtoll() to parse stream and group indexes
Long is 32 bits signed on Windows, and nb_stream{s,_groups} are both unsigned
int. In a realistic scenario this wont make a difference, but it's still
proper.

Also ensure the parsed string is an integer while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:32:53 -03:00
James Almer 1747c2fc33 avutil/hwcontext_d3d12va: remove unused variables
Removes -Wunused-variable warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:31:02 -03:00
James Almer 4ea6121f18 avutil/hwcontext_d3d12va: fix indentation in d3d12va_transfer_data()
Removes -Wmisleading-indentation warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:31:02 -03:00
James Almer 4d78a9ac14 avutil/hwcontext_d3d12va: cast the input pointer array argument on av_image_copy calls
Removes -Wincompatible-pointer-types warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:31:02 -03:00
Tong Wu bc4592a778 avutil/hwcontext_d3d12va: remove an unused function
It caused lacking a public declaration build error with
-Werror=missing-prototypes.

Since DXGI_FORMAT is moved to public since patch set V10, this function
is no longer useful. Now remove it.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-21 10:31:02 -03:00