1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

118987 Commits

Author SHA1 Message Date
76f09ab647 avcodec/webvttdec: update documentation
The previous link lead to a 404 page as that page doesn't exist anymore.

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 09:52:24 +01:00
b857bf942c avcodec/hevc/hevcdec: Simplify access to luma plane
It is always set and does not use subsampling.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
4505257372 avcodec/proresenc_kostya: Don't cast const away needlessly
The parameter passed here is unused, so just pass NULL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
d76ae08048 avcodec/svq1enc: Don't add to NULL
It is undefined behavior. Pass a dummy buffer instead.
Fixes "runtime error: applying non-zero offset 1024 to null pointer".
affected the SVQ1 vsynth FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
02c16b48c5 avcodec/snow: Don't add to NULL
It is undefined behavior.
Fixes "runtime error: applying non-zero offset 8 to null pointer".
Fixes the Snow vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
fbcc943b22 avcodec/h261enc: Don't use (size_t)-1
Fixes "runtime error: addition of unsigned offset to 0x765a09523a90
overflowed to 0x765a09523a8e". This fixes all H.261 tests when run
under UBsan.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
950ad969fb avcodec/sanm: codec20 decoder
codec20 is raw uncompressed image data.

It exists in Rebel Assault 1 as a special format for STOR/FTCH
and is used again in the Full Throttle Remaster from 2017.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:56 +01:00
fd6bfaab55 avcodec/sanm: ignore codec45
Codec45 is used in some RA2 videos on top of codec37.

It consists of 2 tables (768 and 32768 bytes), and datapackets
like codec2 (delta-x, delta-y) with a pixel counter instead of a color value.
It then reads the 4 surrounding pixels, looks up 3 separate values
for each in table1, adds them together to form an index into
table2 for a new pixel value, in a row.

The data coming in gets the x/y coordinates out of the visible
area very quickly (2-3 iterations); I don't see any visual
difference between the ffmpeg-produced frames and ones captured
with dosbox from rebel assault 2, which leads me to believe this
codec never worked as intended.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:54 +01:00
b48bd23321 avcodec/sanm: implement STOR/FTCH for ANIMv1
Handle STOR/FTCH the same way the RA1 game engine does:
On STOR, save the next following FOBJ (not the decoded image)
in a buffer; decode it on FTCH.
The RA1 codecs and the fobj handler now take an explicit
GetByteContext in order to be able to replay stored data.

Used extensively by Rebel Assault 1 for e.g. backgrounds and
the cockpit overlay.

For ANIMv2 keep the current system to store the decoded image, as
replaying a FOBJ would not work with codecs37/47/48 due to sequence
violations.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:39 +01:00
8a04526080 avcodec/sanm: codec37: reimplement comp4
Compression 4 code 0 means copy from delta buffer without mv,
AND start of a skip run.  This gets rid of the extra case and column
index manipulation and implements this as it is implemented in the
original game exe, i.e. as a special case for after mv copy.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
fb951b26fd avcodec/sanm: codec4/5/33/34 decoder
This codec works on 4x4 pixel tiles, which can be generated and read
from the datastream.  They're both identical, codec5 misses a tile
index to skip the current tile.
Codecs33/34 are the same as 4/5 but with a different tileset generator.
Used only in Rebel Assault 1.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
e1fd6bc8b4 avcodec/sanm: codec21 decoder
similar to codec23, this one alternatingly skips and writes bytes.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
77b5a0c134 avcodec/sanm: codec23 decoder
This codec alternatingly skips and changes existing pixels.
A second 16bit parameter in the FOBJ header indicates how to do
the pixel changes: either by specifying a LUT in the codec datastream
or by adding a constant value to the pixel.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
968ffbe64a avcodec/sanm: codec2 decoder
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y
and 1 byte color to put at that spot.
Used in Rebel Assault 1 only.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
aa2f2befaa avcodec/sanm: fix codec3
codec3 is codec1 which writes zero values instead of skipping them.
This fixes a lot of RA1 videos.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
fd9b92b216 avcodec/sanm: better ANIMv1 engine support
- clear the front buffer with color 0 on the first FOBJ.
  Fixes a lot of Rebel Assault 1 videos and Rebel Assault 2 space
  scenes (e.g. 08PLAY.SAN which consists only of codec1/2/21 objects
  which only ever touch parts of the buffer).
