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
cd07cb6289
commit
4f239e3665
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue