forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust376.5 MiB41510f0Tahinli1 hour ago4258 commits

scratch_hdr.rs22 lines, 1.1 KiBHistoryRawDownload
1use ec_vp9_syntax::Vp9Parser;
2#[test]
3fn hdr_probe() {
4 for name in ["lossless-64.ivf", "key-320.ivf"] {
5 let bytes = std::fs::read(ec_testkit::fixture(&format!("vp9/{name}"))).unwrap();
6 let fsize = u32::from_le_bytes(bytes[32..36].try_into().unwrap()) as usize;
7 let frame = &bytes[44..44 + fsize];
8 let mut pp = Vp9Parser::new();
9 match pp.parse_frame(frame) {
10 Ok(h) => println!(
11 "{name}: w={} h={} uhs={} hsib={} lf_level={} sharp={} delta={} base_q={} ydc={} uvdc={} uvac={} seg={} tile={:?} txmode_hdr_bytes={}",
12 h.width, h.height, h.uncompressed_header_size, h.header_size_in_bytes,
13 h.loop_filter.level, h.loop_filter.sharpness, h.loop_filter.delta_enabled,
14 h.quantization.base_q_idx, h.quantization.delta_q_y_dc,
15 h.quantization.delta_q_uv_dc, h.quantization.delta_q_uv_ac,
16 h.segmentation.enabled, h.tile_info,
17 h.header_size_in_bytes
18 ),
19 Err(e) => println!("{name}: ERR {e}"),
20 }
21 }
22}