| 357 | } |
| 358 | |
| 359 | static int chroma_smooth_work_thread(hb_filter_object_t *filter, |
| 360 | hb_buffer_t ** buf_in, |
| 361 | hb_buffer_t ** buf_out, int thread) |
| 362 | { |
| 363 | hb_filter_private_t *pv = filter->private_data; |
| 364 | hb_buffer_t *in = *buf_in, *out; |
| 365 | |
| 366 | if (in->s.flags & HB_BUF_FLAG_EOF) |
| 367 | { |
| 368 | *buf_out = in; |
| 369 | *buf_in = NULL; |
| 370 | return HB_FILTER_DONE; |
| 371 | } |
| 372 | |
| 373 | out = hb_frame_buffer_init(in->f.fmt, in->f.width, in->f.height); |
| 374 | out->f.color_prim = pv->output.color_prim; |
| 375 | out->f.color_transfer = pv->output.color_transfer; |
| 376 | out->f.color_matrix = pv->output.color_matrix; |
| 377 | out->f.color_range = pv->output.color_range; |
| 378 | out->f.chroma_location = pv->output.chroma_location; |
| 379 | |
| 380 | int c; |
| 381 | for (c = 0; c < 3; c++) |
| 382 | { |
| 383 | chroma_smooth_plane_context_t * ctx = &pv->plane_ctx[c]; |
| 384 | chroma_smooth_thread_context_t * tctx = &pv->thread_ctx[thread][c]; |
| 385 | |
| 386 | chroma_smooth(in->plane[c].data, |
| 387 | out->plane[c].data, |
| 388 | in->plane[c].width, |
| 389 | in->plane[c].height, |
| 390 | in->plane[c].stride, |
| 391 | out->plane[c].stride, |
| 392 | ctx, tctx); |
| 393 | } |
| 394 | |
| 395 | hb_buffer_copy_props(out, in); |
| 396 | *buf_out = out; |
| 397 | |
| 398 | return HB_FILTER_OK; |
| 399 | } |
| 400 | |
| 401 | static int chroma_smooth_work(hb_filter_object_t *filter, |
| 402 | hb_buffer_t ** buf_in, |
no test coverage detected