Unified · Split
| @@ -49,7 +49,7 @@ typedef struct ChromaShiftContext { · 48 unmodified lines | |||
| 49 | AVFrame *in; | 49 | AVFrame *in; |
| 50 | 50 | ||
| 51 | int is_rgbashift; | 51 | int is_rgbashift; |
| 52 | int (*filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); | 52 | int (*filter_slice[2])(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); |
| 53 | } ChromaShiftContext; | 53 | } ChromaShiftContext; |
| 54 | 54 | ||
| 55 | #define DEFINE_SMEAR(depth, type, div) \ | 55 | #define DEFINE_SMEAR(depth, type, div) \ |
| @@ -326,7 +326,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 270 unmodified lines | |||
| 326 | in->data[0], in->linesize[0], | 326 | in->data[0], in->linesize[0], |
| 327 | s->linesize[0], s->height[0]); | 327 | s->linesize[0], s->height[0]); |
| 328 | } | 328 | } |
| 329 | ff_filter_execute(ctx, s->filter_slice, out, NULL, | 329 | ff_filter_execute(ctx, s->filter_slice[s->edge], out, NULL, |
| 330 | FFMIN3(s->height[1], | 330 | FFMIN3(s->height[1], |
| 331 | s->height[2], | 331 | s->height[2], |
| 332 | ff_filter_get_nb_threads(ctx))); | 332 | ff_filter_get_nb_threads(ctx))); |
| @@ -345,15 +345,11 @@ static int config_input(AVFilterLink *inlink) · 12 unmodified lines | |||
| 345 | s->depth = desc->comp[0].depth; | 345 | s->depth = desc->comp[0].depth; |
| 346 | s->nb_planes = desc->nb_components; | 346 | s->nb_planes = desc->nb_components; |
| 347 | if (s->is_rgbashift) { | 347 | if (s->is_rgbashift) { |
| 348 | if (s->edge) | 348 | s->filter_slice[1] = s->depth > 8 ? rgbawrap_slice16 : rgbawrap_slice8; |
| 349 | s->filter_slice = s->depth > 8 ? rgbawrap_slice16 : rgbawrap_slice8; | 349 | s->filter_slice[0] = s->depth > 8 ? rgbasmear_slice16 : rgbasmear_slice8; |
| 350 | else | ||
| 351 | s->filter_slice = s->depth > 8 ? rgbasmear_slice16 : rgbasmear_slice8; | ||
| 352 | } else { | 350 | } else { |
| 353 | if (s->edge) | 351 | s->filter_slice[1] = s->depth > 8 ? wrap_slice16 : wrap_slice8; |
| 354 | s->filter_slice = s->depth > 8 ? wrap_slice16 : wrap_slice8; | 352 | s->filter_slice[0] = s->depth > 8 ? smear_slice16 : smear_slice8; |
| 355 | else | ||
| 356 | s->filter_slice = s->depth > 8 ? smear_slice16 : smear_slice8; | ||
| 357 | } | 353 | } |
| 358 | s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); | 354 | s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); |
| 359 | s->height[0] = s->height[3] = inlink->h; | 355 | s->height[0] = s->height[3] = inlink->h; |
| @@ -363,18 +359,6 @@ static int config_input(AVFilterLink *inlink) · 3 unmodified lines | |||
| 363 | return av_image_fill_linesizes(s->linesize, inlink->format, inlink->w); | 359 | return av_image_fill_linesizes(s->linesize, inlink->format, inlink->w); |
| 364 | } | 360 | } |
| 365 | 361 | ||
| 366 | static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, | ||
| 367 | char *res, int res_len, int flags) | ||
| 368 | { | ||
| 369 | int ret; | ||
| 370 | |||
| 371 | ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); | ||
| 372 | if (ret < 0) | ||
| 373 | return ret; | ||
| 374 | |||
| 375 | return config_input(ctx->inputs[0]); | ||
| 376 | } | ||
| 377 | |||
| 378 | #define OFFSET(x) offsetof(ChromaShiftContext, x) | 362 | #define OFFSET(x) offsetof(ChromaShiftContext, x) |
| 379 | #define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM | 363 | #define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM |
| 380 | 364 | ||
| @@ -431,7 +415,7 @@ const AVFilter ff_vf_chromashift = { · 50 unmodified lines | |||
| 431 | FILTER_INPUTS(inputs), | 415 | FILTER_INPUTS(inputs), |
| 432 | FILTER_PIXFMTS_ARRAY(yuv_pix_fmts), | 416 | FILTER_PIXFMTS_ARRAY(yuv_pix_fmts), |
| 433 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, | 417 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, |
| 434 | .process_command = process_command, | 418 | .process_command = ff_filter_process_command, |
| 435 | }; | 419 | }; |
| 436 | 420 | ||
| 437 | static const enum AVPixelFormat rgb_pix_fmts[] = { | 421 | static const enum AVPixelFormat rgb_pix_fmts[] = { |
| @@ -468,5 +452,5 @@ const AVFilter ff_vf_rgbashift = { · 30 unmodified lines | |||
| 468 | FILTER_INPUTS(inputs), | 452 | FILTER_INPUTS(inputs), |
| 469 | FILTER_PIXFMTS_ARRAY(rgb_pix_fmts), | 453 | FILTER_PIXFMTS_ARRAY(rgb_pix_fmts), |
| 470 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, | 454 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, |
| 471 | .process_command = process_command, | 455 | .process_command = ff_filter_process_command, |
| 472 | }; | 456 | }; |