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:
parent
8255629239
commit
aed0dd7ab1
@ -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++;
|
||||
}
|
||||
|
@ -384,6 +384,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 {
|
||||
|
@ -45,6 +45,8 @@ void ff_hevc_unref_frame(HEVCFrame *frame, int flags)
|
||||
frame->refPicList = NULL;
|
||||
|
||||
ff_refstruct_unref(&frame->hwaccel_picture_private);
|
||||
|
||||
frame->missing = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -434,6 +436,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->avctx->active_thread_type == FF_THREAD_FRAME)
|
||||
ff_progress_frame_report(&frame->tf, INT_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user