Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -54,6 +54,7 @@ typedef struct MPTestContext { · 53 unmodified lines | |||
| 54 | const AVClass *class; | 54 | const AVClass *class; |
| 55 | AVRational frame_rate; | 55 | AVRational frame_rate; |
| 56 | int64_t pts, max_pts, duration; | 56 | int64_t pts, max_pts, duration; |
| 57 | int64_t max_frames; | ||
| 57 | int hsub, vsub; | 58 | int hsub, vsub; |
| 58 | int test; ///< test_type | 59 | int test; ///< test_type |
| 59 | } MPTestContext; | 60 | } MPTestContext; |
| @@ -79,6 +80,10 @@ static const AVOption mptestsrc_options[]= { · 19 unmodified lines | |||
| 79 | { "ring1", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING1}, INT_MIN, INT_MAX, FLAGS, "test" }, | 80 | { "ring1", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING1}, INT_MIN, INT_MAX, FLAGS, "test" }, |
| 80 | { "ring2", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING2}, INT_MIN, INT_MAX, FLAGS, "test" }, | 81 | { "ring2", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING2}, INT_MIN, INT_MAX, FLAGS, "test" }, |
| 81 | { "all", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_ALL}, INT_MIN, INT_MAX, FLAGS, "test" }, | 82 | { "all", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_ALL}, INT_MIN, INT_MAX, FLAGS, "test" }, |
| 83 | { "max_frames", "Set the maximum number of frames generated for each test", OFFSET(max_frames), | ||
| 84 | AV_OPT_TYPE_INT64, {.i64 = 30}, 1, INT64_MAX, FLAGS }, | ||
| 85 | { "m", "Set the maximum number of frames generated for each test", OFFSET(max_frames), | ||
| 86 | AV_OPT_TYPE_INT64, {.i64 = 30}, 1, INT64_MAX, FLAGS }, | ||
| 82 | { NULL } | 87 | { NULL } |
| 83 | }; | 88 | }; |
| 84 | 89 | ||
| @@ -322,20 +327,20 @@ static int request_frame(AVFilterLink *outlink) · 237 unmodified lines | |||
| 322 | memset(picref->data[2] + i*picref->linesize[2], 128, cw); | 327 | memset(picref->data[2] + i*picref->linesize[2], 128, cw); |
| 323 | } | 328 | } |
| 324 | 329 | ||
| 325 | if (tt == TEST_ALL && frame%30) /* draw a black frame at the beginning of each test */ | 330 | if (tt == TEST_ALL && frame%test->max_frames) /* draw a black frame at the beginning of each test */ |
| 326 | tt = (frame/30)%(TEST_NB-1); | 331 | tt = (frame/test->max_frames)%(TEST_NB-1); |
| 327 | 332 | ||
| 328 | switch (tt) { | 333 | switch (tt) { |
| 329 | case TEST_DC_LUMA: dc_test(picref->data[0], picref->linesize[0], 256, 256, frame%30); break; | 334 | case TEST_DC_LUMA: dc_test(picref->data[0], picref->linesize[0], 256, 256, frame%test->max_frames); break; |
| 330 | case TEST_DC_CHROMA: dc_test(picref->data[1], picref->linesize[1], 256, 256, frame%30); break; | 335 | case TEST_DC_CHROMA: dc_test(picref->data[1], picref->linesize[1], 256, 256, frame%test->max_frames); break; |
| 331 | case TEST_FREQ_LUMA: freq_test(picref->data[0], picref->linesize[0], frame%30); break; | 336 | case TEST_FREQ_LUMA: freq_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break; |
| 332 | case TEST_FREQ_CHROMA: freq_test(picref->data[1], picref->linesize[1], frame%30); break; | 337 | case TEST_FREQ_CHROMA: freq_test(picref->data[1], picref->linesize[1], frame%test->max_frames); break; |
| 333 | case TEST_AMP_LUMA: amp_test(picref->data[0], picref->linesize[0], frame%30); break; | 338 | case TEST_AMP_LUMA: amp_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break; |
| 334 | case TEST_AMP_CHROMA: amp_test(picref->data[1], picref->linesize[1], frame%30); break; | 339 | case TEST_AMP_CHROMA: amp_test(picref->data[1], picref->linesize[1], frame%test->max_frames); break; |
| 335 | case TEST_CBP: cbp_test(picref->data , picref->linesize , frame%30); break; | 340 | case TEST_CBP: cbp_test(picref->data , picref->linesize , frame%test->max_frames); break; |
| 336 | case TEST_MV: mv_test(picref->data[0], picref->linesize[0], frame%30); break; | 341 | case TEST_MV: mv_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break; |
| 337 | case TEST_RING1: ring1_test(picref->data[0], picref->linesize[0], frame%30); break; | 342 | case TEST_RING1: ring1_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break; |
| 338 | case TEST_RING2: ring2_test(picref->data[0], picref->linesize[0], frame%30); break; | 343 | case TEST_RING2: ring2_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break; |
| 339 | } | 344 | } |
| 340 | 345 | ||
| 341 | return ff_filter_frame(outlink, picref); | 346 | return ff_filter_frame(outlink, picref); |