1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00
Commit Graph

121678 Commits

Author SHA1 Message Date
Lynne
dd80ecb666 doc/APIchanges: bump lavu minor and remove reverted pixfmts 2025-11-06 21:47:08 +01:00
Lynne
6720f71247 Revert "vulkan/prores: output LSB-padded data"
This reverts commit 909d71322a.

The issue was elsewhere, not in our code.
2025-11-06 21:46:43 +01:00
Lynne
9a7174bc9a Revert "lavu/pixfmt: add grayscale 10 and 12-bit MSB padded variants"
This reverts commit ed5b694ebe.
2025-11-06 21:46:43 +01:00
Lynne
26236a47b2 Revert "lavu/pixfmt: add 420 and 422, 10 and 12-bit MSB padded variants"
This reverts commit e42c7698f5.
2025-11-06 21:46:43 +01:00
Lynne
b982b2a2a3 Revert "swscale: add support for 10/12-bit grayscale MSB pixfmts"
This reverts commit a5be0ecbfd.
2025-11-06 21:46:41 +01:00
Lynne
72a19a1c4a Revert "swscale: add support for 10/12-bit 422 and 444 MSB pixfmts"
This reverts commit bc0ee8b7cc.
2025-11-06 21:44:13 +01:00
Lynne
22cc958c58 Revert "hwcontext_vulkan: fix grayscale 10 and 12-bit formats using the new MSB formats"
This reverts commit 471acedec2.
2025-11-06 21:44:13 +01:00
Lynne
2c7732a676 Revert "hwcontext_vulkan: fix 3-plane 444 10 and 12-bit formats using the new MSB formats"
This reverts commit 41ecb203c5.
2025-11-06 21:44:13 +01:00
Lynne
38df9ba71b Revert "hwcontext_vulkan: fix planar 10 and 12-bit RGB formats using the new MSB formats"
This reverts commit 98ee3f6718.
2025-11-06 21:44:13 +01:00
Lynne
15e82dc452 Revert "hwcontext_vulkan: remove unsupported/broken pixel formats"
This reverts commit 5b388f2838.
2025-11-06 21:44:13 +01:00
Lynne
deaece6e56 Revert "swscale/format: add missing fmt_shift for gray12/12 msb formats"
This reverts commit c9710dae3c.
2025-11-06 21:44:13 +01:00
Ramiro Polla
4bee010844 swscale/range_convert: fix truncation bias in range conversion
384fe39623 introduced a regression in the
range conversion offset calculation, resulting in a slight green tint
in full-range RGB to YUV conversions of grayscale values.

The offset being calculated was not taking into consideration a bias
needed for correctly rounding the result from the multiplication stage,
leading to a truncated value.

Fixes issue #11646.
2025-11-06 20:36:08 +00:00
Niklas Haas
01b105bb06 tests/fate/swscale: add swscale self-test
This one takes about 2.93s on my machine, but ensures that every pixel
format conversion roundtrips correctly. Note that due to existing bugs in
libswscale, this one only passes when using the new format conversion code.

Restrict the test to -v 16 (AV_LOG_ERROR) to avoid excess amounts of output.
2025-11-06 20:34:51 +00:00
Niklas Haas
9a386078cc tests/swscale: use av_log() where appropriate
We can't use ANSI color codes inside av_log(), so fall back to printf()
for these; but match the INFO verbosity level.

