Commit Graph
7129 Commits
Author SHA1 Message Date
张永鹏 d09b0c5e17 fftools/ffmpeg_opt: return an error when refusing overwrite
Return EEXIST when output overwrite is refused so ffmpeg exits with a
non-zero status for -n and interactive no responses.

Signed-off-by: 张永鹏 <roc63@outlook.com>
2026-08-02 11:33:56 -05:00
Andreas Rheinhardt a59498db08 avcodec/huffyuvdsp: Remove pix_fmt parameter from ff_huffyuvdsp_init()
It is unused since the mmx add_hfyu_median_pred_int16 function
has been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:19:05 +02:00
Andreas Rheinhardt c8fb970a92 avcodec/x86/huffyuvdsp: Remove ff_add_hfyu_median_prediction_mmxext
Superseded by SSE4. This makes the huffyuv decoders ABI compliant,
e.g. nothing messes up the FPU state at all any more. Therefore
the emms_c() can be removed from huffyuvdec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:19:04 +02:00
Andreas Rheinhardt eb40b0b6b7 tests/checkasm/huffyuvdsp: Add test for add_hfyu_median_pred_int16
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt b1142ed5be tests/checkasm/huffyuvdsp: Actually test width not multiple of 16
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt dd8730cfe3 tests/checkasm/huffyuvdsp: Actually test masks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt 7c9d1fd3c0 tests/checkasm/huffyuvdsp: Return early if there is no function to test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt 406c5a37aa avcodec/x86/vc1dsp_inv_trans: Port to SSE2
No change in performance here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt 3db7a55280 avcodec/x86/vc1dsp_loopfilter: Don't use MMX regs
Up until now ff_vc1_v_loop_filter4_ssse3 used MMX registers
despite being an SSSE3 function. Porting it to XMM registers
didn't lead to any change in benchmarks here, but abides
by the ABI (one function less that does not omit emms).
Unfortunately the size of the function increased by 64B
by this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
panboxiaosa b57a3d028d avformat/mov: set video packet durations in presentation order
STTS sample deltas follow decode order, while AVPacket.duration is
defined as the interval to the next PTS in presentation order. Assigning
the deltas directly therefore produces incorrect packet durations for
VFR video with reordered frames.

After index construction and edit-list processing, sort samples by PTS
and set every duration with a following PTS from adjacent presentation
timestamps. This reorders STTS durations where possible and derives
intervals produced by the STTS/CTTS combination when necessary. Keep the
original timing table if allocation fails or timestamps are invalid.

Add FATE coverage for the official VFR H.264 sample and for a generated
MPEG-4 case whose presentation intervals are not a permutation of its
STTS deltas. Update the HEVC dts2pts CRA reference for the corrected
presentation-order durations.

Signed-off-by: panboxiaosa <panboxiaosa@gmail.com>
2026-07-29 23:49:33 +00:00
Kacper Michajłow 848fb754dd avformat/hls: don't discard target segment's first keyframe when seeking
Segment starts on the seek timeline are derived from EXTINF durations,
so the first keyframe of the target segment can have a slightly lower
DTS than the snapped seek position, in which case the packet discard
loop would skip it and resume playback one segment late. Make sure we
start at the very beginning of the stream in this case.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-07-28 18:01:18 +02:00
Kacper Michajłow 84bc576371 avformat/hls: set stream start_time for all playlist types
Rebase the first packet's timestamp onto the start of the segment list
regardless of playlist type, and report it as start_time. Previously
only EVENT playlists did this and live streams took start_time from the
first loaded segment at the live edge. Which is not correct as some
servers provide very deep (hours even) time shift in live playlist. The
evicted segments are already tracked by EXT-X-MEDIA-SEQUENCE. This
allows us to use all available segments, not only the future ones on
live playlist.

Also prefer PTS over DTS, as EXTINF durations and start_time are
presentation time.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-07-28 18:01:18 +02:00
Kacper Michajłow b449f86287 tests/fate/pcm: add fate-pcm_dvda test
Input is cut down version of https://samples.mplayerhq.hu/DVD-Audio/ats.AOB

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-07-28 17:55:33 +02:00
Christopher Decker 94ff335d76 avformat/os_support: fix return value of win32_rename
The return value of MoveFileExW was not being correctly interpreted,
see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw.

