| 341 | } |
| 342 | |
| 343 | static int unsharp_work_thread(hb_filter_object_t *filter, |
| 344 | hb_buffer_t ** buf_in, |
| 345 | hb_buffer_t ** buf_out, int thread) |
| 346 | { |
| 347 | hb_filter_private_t *pv = filter->private_data; |
| 348 | hb_buffer_t *in = *buf_in, *out; |
| 349 | |
| 350 | if (in->s.flags & HB_BUF_FLAG_EOF) |
| 351 | { |
| 352 | *buf_out = in; |
| 353 | *buf_in = NULL; |
| 354 | return HB_FILTER_DONE; |
| 355 | } |
| 356 | |
| 357 | out = hb_frame_buffer_init(pv->output.pix_fmt, in->f.width, in->f.height); |
| 358 | out->f.color_prim = pv->output.color_prim; |
| 359 | out->f.color_transfer = pv->output.color_transfer; |
| 360 | out->f.color_matrix = pv->output.color_matrix; |
| 361 | out->f.color_range = pv->output.color_range; |
| 362 | out->f.chroma_location = pv->output.chroma_location; |
| 363 | |
| 364 | int c; |
| 365 | for (c = 0; c < 3; c++) |
| 366 | { |
| 367 | unsharp_plane_context_t * ctx = &pv->plane_ctx[c]; |
| 368 | unsharp_thread_context_t * tctx = &pv->thread_ctx[thread][c]; |
| 369 | unsharp(in->plane[c].data, |
| 370 | out->plane[c].data, |
| 371 | in->plane[c].width, |
| 372 | in->plane[c].height, |
| 373 | in->plane[c].stride, |
| 374 | out->plane[c].stride, |
| 375 | ctx, tctx); |
| 376 | } |
| 377 | |
| 378 | hb_buffer_copy_props(out, in); |
| 379 | *buf_out = out; |
| 380 | |
| 381 | return HB_FILTER_OK; |
| 382 | } |
| 383 | |
| 384 | static int unsharp_work(hb_filter_object_t *filter, |
| 385 | hb_buffer_t ** buf_in, |
no test coverage detected