Also change the format slightly to drop SSIM numbers down to just below
VERBOSE level, since VERBOSE tends to generate a lot of swscale related
spam.
2025-11-06 20:34:51 +00:00
Niklas Haas
84b365d522 avfilter/avfiltergraph: print both failing links on conversion error
This is more informative than the current behavior, because when the first
MERGE() succeeds but the second fails, the original link already has
merged formats and thus the error message is confusing.
2025-11-06 18:16:10 +01:00
Niklas Haas
6c3a63112b avfilter/avfiltergraph: only print format lists for failing mergers
Instead of printing all format lists on a link negotiation error, just print
the relevant/failing format lists.
2025-11-06 18:09:36 +01:00
Niklas Haas
7b564e2efc avfilter/avfiltergraph: print all format lists on config failure
Instead of just printing the pixel/sample formats.
2025-11-06 18:01:37 +01:00
Niklas Haas
ad5b151f88 avfilter/formats: add name field to AVFilterFormatMerger
Needed to properly print format lists on format configuration failure.
2025-11-06 18:01:33 +01:00
Niklas Haas
f5bc9704ed avfilter/formats: constify ff_filter_get_negotiation 2025-11-06 17:48:50 +01:00
Niklas Haas
c1717cb666 avfilter/format: add print_list() to AVFilterFormatsMerger
So that the generic code can correctly print format lists for failing mergers.
2025-11-06 17:34:43 +01:00
Niklas Haas
c9710dae3c swscale/format: add missing fmt_shift for gray12/12 msb formats
The MSB YUV formats were added, but the gray formats were not. Seems to have
been an oversight.

Fixes: a5be0ecbfd
2025-11-06 15:56:24 +01:00
Zhao Zhili
222127418b avutil/internal: remove some compats for msvc
They are supported by MSVC with C11.
2025-11-06 02:16:27 +00:00
Andreas Rheinhardt
79080a547a avcodec/x86/h264_chromamc: Use xmm regs in chroma_mc4 SSSE3 functions
Doubling the register size allowed to avoid two pmaddubsw.
It is also ABI compliant (the old version lacked an emms)
and the average versions no longer rely on padding (the old versions
used pavgb with a memory operand reading eight bytes,
although only four are needed).

Old benchmarks (the latter four refer to RV40):
avg_h264_chroma_mc4_8_c:                               145.7 ( 1.00x)
avg_h264_chroma_mc4_8_ssse3:                            32.3 ( 4.51x)
put_h264_chroma_mc4_8_c:                               136.1 ( 1.00x)
put_h264_chroma_mc4_8_ssse3:                            29.0 ( 4.70x)
avg_chroma_mc4_c:                                      162.1 ( 1.00x)
avg_chroma_mc4_ssse3:                                   31.1 ( 5.22x)
put_chroma_mc4_c:                                      137.5 ( 1.00x)
put_chroma_mc4_ssse3:                                   28.6 ( 4.81x)

New benchmarks:
avg_h264_chroma_mc4_8_c:                               146.7 ( 1.00x)
avg_h264_chroma_mc4_8_ssse3:                            26.5 ( 5.53x)
put_h264_chroma_mc4_8_c:                               136.8 ( 1.00x)
put_h264_chroma_mc4_8_ssse3:                            22.5 ( 6.09x)
avg_chroma_mc4_c:                                      165.5 ( 1.00x)
avg_chroma_mc4_ssse3:                                   27.2 ( 6.08x)
put_chroma_mc4_c:                                      138.1 ( 1.00x)
put_chroma_mc4_ssse3:                                   23.2 ( 5.96x)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-06 02:16:28 +01:00
Kacper Michajłow
3eb0cb3b0b avutil/hwcontext_vulkan: use correct bitmask types
Vulkan headers define *FlagBits enum with individual bit values, and
coresponding *Flags typedef to be used to store the bitmask of
coresponding bits.

In practice those two types map to the same type, but for consistency
*Flags should be used.

Fixes MSVC warnings about type mismatch.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:09 +01:00
Kacper Michajłow
f478964226 avcodec/vulkan_encode_av1: fix unit_elems check
Wrong enum value was used to check unit_elems. While
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA (11) would trigger when
UNIT_MASTERING_DISPLAY (2) was set, it also would match
UNIT_CONTENT_LIGHT_LEVEL (1) which is not expected.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:01 +01:00
Kacper Michajłow
c3ff7d23f5 avcodec/dxva2: move variable declaration to for loop to avoid warning
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:01 +01:00
Kacper Michajłow
08d327e92c fftools/ffmpeg: suppress unused variable warning, but using it
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:00 +01:00
Lynne
873a173328 aacpsy: fix whitespace and code style
The last merged patch contained garbage.
2025-11-05 16:31:59 +00:00
Zhao Zhili
632958d2bf avformat/mov: log unknown tag via av_fourcc2str
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-11-05 23:45:31 +08:00
Zhao Zhili
07581d6736 avformat/mov: check prji box version and flags
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-11-05 23:45:31 +08:00
Zhao Zhili
0734d1c55a avformat/mov: relax check on proj box size
Pico VR adds a '\0' after projection_type (a real C string than
a fourcc). It's not strictly correct, but doesn't affect parsing.

