forge
Explore
Log in

Don't you dare go Hollow

U6: ec-h264 high422 x264 sweeps: the four test fns become case builders, one test runs them all through one sweep

Browse files at this commit

89fe2e657ae493571d76aca665b04816e0393392Ahmet Kaan GümüşParent: b6998de
crates/ec-h264/tests/it/high422.rsmodified+18 -14
@@ -332,21 +332,17 @@ const SMALL: &[Case] = &[
332 ];332 ];
333 333
334 /// Every case at 8 bits, progressive.334 /// Every case at 8 bits, progressive.
335-#[test]335+fn progressive_8bit_cases() -> Vec<Case> {
336-fn x264_hi422_progressive_8bit() {336+ SMALL.iter().map(|c| Case { ..*c }).collect()
337- sweep(SMALL);
338 }337 }
339 338
340 /// The same at 10 bits.339 /// The same at 10 bits.
341-#[test]340+fn progressive_10bit_cases() -> Vec<Case> {
342-fn x264_hi422_progressive_10bit() {341+ SMALL.iter().map(|c| ten(Case { ..*c })).collect()
343- let cases: Vec<Case> = SMALL.iter().map(|c| ten(Case { ..*c })).collect();
344- sweep(&cases);
345 }342 }
346 343
347 /// MBAFF at 8 and 10 bits.344 /// MBAFF at 8 and 10 bits.
348-#[test]345+fn mbaff_cases() -> Vec<Case> {
349-fn x264_hi422_mbaff() {
350 let mut cases: Vec<Case> = Vec::new();346 let mut cases: Vec<Case> = Vec::new();
351 for (i, c) in SMALL.iter().enumerate() {347 for (i, c) in SMALL.iter().enumerate() {
352 // Every other case keeps the sweep quick; the rest run progressive.348 // Every other case keeps the sweep quick; the rest run progressive.
@@ -360,13 +356,12 @@ fn x264_hi422_mbaff() {
360 format!("mbaff-{}{}", c.tag, if c.ten_bit { "-10" } else { "" }).into_boxed_str(),356 format!("mbaff-{}{}", c.tag, if c.ten_bit { "-10" } else { "" }).into_boxed_str(),
361 );357 );
362 }358 }
363- sweep(&cases);359+ cases
364 }360 }
365 361
366 /// 1920x1080 intra and long-GOP, progressive and MBAFF (slow).362 /// 1920x1080 intra and long-GOP, progressive and MBAFF (slow).
367-#[test]363+fn hd_cases() -> Vec<Case> {
368-fn x264_hi422_hd() {364+ vec![
369- sweep(&[
370 case("hd-i-cabac", "testsrc2", "1920x1080", 2, "keyint=1"),365 case("hd-i-cabac", "testsrc2", "1920x1080", 2, "keyint=1"),
371 case(366 case(
372 "hd-b-cabac",367 "hd-b-cabac",
@@ -403,7 +398,7 @@ fn x264_hi422_hd() {
403 2,398 2,
404 "keyint=1:cabac=0",399 "keyint=1:cabac=0",
405 ))),400 ))),
406- ]);401+ ]
407 }402 }
408 403
409 // ---- I_PCM in 4:2:2 (x264 never writes one) ----------------------------404 // ---- I_PCM in 4:2:2 (x264 never writes one) ----------------------------
@@ -530,3 +525,12 @@ fn hi422_pcm_macroblocks_round_trip() {
530 assert_eq!(bytes, &expected, "{bd}-bit I_PCM 4:2:2");525 assert_eq!(bytes, &expected, "{bd}-bit I_PCM 4:2:2");
531 }526 }
532 }527 }
528+
529+#[test]
530+fn x264_hi422_family() {
531+ let mut cases = progressive_8bit_cases();
532+ cases.extend(progressive_10bit_cases());
533+ cases.extend(mbaff_cases());
534+ cases.extend(hd_cases());
535+ sweep(&cases);
536+}