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

Function generate_missing_ref

libavcodec/vvc/refs.c:398–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static VVCFrame *generate_missing_ref(VVCContext *s, VVCFrameContext *fc, int poc)
399{
400 const VVCSPS *sps = fc->ps.sps;
401 const VVCPPS *pps = fc->ps.pps;
402 VVCFrame *frame;
403
404 frame = alloc_frame(s, fc);
405 if (!frame)
406 return NULL;
407
408 if (!s->avctx->hwaccel) {
409 if (!sps->pixel_shift) {
410 for (int i = 0; frame->frame->buf[i]; i++)
411 memset(frame->frame->buf[i]->data, 1 << (sps->bit_depth - 1),
412 frame->frame->buf[i]->size);
413 } else {
414 for (int i = 0; frame->frame->data[i]; i++)
415 for (int y = 0; y < (pps->height >> sps->vshift[i]); y++) {
416 uint8_t *dst = frame->frame->data[i] + y * frame->frame->linesize[i];
417 AV_WN16(dst, 1 << (sps->bit_depth - 1));
418 av_memcpy_backptr(dst + 2, 2, 2*(pps->width >> sps->hshift[i]) - 2);
419 }
420 }
421 }
422
423 frame->poc = poc;
424 frame->sequence = s->seq_decode;
425 frame->flags = VVC_FRAME_FLAG_CORRUPT;
426
427 ff_vvc_report_frame_finished(frame);
428
429 return frame;
430}
431
432#define CHECK_MAX(d) (frame->ref_##d * frame->sps->r->sps_pic_##d##_max_in_luma_samples >= ref->ref_##d * (frame->pps->r->pps_pic_##d##_in_luma_samples - max))
433#define CHECK_SAMPLES(d) (frame->pps->r->pps_pic_##d##_in_luma_samples == ref->pps->r->pps_pic_##d##_in_luma_samples)

Callers 1

add_candidate_refFunction · 0.70

Calls 3

av_memcpy_backptrFunction · 0.85
alloc_frameFunction · 0.70

Tested by

no test coverage detected