MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / update_thread_context

Function update_thread_context

libavcodec/cfhd.c:1414–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412
1413#if HAVE_THREADS
1414static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
1415{
1416 CFHDContext *psrc = src->priv_data;
1417 CFHDContext *pdst = dst->priv_data;
1418 int ret;
1419
1420 if (dst == src || psrc->transform_type == 0)
1421 return 0;
1422
1423 if (pdst->plane[0].idwt_size != psrc->plane[0].idwt_size ||
1424 pdst->a_format != psrc->a_format ||
1425 pdst->a_width != psrc->a_width ||
1426 pdst->a_height != psrc->a_height ||
1427 pdst->a_transform_type != psrc->a_transform_type)
1428 free_buffers(pdst);
1429
1430 pdst->a_format = psrc->a_format;
1431 pdst->a_width = psrc->a_width;
1432 pdst->a_height = psrc->a_height;
1433 pdst->a_transform_type = psrc->a_transform_type;
1434 pdst->transform_type = psrc->transform_type;
1435 pdst->progressive = psrc->progressive;
1436 pdst->planes = psrc->planes;
1437
1438 if (!pdst->plane[0].idwt_buf) {
1439 pdst->coded_width = pdst->a_width;
1440 pdst->coded_height = pdst->a_height;
1441 pdst->coded_format = pdst->a_format;
1442 pdst->transform_type = pdst->a_transform_type;
1443 ret = alloc_buffers(dst);
1444 if (ret < 0)
1445 return ret;
1446 }
1447
1448 for (int plane = 0; plane < pdst->planes; plane++) {
1449 memcpy(pdst->plane[plane].band, psrc->plane[plane].band, sizeof(pdst->plane[plane].band));
1450 memcpy(pdst->plane[plane].idwt_buf, psrc->plane[plane].idwt_buf,
1451 pdst->plane[plane].idwt_size * sizeof(int16_t));
1452 }
1453
1454 return 0;
1455}
1456#endif
1457
1458const FFCodec ff_cfhd_decoder = {

Callers

nothing calls this directly

Calls 2

free_buffersFunction · 0.70
alloc_buffersFunction · 0.70

Tested by

no test coverage detected