Commit Graph

5695 Commits

Author SHA1 Message Date
xufuji456 1e91a39502 checkasm: pass context as pointer
Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-04-13 15:17:04 +03:00
xufuji456 30def6365d checkasm/hevc: add transform_luma test
Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-04-13 15:17:04 +03:00
Anton Khirnov 81cca3dae3 fftools/sync_queue: make sure audio duration matches sample count
For audio AVFrames, nb_samples is typically more trustworthy than
duration. Since sync queues look at durations, make sure they match the
sample count.

The last audio frame in the fate-shortest test is now gone. This is more
correct, since it outlasts the last video frame.
2023-04-09 15:47:45 +02:00
James Almer 30f1f89572 fate/matroska: add HDR10+ muxing tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
James Almer bda44f0f39 avformat/matroskaenc: support writing Dynamic HDR10+ packet side data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
J. Dekker 68c151cb1b checkasm: add hevc_deblock chroma test
Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-04-06 06:16:57 +02:00
Michael Niedermayer 916be62da1
tests/fate/vcodec.mak: drop strict experimental from j2k tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-06 00:49:34 +02:00
Marton Balint 88da4b5fcd fate: split mxf test dependencies to DV and MPEG2
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-06 00:40:42 +02:00
James Almer 1c2a1e0750 avformat/matroskaenc: write a MaxBlockAdditionID element
A non zero value is mandatory for Matroska if the track has blocks with BlockAdditions.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
Michael Niedermayer c6dedaf491
tests: Add more j2k tests to cover a wider range of cases
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:52 +02:00
Michael Niedermayer 816676085e
avcodec/j2kenc: Fix funky bpno errors on decoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:49 +02:00
James Almer d6e30291db fate/lavf-container: add missing swscale deps to mxf_dvcpro100 and mxf_ffv1
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-28 08:54:39 -03:00
J. Dekker 2e61ae2cbe fate: specify EC-off for damaged inter samples
The previous commit allowed turning on error correction for interlaced
samples. Turning it off amounts to a no-op for FATE. These samples
should be tested with EC1-3 (guess_mvs/deblock/favor_inter)
additionally.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-03-27 14:00:05 +02:00
Jerome Martinez 174ca11d91 avformat/mxfenc: fix stored/sampled/displayed width/height
According to MXF specs the Stored Rectangle corresponds to the data which is
passed to the compressor and received from the decompressor, so they should
contain the width / height extended to the macroblock boundary.

In practice however width and height values rounded to the upper 16 multiples
are only seen when muxing MPEG formats. Therefore this patch changes stored
width and height values to unrounded for all non-MPEG formats, even macroblock
based ones.

For DNXHD the specs (ST 2019-4) explicitly indicates to use 1080 for 1088p.
For ProRes the specs (RDD 44) only refer to to ST 377-1 without precision but
no known commercial implementations are using rounded values.
DV is not using 16x16 macroblocks, so 16 rounding makes no sense.

The patch also fixes Sampled Width / Display Width to use unrounded values.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-26 22:04:44 +02:00
James Almer 20dade27d9 fftools/ffprobe: print crop_* frame fields
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-26 16:39:59 -03:00
Martin Storsjö fd97a16157 tests: Fix fate-source after 0fbae2178b
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-03-26 12:39:16 +03:00
Michael Niedermayer 5b5fcadea0
avcodec/snowenc: Fix visual weight calculation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-26 01:46:48 +01:00
Jerome Martinez 0fbae2178b avformat/mxfenc: SMPTE RDD 48:2018 Amd 1:2022 support 2023-03-25 19:28:36 +01:00
James Darnley a937723ca9 tests: add bwdif to fate filter tests 2023-03-25 02:38:17 +01:00
James Darnley 087faf8cac checkasm: add test for bwdif 2023-03-25 02:38:17 +01:00
Anton Khirnov e6126abc69 fftools/ffprobe: stop using AVFrame.pkt_{pos,size}
These fields are ad-hoc and will be deprecated. Use the recently-added
AV_CODEC_FLAG_COPY_OPAQUE to pass arbitrary user data from packets to
frames.

Changes the result of the flcl1905 test, which uses ffprobe to decode
wmav2 with multiple frames per packet. Such packets are handled
internally by calling the decoder's decode callback multiple times,
offsetting the internal packet's data pointer and decreasing its size
after each call. The output pkt_size value before this commit is then
the remaining internal packet size at the time of each internal decode
call.

