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

Function generate_missing_ref

libavcodec/hevc/refs.c:466–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466static HEVCFrame *generate_missing_ref(HEVCContext *s, HEVCLayerContext *l, int poc)
467{
468 HEVCFrame *frame;
469 int i, y;
470
471 frame = alloc_frame(s, l);
472 if (!frame)
473 return NULL;
474
475 if (!s->avctx->hwaccel) {
476 int nb_planes = l->sps->chroma_format_idc ? 3 : 1;
477 if (!l->sps->pixel_shift) {
478 for (i = 0; i < nb_planes; i++)
479 memset(frame->f->data[i], 1 << (l->sps->bit_depth - 1),
480 frame->f->linesize[i] * AV_CEIL_RSHIFT(l->sps->height, l->sps->vshift[i]));
481 } else {
482 for (i = 0; i < nb_planes; i++)
483 for (y = 0; y < (l->sps->height >> l->sps->vshift[i]); y++) {
484 uint8_t *dst = frame->f->data[i] + y * frame->f->linesize[i];
485 AV_WN16(dst, 1 << (l->sps->bit_depth - 1));
486 av_memcpy_backptr(dst + 2, 2, 2*(l->sps->width >> l->sps->hshift[i]) - 2);
487 }
488 }
489 }
490
491 frame->poc = poc;
492 frame->flags = HEVC_FRAME_FLAG_UNAVAILABLE;
493
494 if (s->avctx->active_thread_type == FF_THREAD_FRAME)
495 ff_progress_frame_report(&frame->tf, INT_MAX);
496
497 return frame;
498}
499
500/* add a reference with the given poc to the list and mark it as used in DPB */
501static int add_candidate_ref(HEVCContext *s, HEVCLayerContext *l,

Callers 1

add_candidate_refFunction · 0.70

Calls 3

av_memcpy_backptrFunction · 0.85
ff_progress_frame_reportFunction · 0.85
alloc_frameFunction · 0.70

Tested by

no test coverage detected