Commit Graph

117812 Commits

Author SHA1 Message Date
tangsha 8a5b74f98b delete unused variable ret 2024-11-17 20:56:41 +08:00
Rémi Denis-Courmont 1912c86af6 sws/range_convert: fix RISC-V chrFromJpeg 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 55aa81d5cc checkasm: add RISC-V vector width to arch info 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 42dd1f1cf1 tests/cpu: print the RISC-V Vector length 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont fd8cbfec3d lavc/vp8dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont 690c015758 lavc/h264dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Marth64 1d55f54846 avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration
There is no reason to accept timestamp values beyond what dvdnav
reported as the duration of the title.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 0912407b9d avformat/dvdvideodec: discard duplicate or partial AC3 samples
Some DVD muxers signal segments to start with duplicate audio samples
when starting extraction from a chapter marker or terminate seamless PGs
on partial audio samples (causing corrupt AC3 frames). Clean up after
these muxers by tracking frames with duplicate PTS and eliminating
partial AC3 frames.

This results in smoother chapter extraction and overall seeking experience,
with linear PTS and AC3 delay within 32ms (1 frame) away from the video.

The issue was not apparent until the flushing pattern was replaced with
a full subdemux reset, as the flushing dropped the frames prematurely,
along side others, as such they were never present to begin with.
2024-11-16 14:40:51 -06:00
Marth64 f2f238c3a4 avformat/dvdvideodec: drop packets with unset PTS or DTS
The packets effectively serve no purpose and we are already
dropping packets with PTS less than 0. This also creates
for a smoother seeking experience after the subdemuxer
reset fix.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 3656379d92 avformat/dvdvideodec: remove unnecessary need_parsing argument
The value is always AVSTREAM_PARSE_HEADERS.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64 a2c57e27d6 avformat/dvdvideodec: open subdemuxer after initializing IFO headers
It is wasteful to open the subdemuxer if an error occurs while
initializing streams or reading IFO headers.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
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