After this commit, output pkt_size is simply the size of the full packet
submitted by the caller to the decoder. This is more correct, since
internal packets are never seen by the caller and should have no
observable outside effects.
2023-03-20 10:42:09 +01:00
James Almer 14719b7939 fate: add a yuv422p test for the untile filter
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-16 16:07:40 -03:00
Zhao Zhili 9e1ffeda8c fate/mov: add PCM in mp4 test
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
James Almer e60cd2e98b fate/vpx: add a vp9_superframe_bsf test
This splits a sample and merges it again, so it also tests the vp9_superframe_split bsf

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-10 16:27:05 -03:00
James Darnley e50a02b0f6 tests: actually test yadif's 10 and 16-bit functions 2023-03-06 21:41:24 +01:00
Leo Izen fadfa147f8
avcodec/pngdec: read colorspace info when decoding with AVDISCARD_ALL
These chunks are lightweight and it's useful information to have when
running ffmpeg -i or ffprobe, for example.
2023-02-28 14:45:01 -05:00
Pierre-Anthony Lemieux d80f3debe2
fate/imfdec: remove imf experimental flag
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-02-21 19:38:54 -08:00
Pierre-Anthony Lemieux 42bf52b4c5
fate/imfdec: add audio test
Adds a test where the temporal boundaries of audio and video resources do not line up.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-02-18 14:41:20 -08:00
Jan Ekström 02ddfeadbe avformat/movenc: allow writing out channel count in MP4 and 3GP
ISOBMFF (14496-12) made this field ('channelcount') in the
AudioSampleEntry structure non-template¹ somewhere before the
release of the 2022 edition. As for ETSI TS 126 244 AKA 3GPP
file format (V16.1.0, 2020-10), it does not seem contain any
references limiting the channelcount entry in AudioSampleEntry
or in its own definition of EVSSampleEntry.

fate-mov-mp4-chapters test had to be adjusted as it output a
mono vorbis stream, which would now be properly marked as such
in the container.

1: As per 14496-12:
   Fields shown as “template” in the box descriptions are fields
   which are coded with a default value unless a derived
   specification defines their use and permits writers to use
   other values than the default.
2023-02-14 21:10:42 +02:00
rcombs 18cd65998b ffprobe: report the corrupt flag on packets
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-02-09 12:45:53 +01:00
Jan Ekström 9a820ec8b1 ffmpeg: add video heartbeat capability to fix_sub_duration
Splits the currently handled subtitle at random access point
packets that can be configured to follow a specific output stream.
Currently only subtitle streams which are directly mapped into the
same output in which the heartbeat stream resides are affected.

This way the subtitle - which is known to be shown at this time
can be split and passed to muxer before its full duration is
yet known. This is also a drawback, as this essentially outputs
multiple subtitles from a single input subtitle that continues
over multiple random access points. Thus this feature should not
be utilized in cases where subtitle output latency does not matter.

Co-authored-by: Andrzej Nadachowski <andrzej.nadachowski@24i.com>
Co-authored-by: Bernard Boulay <bernard.boulay@24i.com>

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-02-03 16:17:29 +02:00
Lynne bbe95f7353
x86: replace explicit REP_RETs with RETs
From x86inc:
> On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either
> a branch or a branch target. So switch to a 2-byte form of ret in that case.
> We can automatically detect "follows a branch", but not a branch target.
> (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.)

x86inc can automatically determine whether to use REP_RET rather than
REP in most of these cases, so impact is minimal. Additionally, a few
REP_RETs were used unnecessary, despite the return being nowhere near a
branch.

The only CPUs affected were AMD K10s, made between 2007 and 2011, 16
years ago and 12 years ago, respectively.

In the future, everyone involved with x86inc should consider dropping
REP_RETs altogether.
2023-02-01 04:23:55 +01:00
Leo Izen 2548c32cc1
avcodec/png: use libavutil/csp.h for cHRM chunks
The cHRM chunk is descriptive. That is, it describes the primaries that should
be used to interpret the pixel data in the PNG file. This is notably different
from Mastering Display Metadata, which describes which subset of the presented
gamut is relevant. MDM describes a gamut and says colors outside the gamut are
not required to be preserved, but it does not actually describe the gamut that
the pixel data from the frame resides in. Thus, to decode a cHRM chunk present
in a PNG file to Mastering Display Metadata is incorrect.

This commit changes this behavior so the cHRM chunk, if present, is decoded to
color metadata. For example, if the cHRM chunk describes BT.709 primaries, the
resulting AVFrame will be tagged with AVCOL_PRI_BT709, as a description of its
pixel data. To do this, it utilizes libavutil/csp.h, which exposes a funcction
av_csp_primaries_id_from_desc, to detect which enum value accurately describes
the white point and primaries represented by the cHRM chunk.

This commit also changes pngenc.c to utilize the libavuitl/csp.h API, since it
previously duplicated code contained in that API. Instead, taking advantage of
the API that exists makes more sense. pngenc.c does properly utilize the color
tags rather than incorrectly using MDM, so that required no change.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-25 08:09:16 -05:00
Stefano Sabatini 843a446713 ffprobe: fix data hash rendering
Print data hash before side data list, fix wrong nesting level of data hash
element.

In particular, fix trac issue:
http://trac.ffmpeg.org/ticket/7217
2023-01-24 23:58:00 +01:00
Ashyni 69c060bea2 avfilter/vf_cropdetect: add ability to change limit at runtime
Fixes: https://trac.ffmpeg.org/ticket/9851

