1
0
Fork 0

hevc: don't pass dummy references to the hwaccel

Instead let the hwaccel deal with generating missing references. This
improves error resilience and works around a few bugs.
This commit is contained in:
Hendrik Leppkes 2017-09-09 01:23:32 +02:00
parent 3befb0512a
commit f247edf1c0
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
3 changed files with 9 additions and 1 deletions

View File

@ -168,7 +168,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->RefPicList); i++) {
const HEVCFrame *frame = NULL;
while (!frame && j < FF_ARRAY_ELEMS(h->DPB)) {
if (&h->DPB[j] != current_picture && (h->DPB[j].flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)))
if (&h->DPB[j] != current_picture && (h->DPB[j].flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)) && !h->DPB[j].missing)
frame = &h->DPB[j];
j++;
}

View File

@ -50,6 +50,8 @@ void ff_hevc_unref_frame(HEVCFrame *frame, int flags)
frame->refPicList = NULL;
ff_refstruct_unref(&frame->hwaccel_picture_private);
frame->missing = 0;
}
}
@ -440,6 +442,7 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc)
frame->poc = poc;
frame->sequence = HEVC_SEQUENCE_COUNTER_INVALID;
frame->flags = 0;
frame->missing = 1;
if (s->threads_type == FF_THREAD_FRAME)
ff_thread_report_progress(&frame->tf, INT_MAX, 0);

View File

@ -377,6 +377,11 @@ typedef struct HEVCFrame {
* A combination of HEVC_FRAME_FLAG_*
*/
uint8_t flags;
/**
* 1 - a dummy frame generated in place of a missing frame
*/
int missing;
} HEVCFrame;
typedef struct HEVCLocalContext {