MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / unsharp_init_thread

Function unsharp_init_thread

libhb/unsharp.c:293–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293static int unsharp_init_thread(hb_filter_object_t *filter, int threads)
294{
295 hb_filter_private_t * pv = filter->private_data;
296
297 unsharp_thread_close(pv);
298 pv->thread_ctx = calloc(threads, sizeof(unsharp_thread_context3_t));
299 if (pv->thread_ctx == NULL)
300 {
301 hb_error("Unsharp calloc failed");
302 return -1;
303 }
304 pv->threads = threads;
305 for (int c = 0; c < 3; c++)
306 {
307 unsharp_plane_context_t * ctx = &pv->plane_ctx[c];
308 int w = hb_image_width(ctx->pix_fmt, ctx->width, c);
309
310 for (int t = 0; t < threads; t++)
311 {
312 unsharp_thread_context_t * tctx = &pv->thread_ctx[t][c];
313 int z;
314 for (z = 0; z < 2 * ctx->steps; z++)
315 {
316 tctx->SC[z] = malloc(sizeof(*(tctx->SC[z])) *
317 (w + 2 * ctx->steps));
318 if (tctx->SC[z] == NULL)
319 {
320 hb_error("Unsharp calloc failed");
321 return -1;
322 }
323 }
324 }
325 }
326 return 0;
327}
328
329static void unsharp_close(hb_filter_object_t * filter)
330{

Callers 1

unsharp_initFunction · 0.85

Calls 3

unsharp_thread_closeFunction · 0.85
hb_errorFunction · 0.85
hb_image_widthFunction · 0.85

Tested by

no test coverage detected