Skip to content
Permalink
Browse files

cuvid: Don't wait for vp8/9 AR frames

Alternate Reference frames never appear in the output - they are
purely used as references. As such, do not increment the wait
counter when you get one, as you'll never see it on the other side.

Note that this change requires cuviddec.h to be fixed up according
to the Video SDK header - cuda 7.5's header is missing the vp8
block and the vp9 block is simply wrong.
  • Loading branch information
philipl committed Sep 19, 2016
1 parent 91c5869 commit c09e59938defc325734bd8a2ac36b9c0321c5145
Showing with 7 additions and 1 deletion.
  1. +7 −1 libavcodec/cuvid.c
@@ -221,7 +221,13 @@ static int CUDAAPI cuvid_handle_picture_decode(void *opaque, CUVIDPICPARAMS* pic

av_log(avctx, AV_LOG_TRACE, "pfnDecodePicture\n");

if (ctx->deint_mode == cudaVideoDeinterlaceMode_Weave)
if (ctx->cuparseinfo.CodecType == cudaVideoCodec_VP9 &&
!picparams->CodecSpecific.vp9.showFrame) {
// An AR frame. Don't wait for it.
} else if (ctx->cuparseinfo.CodecType == cudaVideoCodec_VP8 &&
!picparams->CodecSpecific.vp8.show_frame) {
// An AR frame. Don't wait for it.
} else if (ctx->deint_mode == cudaVideoDeinterlaceMode_Weave)
ctx->waiting_frames += 1;
else
ctx->waiting_frames += 2;

0 comments on commit c09e599

Please sign in to comment.