Files
RetroArch/libretro-common/samples/formats/av1/rav1_webm_fixture.h
T
LibretroAdmin a4172fdafd CI: the lanes Ubuntu 26.04 broke, and the formats warnings
Built with ffmpeg 8, libaom 3.13, x265 4.1, glibc 2.43 and clang 21,
five lanes failed on the 26.04 runners:

- AV1 fixtures: a monochrome sequence comes out full range with no
  matrix whatever is asked for; the oracle takes the colour ffprobe
  reads instead of assuming it.
- Preview audio oracle: ffmpeg 8 leaves a timestamp gap at every seam
  of a -stream_loop copy, which the mixer honours and ffmpeg's raw
  decode does not. trailing_large loops its picture and encodes its
  sound as one track.
- rh265 multi-slice oracle: x265 4.1 writes unreadable slice headers
  when two slices are encoded on several threads; those cases encode
  on one worker.
- vkms: the kernel follows the runner's own release, its modules may
  sit under /usr/lib/modules, and modules-extra is fetched only where
  it exists.
- clang -std=c89 -pedantic: glibc's const-generic strchr/strstr under
  _GNU_SOURCE are _Generic; -Wno-c11-extensions goes wherever
  -Wno-c99-extensions already does.

ci_paths filters a file at the top of a samples tree by its own path.
rh264 and rh265 lose the parameters no instantiation reads, the 8-bit
H.264 kernels mark the depth they ignore, and the AV1 WebM fixtures
leave out the MP4 box writer they never use.
2026-11-05 17:36:02 +01:00

141 lines
3.7 KiB
C

/* SPDX-License-Identifier: MIT */
#ifndef RAV1_WEBM_FIXTURE_H
#define RAV1_WEBM_FIXTURE_H
/* the byte writer only: a WebM test never builds an MP4 */
#define RAV1_MP4_FIXTURE_WRITER_ONLY
#include "rav1_mp4_fixture.h"
static size_t element(uint32_t id)
{
size_t at;
if (id > 0xffffff)
put(id >> 24);
if (id > 0xffff)
put(id >> 16);
if (id > 0xff)
put(id >> 8);
put(id);
at = used;
put(0x40);
put(0);
return at;
}
static void end_element(size_t at)
{
size_t n = used - at - 2;
bytes[at] = 0x40 | (uint8_t)(n >> 8);
bytes[at + 1] = (uint8_t)n;
}
static void number(uint32_t id, unsigned n)
{
size_t at = element(id);
put(n);
end_element(at);
}
static void make_webm_clip(int inband, unsigned matrix, unsigned transfer,
unsigned range, unsigned frames, int cues, int hdr)
{
static const uint8_t cll[] = {0x2a, 6, 1, 3, 232, 1, 144, 128};
static const uint8_t final_cll[] = {0x2a, 6, 1, 15, 160, 3, 232, 128};
static const uint8_t changed_cll[] = {0x2a, 6, 1, 7, 208, 2, 88, 128};
size_t b, segment, tracks, track, video, cluster, body, positions[2];
unsigned i;
used = 0;
b = element(0x1a45dfa3);
video = element(0x4282);
copy("webm", 4);
end_element(video);
end_element(b);
segment = element(0x18538067);
body = used;
tracks = element(0x1654ae6b);
track = element(0xae);
number(0xd7, 1);
number(0x83, 1);
/* CodecPrivate may precede CodecID. */
b = element(0x63a2);
config_at = used;
copy(config, inband ? 4 : sizeof(config));
end_element(b);
b = element(0x86);
copy("V_AV1", 5);
end_element(b);
video = element(0xe0);
number(0xb0, 64);
number(0xba, 64);
b = element(0x55b0);
number(0x55b1, matrix);
number(0x55b9, range);
number(0x55ba, transfer);
end_element(b);
end_element(video);
end_element(track);
end_element(tracks);
positions[0] = used - body;
positions[1] = 0;
cluster = element(0x1f43b675);
number(0xe7, 0);
for (i = 0; i < frames; i++)
{
if (cues && i == frames / 2)
{
end_element(cluster);
positions[1] = used - body;
cluster = element(0x1f43b675);
number(0xe7, i * 40);
}
b = element(0xa3);
put(0x81);
put(0);
put((cues && i >= frames / 2 ? i - frames / 2 : i) * 40);
put(!i || (cues && i == frames / 2) ? 128 : 0);
if (!i)
media_at = used;
if (!i && (inband || hdr == 4))
copy(config + 4, sizeof(config) - 4);
if (!i && inband && hdr == 4)
copy(config + 4, sizeof(config) - 4);
if (!i && hdr)
copy(cll, sizeof(cll));
if ((hdr == 2 && i == 4) || (hdr == 3 && i == 1))
copy(changed_cll, sizeof(changed_cll));
if (hdr == 3 && i == 2) copy(final_cll, sizeof(final_cll));
copy(packet, sizeof(packet));
end_element(b);
}
end_element(cluster);
if (cues)
{
size_t points = element(0x1c53bb6b);
for (i = 0; i < 2; i++)
{
size_t point = element(0xbb);
number(0xb3, i * (frames / 2) * 40);
track = element(0xb7);
number(0xf7, 1);
b = element(0xf1);
be32((uint32_t)positions[i]);
end_element(b);
end_element(track);
end_element(point);
}
end_element(points);
}
end_element(segment);
}
static void make_webm_frames(int inband, unsigned matrix, unsigned transfer,
unsigned range, unsigned frames)
{
make_webm_clip(inband, matrix, transfer, range, frames, 0, 0);
}
static void make_webm(int inband, unsigned matrix, unsigned transfer,
unsigned range)
{
make_webm_frames(inband, matrix, transfer, range, 2);
}
#endif