forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

h264hi422.report.md4.1 KiBHistoryRawDownload

lane/h264hi422 report

Branch lane/h264hi422 (from main eeb963f0), 2 commits, not pushed. ec-h264 now decodes High 4:2:2 and High 4:2:2 Intra (profile_idc 122) at 8 and 10 bits, progressive, PAFF and MBAFF, CAVLC and CABAC, byte-exact. Output is I422 (8-bit) or I210 (9/10-bit), same as ec-h265.

What changed

  • Picture carries cmb_h (chroma rows per MB, 8 or 16); planes, nz_c grid, field split/weave, crop, output frame follow it.
  • Entropy: BlockCat::ChromaDc422 (8 levels; CAVLC nC -2 coeff_token table and total_zeros table 9-9b; CABAC sig/last ctx min(i/2,2)). Tables are in tables.rs with prefix-free/Kraft tests. They were written from memory of the standard's Table 9-5 / 9-9(b), not from any decoder source file, and are proven by the conformance vectors.
  • transform.rs: 2x4 chroma DC transform with QP'c+3 and the ((f*LS << qP/6) + 32) >> 6 form (covers both branches of 8.5.11.2); scan-to-raster map for the 4:2:2 DC.
  • pred.rs: pred_chroma_8x16 (DC per-4x4 rules incl. xO>0,yO>0 using both edges, H, V, plane with yCF=4); per-4-row left availability for constrained intra in MBAFF.
  • decoder.rs: 8 chroma AC blocks per component, chroma nz neighbours (mbaff nb_blk_c generalised to 16 rows), I_PCM 4:2:2 size, MC (vertical chroma mv doubled into the eighth-sample interpolator, full-height partitions, no field mv offset for 4:2:2, 128-sample scratch), Geo.dst_cy, deblocking of the four chroma horizontal edges (rows 0/4/8/12 on the bS of luma edges 0..3, also edges luma skips under 8x8dct) in deblock_picture and deblock_mbaff.
  • Refusals kept by name: 4:4:4, separate colour planes, monochrome (not added: needs a CBP table, a Gray format and no-chroma paths through intra/inter/deblock/PCM, over the 30 minute budget), transform bypass, depth > 10, differing luma/chroma depth. tests/refusals.rs 4:2:2 case became a monochrome case; conformance.rs refusal case became 4:4:4.

Test content

  • scripts/fetch-vectors.sh: JVT_FREXT_HI422 into fixtures/vectors/h264-jvt-hi422/, 18 zips with sha256 in scripts/vectors.sha256 (Hi422FR5 is not published). Rsynced (without the huge *.log traces) to ~/fixtures/vectors/ on all three servers.
  • tests/high422_jvt.rs: each stream vs ffmpeg decode, and vs the archive YUV where shipped (FR10..15).
  • tests/high422.rs: x264 high422 sweeps generated in-test, 8 and 10 bit, progressive and MBAFF: intra-only and long-GOP B, CABAC/CAVLC, 8x8dct on/off, qp 8/40, cqm=jvt, chroma-qp-offset +-, slices, no-deblock, constrained intra, weightp/weightb, temporal direct, pyramid, subme9/trellis; HD cases opt-in with EC_H264_HI422_HD=1; synthetic 4:2:2 I_PCM round-trip at 8 and 10 bit. Normal suite adds about 12 s (release); skips without ffmpeg/libx264, fails under EC_REQUIRE_FIXTURES.
  • Unit test for the 2x4 DC transform.

JVT Hi422 pass list (all exact)

Hi422FR1, FR2, FR3, FR4 (8-bit CAVLC/CABAC intra), FR6, FR7, FR8, FR9 (10-bit), FR10, FR11, FR12 (8-bit, CABAC, deblock on), FR13, FR14, FR15 (10-bit), Hi422FREXT16, FREXT17 (1920x1088 PAFF, I/P/B, 10-bit), FREXT18, FREXT19 (720x480, 103 frames, MBAFF, 10-bit). 18/18.

Perf (1080p, 40 frames, bench_decode, perf stat instructions:u, base = main eeb963f0, same machine)

Hashes identical to base on both clips. hd8 (testsrc2 CABAC, B, weightp): 13.951G -> 14.169G (+1.56%). hd8b (mandelbrot CAVLC): 19.804G -> 20.033G (+1.16%). Inside +2%. (Clips regenerated with ffmpeg, so absolute counts differ from earlier reports.) 4:2:0 High 10, PAFF and MBAFF suites unchanged and passing.

Gates

  • cargo clippy -p ec-h264 --all-targets -- -D warnings clean.
  • cargo test -p ec-h264 --release --no-fail-fast on server host c with EC_REQUIRE_FIXTURES=1 EC_H264_MBAFF_HD=1 EC_H264_HI422_HD=1: everything passes except real_library_frames_encode_and_decode_exactly (known server skip: real_library media is never there).
  • DONE.md: ec-h264 decode scope, out-of-scope list, Hi422 done-when line, D1 row updated.

Not covered

  • 4:2:2 with PAFF only via the two Sony FREXT16/17 streams (x264 cannot write field pictures); MBAFF 4:2:2 via FREXT19 and x264. Multi-slice-group, lossless and 9-bit 4:2:2 not exercised by a stream (9-bit follows the same paths and shifts to 10 bits on output).