Files
VoelinClient/crates
selikhovandClaude Opus 5.5 897087112e voelin-media: decode what the GPU encoders produce, and crop AV1 to what RDNA3 encodes
Nothing had ever decoded the output of a hardware encoder. The round-trip
the software encoders go through (our own decoders: OpenH264 for H.264,
dav1d for AV1; keyframes where asked, timestamps kept, PSNR above 28 dB)
now runs over every usable H.264 and AV1 hardware backend, at 320x240 and
at 1920x1080, which is not a whole number of macroblocks.

h264_vaapi and h264_amf decode exactly at both sizes (the SPS crops the
coded 1088 rows). av1_vaapi and av1_amf do not: on this RX 7900 GRE the
AV1 encoder pads the width to a multiple of 64 and the height to 16, and a
height 8 more than a multiple of 16 by 2 rows, so 1366x768 comes out as
1408x768, 1600x900 as 1600x912 and 1920x1080 as 1920x1082. AV1 has no
cropping like H.264's SPS, so every viewer would show the padding.

The self-test of AV1 backends now encodes 258x258, 2 more than a power of
two, reads the frame size the sequence header declares, and derives the
alignment the encoder pads to; encoders crop frames to it, as they already
cropped odd sizes to even ones. Measured here: (64, 16) for both AV1
hardware backends, (2, 2) for the software ones, so 1920x1080 is sent as
1920x1072 and decodes as exactly that. Taking the alignment from the
stream instead of from the GPU's name keeps hardware that does not pad
uncropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 02:04:03 +03:00
..