Set non-default values for the AC-3, E-AC-3 and fixed-point AC-3
decoder options, decode a frame so that the exported downmix fields
hold values set from the frame header, flush with
avcodec_flush_buffers(), and check that all values are still readable
afterwards. This is a regression test for the decoders forgetting
options such as drc_scale on flush.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Decode one PCM packet carrying AV_PKT_DATA_SKIP_SAMPLES and print how
many samples are output, for samples skipped at the start of the frame
and padding discarded at its end, alone, together, overlapping, and with
a padding larger than the frame.
The reference records the current behaviour.
Add an API test for hevc_mp4toannexb parameter set deduplication,
covering extradata insertion, exact payload deduplication, retaining
differing parameter sets (PPS 0 vs PPS 1), filler SEI preservation,
many nonmatching in-band PPS copies, duplicate extradata parameter set
deduplication, exceeding MAX_EXTRADATA_NALS limit rejection, leading
prefix SEI before matching VPS/SPS, out-of-order in-band parameter sets,
and prefix SEI dependency barriers across multiple parameter sets.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Print the serialized sample descriptions for ASS headers without styles
and with an explicit Serif style, and compare them with a FATE reference.
Signed-off-by: Sahitya Chandra <sahityajb@gmail.com>
Assisted-by: Fairy
Add self-contained FATE coverage for ASTC LDR, HDR, profile mismatch,
3D-block, and ASTC/KTX container paths. Exercise both KTX color profiles
and inspect the generated KTX enum and single-mipmap header fields directly
so the test does not rely solely on FFmpeg's matching demuxer.
Cover the KTX linear default as well: the linear GL internal format says
nothing about the endpoint formats the blocks use, so a linear texture
carrying HDR endpoints has to decode like an explicit -dec_profile
hdr-ldr-a request instead of coming back as the magenta mismatch colour.
Declare the lavfi, filter, codec, muxer, and demuxer dependencies used by
each test, and keep generated negative-test files in the FATE cleanup set.
The HDR test hashes frames converted to the explicitly little-endian
gbrapf32le, so its bytewise output does not depend on the host endianness.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
It doesn't use any internals of lavc. Converting it to an API
test tool reduces disk usage for shared builds.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This is possible because it only uses the public API;
and beneficial when using shared builds (as not all
the internals of lavf are linked statically in the binary).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Add tests/api/api-enc-parser-test.c, a generic encoder+parser round-trip
test that takes codec_name, width, and height on the command line
(defaults: h261 176 144).
Three cases are tested:
garbage - a single av_parser_parse2() call on 8 bytes with no Picture
Start Code; verifies out_size == 0 so the parser emits no spurious data.
bulk - encodes 2 frames, concatenates the raw packets, feeds the whole
buffer to a fresh parser in one call, then flushes. Verifies that
exactly 2 non-empty frames come out and that the parser found the PSC
boundary between them.
split - the same buffer fed in two halves (chunk boundary falls inside
frame 0). Verifies the parser still emits exactly 2 frames when input
arrives incrementally, and that the collected bytes are identical to
the bulk output (checked with memcmp).
Implementation notes: avcodec_get_supported_config() selects the pixel
format; chroma height uses AV_CEIL_RSHIFT with log2_chroma_h from
AVPixFmtDescriptor; data[1] and data[2] are checked independently so
semi-planar formats work; the encoded buffer is given
AV_INPUT_BUFFER_PADDING_SIZE zero bytes at the end; parse_stream()
skips the fed chunk if consumed==0 to prevent an infinite loop.
Two FATE entries in tests/fate/api.mak: QCIF (176x144) and CIF
(352x288), both standard H.261 resolutions.
Signed-off-by: Soham Kute <officialsohamkute@gmail.com>
Besides being write only it had the wrong type:
An uint8_t is definitely not enough to store the size
of these buffers.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.
Keep it for external users in order to not cause breakages.
Also improve the other headers a bit while just at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Use av_ts2str() for AVFrame.pkt_dts/pts to avoid print the
pkt_dts/pts as negative number like:
"0, 3616613, -9223372036854775808, 1001, 3110400, 0x75e37a65"
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
avdevice_register_all() is still required to register devices into
lavf (this is required due to lavd being somewhat of a hack).
Signed-off-by: Josh de Kock <josh@itanimul.li>