On Windows a failed rename over the file: protocol now surfaces as failed to rename file %s to %s:
Operation not permitted (ff_rename, libavformat/avio.c:867) plus an AVERROR(EPERM) return, where previously the muxer
reported success and the user was left with a missing or stale output file and no diagnostic. This affects the
write-to-temp-then-rename paths in hlsenc, dashenc, hdsenc, smoothstreamingenc, segment, and img2enc (e.g. HLS/DASH
playlist updates, -write_temp_file, segment list finalization).

Also, added unit tests to exercise the rename function.

Signed-off-by: Christopher Decker <chris.decker08@gmail.com>
2026-07-28 04:59:01 +00:00
Andreas Rheinhardt c6309b5c63 tests/checkasm/h264pred: Avoid declare_func_emms
This is possible after the recent MMX->XMM conversions
and preferable as it makes the test stricter.

Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-28 00:54:20 +02:00
Andreas Rheinhardt 42970ac7e2 tests/checkasm/checkasm: Map rnd to checkasm_rand_uint32
Before the switch to libcheckasm, rnd returned an unsigned value;
now it only returns a signed value in the range 0..INT_MAX,
so that the sign bit is not random at all. This means that when
rnd is used to initialize four bytes at a time, one bit is not random.
Fix this by mapping rnd to checkasm_rand_uint32().

Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-28 00:53:50 +02:00
Timo Rothenpieler 2be4a694a3 Revert "fate: disable tests that depend on premultipled conversion"
This reverts commit 336b175c9f.
2026-07-27 20:34:37 +02:00
Timo Rothenpieler 7e1f4dc318 Reapply "avfilter/avfiltergraph: always retry format negotiation after auto-filters"
This reverts commit cd9d265344.
2026-07-27 20:13:00 +02:00
Nicolas George 336b175c9f fate: disable tests that depend on premultipled conversion
They can be re-enabled onece automatic conversion of
premultiplied alpha is fixed.
2026-07-27 16:07:38 +02:00
Nicolas George cd9d265344 Revert "avfilter/avfiltergraph: always retry format negotiation after auto-filters"
This reverts commit 978a0821ee.

The stability of the negotiation process has never been studied
with multiple rounds.

It has always been documented to users that scale was the filter
to insert to manage format conversions. A second filter for
a specific type of conversion should never have been added:
the proper fix for the issue that this commit tried to fix is
to give scale the ability to handle premultiplication too.
2026-07-27 10:27:27 +02:00
Nathan Lucas 7002e01c19 tests/fate/spdif: add TrueHD branch padding test
Add a small synthetic TrueHD sample that exercises large MAT padding in
spdifenc. The sample covers both the input_timing path with padding above
MAT_FRAME_SIZE / 2 and the output_timing discontinuity path.

It also verifies queued MAT frame emission when one input packet completes
more than one MAT frame.

Signed-off-by: Nathan Lucas <nlucasgit@gmail.com>
2026-07-25 20:12:16 -06:00
Zuxy Meng 1a0747633c avcodec/x86/h264_intrapred: Deprecate MMX from pred8x8l_horizontal_down_8
Convert use of MMX to SSE2, also fix checkasm test.

Before:
 pred8x8l_horizontal_down_8_sse2:                        33.2 ( 2.53x)
 pred8x8l_horizontal_down_8_ssse3:                       27.8 ( 3.02x)

After:
 pred8x8l_horizontal_down_8_sse2:                        24.3 ( 3.45x)
 pred8x8l_horizontal_down_8_ssse3:                       22.6 ( 3.71x)

Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
2026-07-24 19:16:45 -07:00
Zuxy Meng 14dfce5eaf avcodec/x86/h264_intrapred: SSE2 impl. of pred8x8_dc_rv40_8
Deprecate MMX. No change in performance. Also add test coverage in
checkasm.

pred8x8_dc_rv40_mmxext:                                 10.0 ( 1.24x)
pred8x8_dc_rv40_sse2:                                   10.0 ( 1.24x)

Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
2026-07-24 19:16:45 -07:00
James Almer afb74faff6 tests/ref: update references
Missed in 642ae726ff after a faulty rebase.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-22 21:14:07 -03:00
James Almer 9c8fc66ce1 tests/fate/matroska: add a test for Track Timescale handling
Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-22 20:50:14 -03:00
Philip Langdale 2cf3f4d64d avutil/hwcontext_cuda: remove format allowlist, accept any pixel format
Remove the static supported_formats[] allowlist from hwcontext_cuda.
cuda_frames_get_constraints() now iterates all registered pixel formats
and includes every non-hwaccel, non-palette format. cuda_frames_init()
validates with av_pix_fmt_desc_get() instead of checking against the
allowlist.

