U6: ec-h264 mbaff_x264: the four sweep tests become case builders, one test runs them all through one sweep
Browse files at this commitb6998de899f697be9807c61d6107ed6e49a7474fParent: fccf2fb1 changed file +22 -16
crates/ec-h264/tests/it/mbaff_x264.rsmodified+22 -16
| @@ -171,9 +171,8 @@ const fn case( | |||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | /// Small pictures: every coding tool once, quick enough for every run. | 173 | /// Small pictures: every coding tool once, quick enough for every run. |
| 174 | -#[test] | 174 | +fn mbaff_small_cases() -> Vec<Case> { |
| 175 | -fn x264_mbaff_small() { | 175 | + vec![ |
| 176 | - sweep(&[ | ||
| 177 | case("i-cabac-tff", "testsrc2", "192x128", 3, "tff=1:keyint=1"), | 176 | case("i-cabac-tff", "testsrc2", "192x128", 3, "tff=1:keyint=1"), |
| 178 | case("i-cabac-bff", "testsrc2", "192x128", 3, "bff=1:keyint=1"), | 177 | case("i-cabac-bff", "testsrc2", "192x128", 3, "bff=1:keyint=1"), |
| 179 | case( | 178 | case( |
| @@ -296,12 +295,11 @@ fn x264_mbaff_small() { | |||
| 296 | 8, | 295 | 8, |
| 297 | "tff=1:bframes=3:subme=9:trellis=2:me=umh", | 296 | "tff=1:bframes=3:subme=9:trellis=2:me=umh", |
| 298 | ), | 297 | ), |
| 299 | - ]); | 298 | + ] |
| 300 | } | 299 | } |
| 301 | 300 | ||
| 302 | /// High 10 MBAFF. | 301 | /// High 10 MBAFF. |
| 303 | -#[test] | 302 | +fn mbaff_high10_cases() -> Vec<Case> { |
| 304 | -fn x264_mbaff_high10() { | ||
| 305 | let t = |tag, params| Case { | 303 | let t = |tag, params| Case { |
| 306 | tag, | 304 | tag, |
| 307 | src: "testsrc2", | 305 | src: "testsrc2", |
| @@ -310,19 +308,18 @@ fn x264_mbaff_high10() { | |||
| 310 | ten_bit: true, | 308 | ten_bit: true, |
| 311 | params, | 309 | params, |
| 312 | }; | 310 | }; |
| 313 | - sweep(&[ | 311 | + vec![ |
| 314 | t("h10-i-cabac", "tff=1:keyint=1"), | 312 | t("h10-i-cabac", "tff=1:keyint=1"), |
| 315 | t("h10-i-cavlc", "cabac=0:bff=1:keyint=1"), | 313 | t("h10-i-cavlc", "cabac=0:bff=1:keyint=1"), |
| 316 | t("h10-b-cabac", "tff=1:bframes=3"), | 314 | t("h10-b-cabac", "tff=1:bframes=3"), |
| 317 | t("h10-b-cavlc", "cabac=0:bff=1:bframes=3"), | 315 | t("h10-b-cavlc", "cabac=0:bff=1:bframes=3"), |
| 318 | t("h10-weightp", "tff=1:bframes=2:weightp=2:weightb=1"), | 316 | t("h10-weightp", "tff=1:bframes=2:weightp=2:weightb=1"), |
| 319 | - ]); | 317 | + ] |
| 320 | } | 318 | } |
| 321 | 319 | ||
| 322 | /// 720x576 (the broadcast interlaced size). | 320 | /// 720x576 (the broadcast interlaced size). |
| 323 | -#[test] | 321 | +fn mbaff_sd_cases() -> Vec<Case> { |
| 324 | -fn x264_mbaff_sd() { | 322 | + vec![ |
| 325 | - sweep(&[ | ||
| 326 | case("sd-cabac-tff", "testsrc2", "720x576", 6, "tff=1:bframes=3"), | 323 | case("sd-cabac-tff", "testsrc2", "720x576", 6, "tff=1:bframes=3"), |
| 327 | case( | 324 | case( |
| 328 | "sd-cabac-bff", | 325 | "sd-cabac-bff", |
| @@ -352,13 +349,12 @@ fn x264_mbaff_sd() { | |||
| 352 | 6, | 349 | 6, |
| 353 | "tff=1:bframes=2:weightp=2:weightb=1", | 350 | "tff=1:bframes=2:weightp=2:weightb=1", |
| 354 | ), | 351 | ), |
| 355 | - ]); | 352 | + ] |
| 356 | } | 353 | } |
| 357 | 354 | ||
| 358 | /// 1920x1080. | 355 | /// 1920x1080. |
| 359 | -#[test] | 356 | +fn mbaff_hd_cases() -> Vec<Case> { |
| 360 | -fn x264_mbaff_hd() { | 357 | + vec![ |
| 361 | - sweep(&[ | ||
| 362 | case( | 358 | case( |
| 363 | "hd-cabac-tff", | 359 | "hd-cabac-tff", |
| 364 | "testsrc2", | 360 | "testsrc2", |
| @@ -401,5 +397,15 @@ fn x264_mbaff_hd() { | |||
| 401 | 5, | 397 | 5, |
| 402 | "bff=1:bframes=2:weightp=2:weightb=1", | 398 | "bff=1:bframes=2:weightp=2:weightb=1", |
| 403 | ), | 399 | ), |
| 404 | - ]); | 400 | + ] |
| 401 | +} | ||
| 402 | + | ||
| 403 | +#[test] | ||
| 404 | +fn x264_mbaff() { | ||
| 405 | + let mut cases = Vec::new(); | ||
| 406 | + cases.extend(mbaff_small_cases()); | ||
| 407 | + cases.extend(mbaff_high10_cases()); | ||
| 408 | + cases.extend(mbaff_sd_cases()); | ||
| 409 | + cases.extend(mbaff_hd_cases()); | ||
| 410 | + sweep(&cases); | ||
| 405 | } | 411 | } |