[prji: Projection Information Box]
    position = 149574743
    size = 17
    version = 0
    flags = 0x000000
    projection_type = rect

Co-Authored-by: Keven Ma
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-11-05 23:45:31 +08:00
Zhao Zhili
84fcbce16c fate/hevc: add tests for the dts2pts bsf 2025-11-05 15:13:54 +00:00
Zhao Zhili
2d241202ff avcodec/bsf/dts2pts: add hevc support 2025-11-05 15:13:54 +00:00
Zhao Zhili
6c83bcadbb avcodec/hevc: add ff_hevc_compute_poc2 which don't depend on HEVCSPS directly
So it can be used in other places like bsf.
2025-11-05 15:13:54 +00:00
Zhao Zhili
5f15734d92 avcodec/bsf/dts2pts: fix return 0 on error path 2025-11-05 15:13:54 +00:00
Zhao Zhili
91b2fe71cc avcodec/bsf/dts2pts: remove always true check 2025-11-05 15:13:54 +00:00
Kacper Michajłow
671e54d715 configure: add -static suffix to internal static libs for test programs
In MSVC builds, object files built for shared or static libraries are
technically not compatible with each other. That's why building both
shared and static libraries simultaneously is not allowed in configure.
This may change in the future once dllimport/dllexport attributes are no
longer used. Which will be possible on next major bump. The only
remaining use of dllexport was changed in c6c8063186.

However, for test programs, we still build internal static libraries
that allow the test programs to access internal symbols.

In commit 8eca3fa619, I assumed that when
CONFIG_STATIC=0, we would never build a static library. We actually do
build one for internal purposes, for the test executables. In that case,
we only link the tested library statically (using the same object files
as built for the shared library), the rest of the libraries are still
linked dynamically.

Such libraries are never installed and are used only for test programs.
This change adds a -static suffix to these internal libraries to avoid
name conflicts. In the MSVC world, static libraries and import libraries
are generally the same thing and share the same naming conventions.

Fixes: 8eca3fa619
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 13:00:09 +00:00
Niklas Haas
08eda05967 avfilter/vf_libplacebo: make rotation check more robust
This currently does not make any difference, but it makes the check
more robust against possible future changes to the rotation parameter.
2025-11-04 12:38:55 +00:00
Niklas Haas
49452967e7 avfilter/vf_libplacebo: don't override existing rotation attribute
This is a regression introduced by the addition of the rotation option,
which overrode the existing rotation attribute that may have been set to
the image.

To fix it, add the rotation istead of setting it - however we have to do this
directly when mapping, so as to not add it multiple times.

Fixes: 4f623b4c59
2025-11-04 12:38:55 +00:00
Andreas Rheinhardt
6c1acbbffb avcodec/x86/fdct: Remove obsolete comment
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:32 +01:00
Andreas Rheinhardt
18e08101eb avcodec/x86/Makefile: Don't use MMX-OBJS for fdct.o
MMX has been removed in d402ec6be9.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:29 +01:00
Andreas Rheinhardt
8157aa1a3f avcodec/x86/me_cmp: Remove MMX sse functions
They are overridden by SSE2 and no longer needed by the no longer
existing nsse MMX functions. Saves 240B here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:11 +01:00
Andreas Rheinhardt
3f596ec478 avcodec/x86/me_cmp: Port nsse{8,16} to SSSE3
Even nsse8 has to operate on eight words and therefore gains
a lot from xmm registers (and pabsw).

Old benchmarks:
nsse_0_c:                                              359.2 ( 1.00x)
nsse_0_mmx:                                            151.8 ( 2.37x)
nsse_1_c:                                              151.2 ( 1.00x)
nsse_1_mmx:                                             77.5 ( 1.95x)