Palette formats have a special-cased use of plane[1] for the palette itself
and it's not worth the hassle of supporting in an otherwise clean generic
copy loop.

Also add a roundtrip test that uploads a deterministic byte pattern to
CUDA, downloads it back, and verifies the data match. This tests all
non-hwaccel pixel formats. The test is gated on CONFIG_CUDA.
2026-07-22 21:42:40 +00:00
StachowiakDawid c182b1c09c Add new mode to mpdecimate video filter 2026-07-20 17:49:47 +00:00
Lynne 3a8a1a7c6a avcodec/aacpsy: fix the attack lookback
This fixes a 15+ year old bug.

The novelty check read its previous-frame envelope from
prev_energy_subshort after the sub-block loop had already overwritten
it with current-frame values, so early sub-blocks were compared
against the frame's own future instead of the past. That accident
suppressed short-period pitch trains well enough, but also suppressed
genuine onsets, and could not see pulse periods beyond ~12ms at all:
on quiet slow pulse trains (engine-idle buzz and the like) the ratio
test leaks sporadic isolated short excursions, each an audible click -
reported against this encoder since 2015, at every bitrate, and
immune to disabling every coding tool.

Keep a rolling two-frame history of HP sub-block peaks instead and
require an attack to tower over it: within ~12ms unconditionally
(pitch-rate trains), and within ~44ms when coming from steady
long-window state (slow trains, where an isolated short excursion can
only click). Dense irregular transients tower locally and reset
frames_since_short, so their block switching is untouched.
2026-07-19 23:50:55 +08:00
Lynne 9d0a4132ff avcodec/aacenc: rework NMR stereo decisions, retune coded bandwidth
Stereo decisions are made per band before quantization, from the psy
model's spectra, and carry cross-frame memory (EMA-smoothed statistics,
per-grid mode banks, leave-hysteresis) so the image holds instead of
churning:

  * M/S adopts content-driven and rate-free (side under half the mid);
    for mid-dominant bands M/S is simply the better coding at every
    rate, and a wandering L/R fraction reads as image instability.
  * I/S competes with M/S above 6.1 kHz instead of only seeing M/S
    rejects (which are exactly the wide bands it cannot render), and
    engages under SUSTAINED strain only: the pressure ramp gated by the
    lambda floor, so pressure spikes at a comfortable operating point
    cannot flood it onto content where coding the side is affordable
    and strictly better. Unengaged candidates fall back to M/S.
  * Pairs whose joint-tool candidacy fraction stays low decouple:
    block switching goes per-channel and M/S stops, matching how
    independent coding wins on diffuse decorrelated content.
  * PNS in a pair is reserved for clearly-wide bands (it renders
    uncorrelated noise per channel).

Block switching for a pair is decided through the psy window_pair()
hook so common_window survives transients.

The NMR rate-to-bandwidth table is retuned upward at >= 48 kbps/ch to
track the bandwidth strong encoders deliver; both quality metrics
improve on a 16-clip battery and wider regresses. Lower rates are
unchanged.
2026-07-19 20:41:53 +08:00
Lynne 646f2796c8 avcodec/aacenc: rework NMR rate control, pool CPE budgets, add decision memory
Rate control: replace the integral servo with a stateless pressure
offset (exp2(-K*fill/R)) so a drained reservoir cannot wind up and
crater quality after loud stretches; slew-limit the final operating
lambda per frame (bits deviate instead, the reservoir absorbs); seed
the reservoir full at stream start; and track rate strain explicitly:
a long-frame lambda EMA against anchors that scale up when the achieved
distortion/mask ratio flags noise-class content (whose psy masks are
wholesale violated and lambda reads inflated), plus a lambda min-tracker
separating sustained starvation from transient spikes at a comfortable
operating point. The resulting pressure ramp gates every
pressure-adaptive tool from one place.

CPE budget pooling: solve both channels of a pair jointly under one
shared lambda against a pooled budget (NMRSlot defer/solve/commit)
instead of an equal per-channel split, which starved the mid/carrier
while the side gold-plated. Mono and VBR output are unchanged.

