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 commit89fe2e657ae493571d76aca665b04816e0393392Parent: b6998de1 changed file +18 -14
crates/ec-h264/tests/it/high422.rsmodified+18 -14
| @@ -332,21 +332,17 @@ const SMALL: &[Case] = &[ | ||
| 332 | 332 | ]; |
| 333 | 333 | |
| 334 | 334 | /// Every case at 8 bits, progressive. |
| 335 | -#[test] | |
| 336 | -fn x264_hi422_progressive_8bit() { | |
| 337 | - sweep(SMALL); | |
| 335 | +fn progressive_8bit_cases() -> Vec<Case> { | |
| 336 | + SMALL.iter().map(|c| Case { ..*c }).collect() | |
| 338 | 337 | } |
| 339 | 338 | |
| 340 | 339 | /// The same at 10 bits. |
| 341 | -#[test] | |
| 342 | -fn x264_hi422_progressive_10bit() { | |
| 343 | - let cases: Vec<Case> = SMALL.iter().map(|c| ten(Case { ..*c })).collect(); | |
| 344 | - sweep(&cases); | |
| 340 | +fn progressive_10bit_cases() -> Vec<Case> { | |
| 341 | + SMALL.iter().map(|c| ten(Case { ..*c })).collect() | |
| 345 | 342 | } |
| 346 | 343 | |
| 347 | 344 | /// MBAFF at 8 and 10 bits. |
| 348 | -#[test] | |
| 349 | -fn x264_hi422_mbaff() { | |
| 345 | +fn mbaff_cases() -> Vec<Case> { | |
| 350 | 346 | let mut cases: Vec<Case> = Vec::new(); |
| 351 | 347 | for (i, c) in SMALL.iter().enumerate() { |
| 352 | 348 | // Every other case keeps the sweep quick; the rest run progressive. |
| @@ -360,13 +356,12 @@ fn x264_hi422_mbaff() { | ||
| 360 | 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 | 362 | /// 1920x1080 intra and long-GOP, progressive and MBAFF (slow). |
| 367 | -#[test] | |
| 368 | -fn x264_hi422_hd() { | |
| 369 | - sweep(&[ | |
| 363 | +fn hd_cases() -> Vec<Case> { | |
| 364 | + vec![ | |
| 370 | 365 | case("hd-i-cabac", "testsrc2", "1920x1080", 2, "keyint=1"), |
| 371 | 366 | case( |
| 372 | 367 | "hd-b-cabac", |
| @@ -403,7 +398,7 @@ fn x264_hi422_hd() { | ||
| 403 | 398 | 2, |
| 404 | 399 | "keyint=1:cabac=0", |
| 405 | 400 | ))), |
| 406 | - ]); | |
| 401 | + ] | |
| 407 | 402 | } |
| 408 | 403 | |
| 409 | 404 | // ---- I_PCM in 4:2:2 (x264 never writes one) ---------------------------- |
| @@ -530,3 +525,12 @@ fn hi422_pcm_macroblocks_round_trip() { | ||
| 530 | 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 | +} |