Commit Graph

117851 Commits

Author SHA1 Message Date
Marth64 60434b483c avformat/dvdvideodec: remove auto value for menu_lu option
The "auto" mode serves no functional purpose except for logging
a message and setting the value to 1. The documentation clearly
explains what the option is for.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 4a03e95ff4 avformat/dvdvideodec: default menu_vts option to 1 and clarify description
Menu 0 is the VIDEO_TS root menu, which does not appear to be used
commonly for menu segments. Instead, default to the menu of VTS 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 afc152f564 avformat/dvdvideodec: check the length of a NAV packet when reading titles
Some discs present titles with bogus NAV packets. We apply this check
for menus and for title MPEG blocks, but we should also apply it
for NAV packets during title demuxing.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 a1ae66c827 avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing
DVDs naturally consist of segmented MPEG-PS blobs within a VOB
(i.e. VOBs are not linear). NAV packs set the segment boundaries.
When switching between segments, discontinuities occur and thus
the subdemuxer needs to be reset. The current approach to manage
this is by invoking ff_read_frame_flush() on the subdemuxer context,
via a callback function which is invoked during the menu or dvdnav
block functions. The same subdemuxer context is used throughout
the demux, with a stretched PTS wrap bits value (64) + disabled
overflow correction, and then flushed on each segment. Eventually,
a play_end context variable is set to declare EOF.

However, this approach causes frame drops. The block read flushes the
demuxer before the frame read is complete, causing frames to drop
on discontinuity. The play_end signal likewise ends playback before
the frame read is complete, causing frames to drop at end of the title.
To compound the issue, the PTS wrap bits value of 64 is wrong;
the VOBU limit is actually 32 and the overflow correction should work.

Instead, EOF the MPEG-PS subdemuxer organically when each VOB segment
ends, and re-open it if needed with the offset after the full frame read
is complete. In doing so, correct the PTS wrap behavior to 32 bits and
remove the play_end/segment_started signals and callback pattern.

Note that the timestamps as reported by the NAV packets are known as
"PTMs", so the fields storing the time prior to adjustment are renamed
accordingly. This makes it more clear when we are offsetting the
NAV packet reported timestamps versus what we present as a demuxer.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 1964faa568 avformat/dvdvideodec: simplify dvdvideo_read_packet()
The function has a few branches where it discards frames via
FFERROR_REDO; consolidate is via a goto block to simplify the
function and improve readability. Logging still maintains
all the relevant details for the reason of the discard.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 c1e4b6c676 avformat/dvdvideodec: enable chapter calculation for menus
Menus are generally segmented by cell, so use them as the
marker delimiters. Requires preindex option to be enabled.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 b38ca20bf2 avformat/dvdvideodec: standardize the NAV packet event signal
This consolidates the FFERROR_REDO handling of NAV packets to
dvdvideo_subdemux_read_data(), is a pre-requisite to calculating
chapter markers for menus, and a pre-requisite to fixing the
frame desync issue when the subdemuxer is flushed.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 6bbaa7db49 avformat/dvdvideodec: move memcpy below missed NAV packet warning
Readability improvement; the warning can be bundled beneath
the preceding validations rather than awkwardly between the memcpy
and return.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 e1ace1d314 avformat/dvdvideodec: remove "auto" value for -pg option, default to 1
The default "auto" mode is effectively useless; the reasonable
default use case is to use the first PG (segment) of the
selected PGC for both menus and standard titles. Just
default the value to 1, since the option is irrelevant
unless -pgc is also set.