New benchmarks:
nsse_0_c:                                              358.8 ( 1.00x)
nsse_0_ssse3:                                           62.2 ( 5.77x)
nsse_1_c:                                              151.2 ( 1.00x)
nsse_1_ssse3:                                           33.6 ( 4.50x)

The MMX nsse functions have been removed.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:39 +01:00
Andreas Rheinhardt
86062cfa03 avcodec/x86/me_cmp: Add ff_sse8_sse2()
Benchmarks:
sse_1_c:                                                51.9 ( 1.00x)
sse_1_mmx:                                              16.5 ( 3.15x)
sse_1_sse2:                                              9.7 ( 5.36x)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:32 +01:00
Andreas Rheinhardt
232e72d00e avcodec/x86/me_cmp: Rename registers
This will avoid using xmm registers that are volatile for Win64
in the next commit.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:19 +01:00
Andreas Rheinhardt
87cfbcb74a avcodec/x86/me_cmp: Avoid unnecessary instruction
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:39:25 +01:00
Manuel Lauss
d058d5db10 avcodec/sanm: implement codec45
This is a post-processing codec: given delta-x/y coordinates and a run length,
the r/g/b components of the 4 surrounding pixels are summed up, and the resulting
15bit value is used as index into a color quantization table to derive the
resulting pixel at the center.

It is only used in 10-20 frames of the Rebel Assault 2 LxxRETRY.SAN files
to slightly blur the outline of the "opening aperture" effect.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-11-04 10:28:57 +00:00
Martin Storsjö
8313dc1120 movenc: Make hybrid_fragmented retain the fragmented form headers
This makes the final file truly hybrid: Externally the file
is a regular, non-fragmented file, but internally, the fragmented
form also exists un-overwritten.

To make any use of that, first, the fragments need to be muxed in
a position independent form, i.e. with empty_moov+default_base_moof
(or the dash or cmaf meta-flags).

Making use of the fragmented form when the file is finalized is
not entirely obvious though. One can dump the contents of the
single mdat box, and get the fragmented form. (This is a neat
trick, but not something that anybody really is expected to
want to do.)

The main expected use case is accessing fragments in the form of
byte range segments, for e.g. HLS.

Previously, the start of the file would look like this:

- ftyp
- free
- moov
 - (moov contents)

After finalizing the file, it would look like this:

- ftyp
- free
- mdat (previously moov)
 - (moov contents)

In this form, the size and type of the original moov box were
overwritten, and the original moov contents is just leftover
as unused data in the mdat box.

To avoid this issue, the start of the file now looks like this:

- ftyp
- free
- free
 - ftyp
- moov
 - (moov contents)

The second, hidden ftyp box inside mdat, would normally never be
seen.

After finalizing, the difference is that the mdat box now is
extended to cover the ftyp and the whole moov including its header
(and all the following fragments).

I.e., the start of the file looks like this:

- ftyp
- free
- mdat
 - ftyp
 - moov
  - (moov contents)

This allows accessing the "ftyp+moov" pair sequentially as such,
with a byte range - this range is untouched when finalizing,
producing the same ftyp+moov pair both while writing, when the
file is fragmented, and after finalizing, when the file is
transformed to non-fragmented externally.

Note; the sequential two "free+free" boxes may look slightly
silly; it could be tempting to make the second one an mdat
from the get-go. However, some players of fragmented mp4 (in
particular, Apple's HLS player) bail out if the initialization
segment contains an mdat box - therefore, use a free box.

It could also be possible to use just one single free box with
8 bytes of padding at the start - but that would require more
changes to the finalization logic.

For a segmenting user of the muxer, the only unclarity is how
to determine the right byte range for the internal ftyp+moov
pair. Currently, this requires parsing the muxer output and skip
past anything up to the start of the non-empty free box.
2025-11-04 10:23:31 +00:00
Agent45
a06aee359b revert 458a942481151ede27478e6ac6d9d2866d438b84
revert avcodec/aacenc: add bitrate threshold for PNS
2025-11-04 09:55:51 +00:00
Agent45
e11dfb3f09 trim trailing whitespace in aacpsy.c 2025-11-04 09:55:51 +00:00