- for ANIMv1 (Rebel Assault 1): set palette index 0 to all zeroes.
  This fixes a lot of stray colors in e.g L1HANGAR.ANM, L2INTRO.ANM,
  space scenes.
- Esp in RA1, there are a lot of FRME objects which don't contain
  any video data (prebuffering some audio only). Account for that.
- In RA1 L2PLAY.ANM there are a few unaligned FOBJs, handle this
  in a generic way.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
93b0ca26ac avcodec/sanm: better frame size detection for old codecs
The size of the video frame (FOBJ) of the old codecs (ANIMv0/1/2) can
very reliably be determined:
- ANIMv0/1 (=Rebel Assault 1) uses a 384x242 internal buffer for
  everything.  The codec parameters only describe the size and offset
  of the specific FOBJ on that buffer.
- ANIMv2 titles usually use one of the fullscreen codecs (37/47/48)
  as first FOBJ, and their dimensions can generally be trusted.
- RA2 uses 424x260 as internal buffer, use that if encountered:
  08PLAY.SAN does not use codec37 so we need to guess using the
  codec coordinates.
- ignore sizes smaller than 2x2 or larger than 800x600.
- some game videos have an initial fobj with either 1x1 or -1x-1
  pixels in size, ignore them with a warning (Full Throttle
  and the Rebel Assault 2 xxRETRY.SAN videos).

Once a known/valid dimension set has been discovered, use it and
don't change it for subsequent FOBJs, rather clamp the large frame
to the determined dimensions.

Tested with RA1, RA2, Full Throttle, Dig, Outlaws, SotE and MotS
videos.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
f6c6ba95fd avcodec/sanm: FOBJ left/top are signed values
The left/top parameters of a FOBJ are signed values.  Adjust
codec1 code accordingly to not draw outside the buffer area.
Rebel Assault 1 makes heavy use of this.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
a48dd03fd9 avcodec/sanm: disable left/top for fullscreen codecs
The block-based codecs 37/47/48 work on the full frame, and there's no
existing LucasArts game video that uses left/top offsets for these,
as it doesn't make sense. Ignore the left/top parameters for these codecs.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
f7e6070c51 avutil/tests/pixfmt_best: add more semi planar format tests
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:34:10 -03:00
b8dc875249 swscale/output: add support for NV20
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:34:05 -03:00
2f856b488b swscale/input: add support for NV20
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:31:29 -03:00
1502551dd3 avformat/hlsenc: fix CODECS Attribute hard code in hevc EXT-X-STREAM-INF
fix ticket: 10786