Note that this should not break users using this advanced option.
The "auto" mode errored and asked for a PG number regardless
for non-menus, and for menus the mode simply defaulted to 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 39c662f541 avformat/dvdvideodec: measure duration of the current menu VOBU in state
This will be a pre-requisite to calculating chapter markers
for menus.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 94346edbbf avformat/dvdvideodec: fix menu PGC number off-by-one in state
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 3ad96243d7 avformat/dvdvideodec: remove unused headers
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marton Balint d884606ce0 avutil/rational: never return greater num/den than the maximum allowed in av_d2q
This reverts 887d74c47e, because it ignores the
maximum allowed numerator/denominator. Even if the result was rounded to zero
or infinity, it should not be cause to ignore the maximum allowed number, this
"feature" is unintuitive and undocumented.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
Marton Balint 25efe34e6f avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate 2024-11-16 20:58:49 +01:00
Marton Balint e9af7b7b5d avutil/opt: do no rely on av_d2q returning higher num/den than allowed when parsing rational opts
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
Rémi Denis-Courmont c3051d94a7 lavc/h264dsp: move RISC-V fn pointers to .data.rel.ro
This should fix PIC builds.
2024-11-16 16:04:24 +02:00
Michael Niedermayer 0b8c9cf5b4
avformat/movenc: Fix ffv1 support
Fixes: Ticket9975

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:16 +01:00
Michael Niedermayer a5c0ed2122
avcodec/ffv1: Support >8bit rice golomb
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:16 +01:00
Michael Niedermayer 967e5e8f6f
avcodec/ffv1: Support slice coding mode 1 with golomb rice
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:15 +01:00
Peter Ross 6ccd16dda2 configure: add rv60 decoder golomb dependency
Fixes standalone compilation of the rv60 decoder.
2024-11-16 19:08:39 +11:00
Peter Ross 7b3bc4a45b avcodec/rv60: consistent indentation 2024-11-16 19:08:39 +11:00
Peter Ross f7e7d63cbc avcodec/rv60: simplify fill_mv_skip_cand 2024-11-16 19:08:39 +11:00
Peter Ross 566b737a7a avcodec/rv60: loosen fill_mv_skip_cand top right and bottom left criteria
Fixes ticket #11293.
2024-11-16 19:08:39 +11:00
Marth64 7332b1700e avformat/sapdec: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-15 20:18:12 -06:00
Kyosuke Kawakami a5f0daf843 avcodec/x86/diracdsp_init: remove unused macro
PIXFUNC macro is unused since d29a9c2aa6.

Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:46:05 -05:00
Kyosuke Kawakami 61aa532e22 avcodec/x86/diracdsp: migrate last remaining MMX function to SSE2
The add_dirac_obmc8_mmx function was the only MMX function left. This
patch migrates it to SSE2.

Here are the checkasm benchmark results:

diracdsp.add_dirac_obmc_8_c:    2299.1 ( 1.00x)
diracdsp.add_dirac_obmc_8_mmx:   237.6 ( 9.68x)
diracdsp.add_dirac_obmc_8_sse2:  109.1 (21.07x)

Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:52 -05:00
Kyosuke Kawakami 8f683ee417 avcodec/x86/diracdsp: cast stride argument
Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:34 -05:00
Kyosuke Kawakami 0e5e37d32c avcodec/x86/diracdsp: fix wrong register load/use count
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:14 -05:00
Kyosuke Kawakami 711290f9a3 checkasm/diracdsp: test add_dirac_obmc
Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:44:53 -05:00
Michael Niedermayer 07904231cb
doc/infra: Document gitolite
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-14 21:50:51 +01:00
James Almer 322b240cea avcodec/hevc/sei: remove unnecessary inline function
It's a pointless indirection.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer 2d3281b9dd avcodec/hevc/sei: remove unused inline function
It's also a pointless indirection.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer 66014c79ab avcodec/h2645_sei: move some common SEI syncing code to ff_h2645_sei_ctx_replace()
Instead of duplicating it across all supported decoders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer edc7b67508 avformat/iamf: use the new Binaural channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
James Almer 20af68b63a avutil/channel_layout: add Binaural channels and layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
Leo Izen 18883fbcab
avcodec/jpegxl_parser: fix reading lz77-pair as initial entropy symbol
The JPEG XL parser has an entropy decoder inside, which supports LZ77
length-distance pairs. If the first symbol from the entropy stream is an
LZ77 pair, the bitstream is invalid, so we should abort immediately rather
than attempt to read it anyway (which would read from the uninitialized
starting window).