Transients: isolated onsets are coded uniformly finer across the short
run and repaid from steady stretches; dense-beat runs get a
starvation-scaled boost; a transition premask clamps START-frame
thresholds toward the previous long frame (an attack cannot mask
backwards).

Decision memory: marginal per-frame re-decisions oscillate audibly, so
every stateful choice now carries hysteresis - band zeroing, PNS
enter/leave with debounce (and near-masked bands staying noise until a
loudness guard), per-grid stereo mode banks that survive window
switches, and the short-TNS accept state.

TNS-covered bands price distortion by the synthesis filter's
re-amplification gain, so the trellis spends where noise will actually
be heard.
2026-07-19 20:41:52 +08:00
张永鹏 629a5b4b0f fftools: reject negative -t durations
Reject negative recording durations for input and output -t before they reach streamcopy or trim handling. Keep -t 0 accepted.

Signed-off-by: 张永鹏 <roc63@outlook.com>
2026-07-18 12:04:01 -05:00
Romain Beauxis 63b7e4cefa lavf/oggparsevorbis: rework timestamp offset and end trimming
Replace the first-page packet scan with a direct use of the first
packet's duration as the timestamp offset (the Vorbis I spec
guarantees it produces no PCM output).

Track last_page_granule to correctly anchor EOS trimming regardless
of any initial granule offset. Track bos_pos to reinitialize parser
state at stream boundaries without resetting at page boundaries.

Restore the granule=0 workaround from ticket #3710 and handle
chained streams by clearing bos_pos when new headers are collected.

Vorbis I spec: https://xiph.org/vorbis/doc/Vorbis_I_spec.html
2026-07-18 15:48:34 +00:00
Romain Beauxis de038122a3 tests/fate/ogg-vorbis.mak: add test to show packets initial padding and
side data.
2026-07-18 15:48:34 +00:00
Romain Beauxis b79eae1af4 libavformat/id3v2enc.c: add write support for COMM/USLT descriptor+lang keys 2026-07-18 09:59:57 -05:00
Romain Beauxis b0c702aec2 libavformat/id3v2: deprecate legacy COMM descriptor-as-key behavior 2026-07-18 09:59:57 -05:00
Romain Beauxis eb107d8772 libavformat/id3v2.c: Factor out support for reading lyrics and comment
tags.
2026-07-18 09:59:57 -05:00
Romain Beauxis 9dcb14d982 tests/fate/id3v2.mak: add test for XXX lang in COMM and USLT frames, fix
comment for -sort test.
2026-07-18 09:59:57 -05:00
Martin Storsjö 8e081d3c31 checkasm: sw_ops: Fix building with older versions of Clang
Older versions of Clang (17 and older) errored out on the previous
form like this:

    ./src/tests/checkasm/sw_ops.c:210:9: error: expected expression
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), "palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^

While newer versions of Clang merely warned about it:

    ./src/tests/checkasm/sw_ops.c:210:9: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), "palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^
2026-07-16 19:49:30 +00:00
Ramiro Polla 1dae8f89b2 swscale/uops: generate more specific masks for unpack when translating
Unused components weren't being taken into consideration.
2026-07-16 08:46:11 +00:00
Vignesh Venkat 5002b55ce7 fate/mov: Add fate test for t35 cdsc track
Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-07-14 15:50:30 -03:00
Niklas Haas e65dab2b59 swscale/tests/sws_ops: rewrite to test uops directly
Instead of awkwardly reverse-engineering each uop to reflect
it back to the corresponding SwsOp, this leverages the new
compile_uops() API to directly test the uop in question.

This is not only vastly simpler but also fixes several major
shortcomings with the previous design, such as always having
to keep the reflection code in sync for any newly added uop,
or not testing uops that get translated to a packed shuffle
fast path.

The major downside is that arch-specific uops can now no longer
be tested against the C reference unless we specifically add
a C reference function for each relevant uop; and also, that the
packed shuffle fast path is currently no longer tested by checkasm.
(But this will be fixed by my upcoming pshufb uop series)

Another downside is that this effectively disables testing for e.g.
aarch64, since it does not yet use the uops architecture.

$ time checkasm --test=sw_ops --repeat=10 # 1.85s -> 1.39s

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-07-14 12:24:01 +00:00
Niklas Haas 44e1b60c6a swscale/uops: consolidate SWS_UOP_{PERMUTE,COPY,MOVE}
Rather than having two uops for the C reference code and a separate
uop for the x86 backend, we can just implement the C reference
using the same register-register assignment logic.

