| 464 | } |
| 465 | |
| 466 | static 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 */ |
| 501 | static int add_candidate_ref(HEVCContext *s, HEVCLayerContext *l, |
no test coverage detected