Signed-off-by: Ashyni <jeffrey.c@tuta.io>
2023-01-24 21:53:53 +01:00
Gyan Doshi 01f46f18db avformat/segment: calculate segment durations correctly.
segment_time and segment_times are defined as duration specifications, not
timestamps, so calculation of segment duration must account for initial
timestamp. Fixed.

FATE ref for segment-mp4-to-ts changed on account of avoiding premature
segment cut at the end of the first segment.
2023-01-16 15:37:59 +05:30
Jan Ekström 5de565107a avcodec/h2645_sei: add support for Ambient Viewing Environment SEI
Defined by H.274, this SEI message is utilized by iPhones to save
the nominal ambient viewing environment for the display of recorded
HDR content. The contents of the message are exposed to API users
as AVFrame side data containing AVAmbientViewingEnvironment.

As the DV RPU test sample is from an iPhone and includes Ambient
Viewing Environment SEI messages, its test result gets updated.
2023-01-13 21:26:27 +02:00
rcombs d3538dd293 lavf/spdifdec: support EAC3
Parsing should probably be enabled for all codecs, at least for headers,
but e.g. the AAC parser produces 1-byte packets of zero padding with it,
so I'm just enabling it for EAC3 for the moment.
2023-01-13 11:22:59 -06:00
James Almer 0431f9805e avcodec/av1_parser: export timing information when present
Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-10 09:08:09 -03:00
Anton Khirnov 260f391893 fftools/ffmpeg: always generate CFR output when -r is used
Current code may, depending on the muxer, decide to use VSYNC_VFR tagged
with the specified framerate, without actually performing framerate
conversion. This is clearly wrong and against the documentation, which
states unambiguously that -r should produce CFR output for video
encoding.

FATE test changes:
* nuv-rtjpeg: replace -r with '-enc_time_base -1', which keeps the
  original timebase. Output frames are now produced with proper
  durations.
* filter-mpdecimate: just drop the -r option, it is unnecessary
* filter-fps-r: remove, this test makes no sense and actually
  produces broken VFR output (with incorrect frame durations).
2023-01-10 11:49:28 +01:00
Anton Khirnov b6742259bf lavc/tests: add a cached bitstream reader test 2023-01-06 11:01:00 +01:00
Anton Khirnov 9177970bca lavc/bitstream: templatize for BE/LE
Allows using both BE and LE bitstream readers in the same file.
2023-01-06 10:49:42 +01:00
James Almer a781279871 avformat/oggenc: don't flush twice when the last packet is side data only
Commit 18f24527eb accidentally made side data only packets be handled like a
flush request. Fix this regression by effectively ignoring them as was the
original intention.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-03 21:35:03 -03:00
Clément Bœsch 8057e1a618 avfilter/palettegen: make refs order deterministic
Currently, in case of equality on the first color channel, the order of
the ref colors is defined by the hashing function. This commit makes the
sorting deterministic and improve the hierarchical ordering.
2023-01-03 17:18:55 +01:00
Clément Bœsch 9026d92c13 avfilter/palettegen: base box split decision on a perceptual model
Similar to the change in paletteuse, we rely on a perceptual model to
decide how and where to split the box.
2023-01-03 17:18:55 +01:00
Clément Bœsch dafd43b78d avfilter/palettegen: change cut score from ∑e² to max e²
This is following the results from personal research¹.

¹: https://github.com/ubitux/research/tree/main/color-quantization#results
2023-01-03 17:18:55 +01:00
Clément Bœsch 86bced7c65 avfilter/palettegen: define the best axis to cut using the squared error
This is following the results from personal research¹.

¹: https://github.com/ubitux/research/tree/main/color-quantization#results
2023-01-03 17:18:55 +01:00
Clément Bœsch a0587c0219 avfilter/paletteuse: switch to a perceptual model
Now the selection of the color is based on a distance built around human
perception of color instead of the unreliable sRGB triplet one.
2023-01-03 17:18:55 +01:00
James Almer 18f24527eb avformat/oggenc: ignore empty packets
Some encoders, like flac, can send side data only packets at the end.
Eventually, said extradata update should ideally be used to update the header
when writting to seekable output, but for now, ignore them.

Should fix the undefined behavior of passing NULL to memcpy().

Signed-off-by: James Almer <jamrial@gmail.com>
2022-12-27 11:03:18 -03:00
Leo Izen cd9dd03006 avcodec/pnm: avoid mirroring PFM images vertically
PFM (aka Portable FloatMap) encodes its scanlines from bottom-to-top,
not from top-to-bottom, unlike other NetPBM formats. Without this
patch, FFmpeg ignores this exception and decodes/encodes PFM images
mirrored vertically from their proper orientation.

For reference, see the NetPBM tool pfmtopam, which encodes a .pam
from a .pfm, using the correct orientation (and which FFmpeg reads
correctly). Also compare ffplay to magick display, which shows the
correct orientation as well.

See: http://www.pauldebevec.com/Research/HDR/PFM/ and see:
https://netpbm.sourceforge.net/doc/pfm.html for descriptions of this
image format.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-12-27 10:41:25 -03:00