This results in only slightly worse codegen, since the compiler is
smart enough to eliminate the unnecessary copies.

The main downside is the fact that we need to allocate extra stack space
to back-fill the remaining (unused) pointers. In theory, we could do this
more efficiently by re-using unused *input* registers directly, but that
would require a lot of reliance on compile-time constant folding teasing
apart the entire register index tracking loop and duplicate check, so this
is a useful middle ground.

On platforms like x86, we still don't care about the PERMUTE vs
COPY distinction, but it's also harmless (2-3 extra lines to
instantiate the underlying MOVE macro on both uop variants).

Finally, we need to add a mask to the move uops to keep track of which
outputs are actually needed (especially for checkasm). Though it does result
in the rather unfortunate downside that it bloats the names of the uop
names.

The op lists change to reflect the new representation, e.g.:

 rgb24 16x16 -> bgr24 16x16:
   [ u8 +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
     min: {0 0 0 _}, max: {255 255 255 _}
   [ u8 +++X] SWS_OP_SWIZZLE      : 2103
     min: {0 0 0 _}, max: {255 255 255 _}
   [ u8 XXXX] SWS_OP_WRITE        : 3 elem(s) packed >> 0
     ('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
  translated micro-ops:
     u8_read_packed_xyz
-    u8_permute_zyxw
+    u8_permute_xyzw_txz_xzt
     u8_write_packed_xyz

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-07-14 12:24:01 +00:00
Andreas Rheinhardt f769e433a3 Revert "tests/checkasm/vp9dsp: Allow to run only a subset of tests"
This reverts commit 7bc35b8426.
The aim of this patch can now be achieved via checkasm's
--function pattern matching.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-14 10:01:08 +02:00
Michael NiedermayerandFable-5 cff4a69294 avfilter: add latticepal filter
Convert packed 24/32-bit RGB/BGR/RGBA/BGRA input to PAL8 using a per-frame palette
whose colors are placed on a face-centered cubic lattice (realized as the
scaled D3/D4 checkerboard lattice), with a user-supplied density controlling
the number of lattice steps spanning one color axis.

Only lattice points actually used by a frame enter its palette; if a frame
needs more than 256 of them, the filter will itearatively drop palettte
entries and reassign affected pixels until 256 color remain

lookup uses the Conway-Sloane rounding algorithm. Supported dithering
modes: none, ordered 8x8 bayer (swscale), Cluster & Void blue noise and
Floyd-Steinberg error diffusion.

Co-Authored-by: Fable-5
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-13 18:16:18 +00:00
Shreesh Adiga 7b9eeadda0 tests/checkasm/aes: fix memcmp size argument
sizeof(16 * count) evaluates to 4 and thus only the first 4 bytes of aes
output was being compared. Removing the sizeof operator will ensure that
the whole output buffer will be compared.
2026-07-12 19:44:48 +00:00
Jun Zhao a6ed750664 avformat/utils: fix ff_mkdir_p() swallowing intermediate mkdir errors
When creating nested directories (e.g. /a/b/c), a genuine mkdir()
failure for an intermediate component was overwritten by later
attempts, making the original failure harder to diagnose.

Stop immediately on intermediate errors other than EEXIST, preserving
errno for the caller. Existing path components remain non-fatal, as
required by mkdir -p semantics. Add a regression test for creating a
child below an existing parent directory.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-07-12 00:02:40 +00:00
James Almer c16840b826 avcodec/dca_xll: export downmix matrix coefficients
Only for primary channel sets if they embeed coefficients for now.

$ ./ffmpeg -downmix stereo -i $fate-suite/dts/dcadec-suite/xll_51_24_48_768.dtshd -y native.wav

Before:
$ ./ffmpeg -i $fate-suite/dts/dcadec-suite/xll_51_24_48_768.dtshd -af aresample,aformat=channel_layouts=stereo -y swr.wav
[...]
[Parsed_aresample_0] [SWR] Using fltp internally between filters
[Parsed_aresample_0] [SWR] Matrix coefficients:
[Parsed_aresample_0] [SWR] FL: FL:0.414214 FR:0.000000 FC:0.292893 LFE:0.000000 SL:0.292893 SR:0.000000
[Parsed_aresample_0] [SWR] FR: FL:0.000000 FR:0.414214 FC:0.292893 LFE:0.000000 SL:0.000000 SR:0.292893
[Parsed_aresample_0] ch:6 chl:5.1(side) fmt:s32p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[...]

$ tests/tiny_psnr.exe native.wav swr.wav
stddev:21178.05 PSNR:  9.81 MAXDIFF:49613 bytes:     8192/     8192

After:
$ ./ffmpeg -i $fate-suite/dts/dcadec-suite/xll_51_24_48_768.dtshd -af aresample,aformat=channel_layouts=stereo -y swr.wav
[...]
[Parsed_aresample_0] [SWR] Using fltp internally between filters
[Parsed_aresample_0] [SWR] Custom matrix coefficients:
[Parsed_aresample_0] [SWR] FL: FL:-0.100006 FR:0.000000 FC:0.000000 LFE:0.000000 SL:-0.707092 SR:0.000000
[Parsed_aresample_0] [SWR] FR: FL:0.000000 FR:-0.100006 FC:0.000000 LFE:0.000000 SL:0.000000 SR:-0.707092
[Parsed_aresample_0] ch:6 chl:5.1(side) fmt:s32p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[...]

$ tests/tiny_psnr.exe native.wav swr.wav
stddev:    0.71 PSNR: 99.22 MAXDIFF:    1 bytes:     8192/     8192

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-11 19:32:17 -03:00
James Almer 57708daf61 avcodec/dca_core: export downmix matrix coefficients
$ ./ffmpeg -downmix stereo -i $fate-suite/dts/dcadec-suite/core_51_24_48_768_1.dtshd -y native.wav

Before:
$ ./ffmpeg -i $fate-suite/dts/dcadec-suite/core_51_24_48_768_1.dtshd -af aresample,aformat=channel_layouts=stereo -y swr.wav
[...]
[Parsed_aresample_0] [SWR] Using fltp internally between filters
[Parsed_aresample_0] [SWR] Matrix coefficients:
[Parsed_aresample_0] [SWR] FL: FL:0.414214 FR:0.000000 FC:0.292893 LFE:0.000000 SL:0.292893 SR:0.000000
[Parsed_aresample_0] [SWR] FR: FL:0.000000 FR:0.414214 FC:0.292893 LFE:0.000000 SL:0.000000 SR:0.292893
[Parsed_aresample_0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[...]

$ tests/tiny_psnr.exe native.wav swr.wav s16
stddev:18907.06 PSNR: 10.80 MAXDIFF:51590 bytes:     8192/     8192

After:
$ ./ffmpeg -i $fate-suite/dts/dcadec-suite/core_51_24_48_768_1.dtshd -af aresample,aformat=channel_layouts=stereo -y swr.wav
[...]
[Parsed_aresample_0] [SWR] Using fltp internally between filters
[Parsed_aresample_0] [SWR] Custom matrix coefficients:
[Parsed_aresample_0] [SWR] FL: FL:-0.100006 FR:0.000000 FC:0.000000 LFE:0.000000 SL:-0.707092 SR:0.000000
[Parsed_aresample_0] [SWR] FR: FL:0.000000 FR:-0.100006 FC:0.000000 LFE:0.000000 SL:0.000000 SR:-0.707092
[Parsed_aresample_0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[...]

$ tests/tiny_psnr.exe native.wav swr.wav
stddev:    0.02 PSNR:129.44 MAXDIFF:    1 bytes:     8192/     8192

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-11 19:32:17 -03:00
Frank Plowman 265d39e551 lavc/hevc: Always generate missing refs for foll pictures
Since bc1a3bfd2c, missing reference
pictures are not replaced with generated pictures unless `-flags
show_corrupt` is used.  For `ST_FOLL`/`LT_FOLL` reference pictures,
however, generation of missing references is required by the spec per
8.3.3.  We should not require the `show_corrupt` flag to be used in
order to be spec-conformant, so this patch removes the `show_corrupt`
behaviour added in bc1a3bfd2c for
`ST_FOLL`/`LT_FOLL` references and instead unconditionally generates
reference pictures in these sets when unavailable

Fixes: NUT_A_ericsson_5
Fixes: RPS_D_ericsson_6
2026-07-11 20:36:31 +00:00
Romain Beauxis 4641be96e5 fftools/ffmpeg_mux_init.c: delete encoder-specific metadata when re-encoding. 2026-07-11 17:14:43 +00:00