Reported-by: Kacper Michajłow <kasper93@gmail.com>
Found-by: ossfuzz
Fixes: 368725676/clusterfuzz-testcase-minimized-fuzzer_protocol_file-6022251122589696-cut
Fixes: 42537758/clusterfuzz-testcase-minimized-fuzzer_protocol_file-5818969469026304-cut
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-11-13 10:26:28 -05:00
Ronald S. Bultje a5dabfc9c0 enc_recon_frame_test: don't print an error on EOF.
Before:
$ make tools/enc_recon_frame_test
$ tools/enc_recon_frame_test ~/Movies/cif/bus_cif.y4m libx264 'tune=psnr'
Error submitting a frame for encoding

After:
All 150 encoded frames match
2024-11-13 09:26:22 -05:00
compn e35587250c doc/infra: add reddit sub, facebook page and wikipedia 2024-11-13 08:04:13 +10:00
compn 455db6fe10 MAINTAINERS: remove arpi 2024-11-13 02:15:59 +10:00
James Almer e7bdaadce6 avformat/mov: check that items are allocated before accessing them
Fixes NULL pointer dereferences introduced in 2e338152a2

Fixes: clusterfuzz-testcase-fuzzer_loadfile-4753810267897856
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6042587212873728
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6536211629408256

Reported-by: kasper93
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-12 12:23:32 -03:00
Marton Balint fe18ed3f2a avfilter/f_loop: fix aloop activate logic
The logic did not follow the documented behaviour and that caused skipping of
some audio in the loop and in the leftover buffer.

Example command line which should produce a smooth sine wave for the whole
duration of the output:

ffmpeg -f lavfi -i "sine=r=48000:f=480:d=4" -af "aloop=loop=4:start=48000:size=48000" out.wav

Fixes ticket #11283.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
Marton Balint b33a594160 avfilter/f_loop: fix length of aloop leftover buffer
If the audio loop stops inside an audio frame, the leftover buffer contains the
end of the frame, which is not looped. The length supposed to be the part which
was not written to the loop buffer, so we need to drain exactly that number of
bytes from the leftover buffer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
James Almer 97c5cc3a5c Revert "avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code"
This reverts commit 24141a7140.
It was a change made by looking at an old spec version.
2024-11-11 17:11:15 -03:00
James Almer e33b162c7d avcodec/h2645_sei: use the RefStruct API for film_grain_characteristics
And ensure the buffer is synced between threads.
Based on a patch by Dale Curtis <dalecurtis@chromium.org>

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer fd4a2c9b02 avcodec/aom_film_grain: allocate film grain metadata dynamically
This removes the ABI breaking use of sizeof(AVFilmGrainParams), and achieves the
same size reduction to decoder structs as 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer 24141a7140 avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code
The value is 16 bits big endian, not a single byte.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:10 -03:00
James Almer 91b6ba653e Revert "avcodec/h2645: allocate film grain metadata dynamically"
AVFilmGrainAFGS1Params, the offending struct, is using sizeof(AVFilmGrainParams)
when it should not. This change also forgot to make the necessary changes to the
frame threading sync code.
Both of these will be fixed by the following commit.

H274FilmGrainDatabase will be handled later.

This reverts commit 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 15:26:21 -03:00
James Almer 9ec042c1aa avcodec/x86/vvc: add prototypes for OF functions
And wrap the implemtation in preprocessor checks.
Should fix ticket #11282.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 19:34:11 +08:00
Frank Plowman 1e5f24d1a6 lavc/vvc: Remove floating point logic
This was the only floating point logic in the native VVC decoder.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-11-11 19:31:00 +08:00
Zhao Zhili 994368be8f x86/vvc: Fix build error for arch x86_32
There were static functions which built for x86_32, but the simd
functions they reference only available for x86_64.
2024-11-11 19:30:09 +08:00