parse the SPS from extradata and
get profile_compatibility, tier, constraints which was been hard code before.
HEVC CODECS Attribute reference to: ISO/IEC14496-15

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2025-03-19 19:20:50 +08:00
b75b568b3d configure: improve ar test for response files 2025-03-19 15:41:52 +05:30
c0b7f817a4 avcodec/Makefile: Skip ffv1_vulkan.h in checkheaders
unless vulkan is actually enabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 23:06:55 +01:00
bf22c4cc3e avutil: only duplicate hal2float and float2half in shared builds
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-18 17:21:23 -03:00
81c50c33b6 avcodec/Makefile: Only compile executor when VVC decoder is enabled
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 13:45:41 +01:00
6bd4e8bf76 avcodec/vvc/Makefile: Move VVC decoder->h2645data dep to lavc/Makefile
If h2645data.c were changed in a way that makes it rely on another
object file, all components that need h2645data.o would need to be
updated. And given that the VVC decoder->h2645data.o dependency is
currently hidden in a separate Makefile, it would likely be forgotten.
So move it to the libavcodec/Makefile.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 13:45:20 +01:00
740d400965 ffbuild: use response files only if ar accepts them 2025-03-18 15:35:30 +05:30
2de14c3e03 avcodec/tableprint_vlc: fix build with --enable-hardcoded-tables
Fixes #11518
2025-03-18 01:21:17 +01:00
d54afd4d61 avcodec/Makefile: fix build of exr decoder in odd configs
Fixes #11519
2025-03-18 01:14:38 +01:00
46da5605b2 MAINTAINERS: add Manuel Lauss as sanm.c/smush.c Maintainer
As requested by Michael Niedermayer.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:33:36 +01:00
2471b22023 avcodec/ffv1dec: Fix a YUVA issue with remaping
Untested

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
276854e183 avcodec/ffv1: Add GRAYF16 support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
b57f71f716 avcodec/ffv1: Add YAF16 support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
d7fa6a388b avcodec/ffv1: fix remap without chroma planes
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:11 +01:00
a8892c5400 avcodec/ffv1: implement remap for encode/decode_plane()
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:11 +01:00
efdf7512a5 gitattributes: End merge conflicts in Changelog
Similar could be done with other lists that generally are appended to

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:10 +01:00
94beaf4872 avcodec/videotoolboxenc: Add AYUV as a candidate pix_fmt for HEVC alpha
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 20:10:55 +08:00
5b9356f18e swscale/swscale_unscaled: avoid nv12 <-> nv21 bug
This is not handled by the planar copy wrapper, so exclude it.
2025-03-17 11:40:05 +01:00
8ab40ca984 swscale: fix gray -> grayf32 SIGFPE
swscale internals don't distinguish between 16-bit and higher bit depth
output formats internally when it comes to the choice of intermediate
representation.

Clamping this value both prevents a SIGFPE and also aligns the check
with reality.
2025-03-17 11:40:05 +01:00
9e857e1f8a ffbuild: read library linker objects from a file
The linker command can exceed the maximum argument limit on MinGW,
especially for libavcodec.

The objects list is now stored in a file and passed to the linker.
2025-03-17 15:45:53 +05:30
6bad55eb17 ffv1: add a Vulkan-based decoder
This patch adds a fully-featured level 3 and 4 decoder for FFv1,
supporting Golomb and all Range coding variants, all pixel formats,
and all features, except for the newly added floating-point formats.

On a 6000 Ada, for 3840x2160 bgr0 content at 50Mbps (standard desktop
recording), it is able to do 400fps.
An Alder Lake with 24 threads can barely do 100fps.
2025-03-17 08:51:23 +01:00
caff29dbb1 FFHWAccel: add buffer_ref argument to start_frame
This commit adds a reference to the buffer as an argument to
start_frame, and adapts all existing code.

This allows for asynchronous hardware accelerators to skip
copying packet data by referencing it.
2025-03-17 08:51:23 +01:00
23eb499b28 ffv1dec: add support for hwaccels
This commit adds support for hardware accelerated decoding to
the decoder.
The previous commits already refactored the decoder, this commit
simply adds calls to hooks to decode.
2025-03-17 08:49:16 +01:00
53ff9005b5 vulkan: add support for AV_PIX_FMT_GBRAP32 2025-03-17 08:49:15 +01:00
4de023f953 vulkan: add ff_vk_exec_add_dep_wait_sem()
This adds a function which adds a regular timeline semaphore
as a wait-only dependency.
2025-03-17 08:49:15 +01:00
f2a0bdd6b1 vulkan: unify handling of BGR and simplify ffv1_rct 2025-03-17 08:49:15 +01:00
dd7cc557af ffv1enc_vulkan: clip micro_version to 3 for level 4
This unbreaks level 4 encoding.
2025-03-17 08:49:14 +01:00
b2ebe9884e ffv1enc_vulkan: refactor code to support sharing with decoder
The shaders were written to support sharing, but needed slight
tweaking.
2025-03-17 08:49:14 +01:00