vaapi_h265: Reduce the amount of padding in the stream

It is not necessary to pad to the CTU size.  The CB size of 8x8 should be
sufficient, but due to constraints in the Intel driver (the one usable
implementation of this) it has to be padded to 16x16 like in H.264.
This commit is contained in:
Mark Thompson 2017-08-12 21:32:29 +01:00
parent e3e8eab359
commit a14a12ca13
1 changed files with 5 additions and 2 deletions

View File

@ -815,8 +815,11 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)
if (err < 0)
return err;
priv->ctu_width = FFALIGN(ctx->surface_width, 32) / 32;
priv->ctu_height = FFALIGN(ctx->surface_height, 32) / 32;
// This is an Intel driver constraint. Despite MinCbSizeY being 8,
// we are still required to encode at 16-pixel alignment and then
// crop back (so 1080 lines is still encoded as 1088 + cropping).
priv->ctu_width = FFALIGN(ctx->surface_width, 16) / 16;
priv->ctu_height = FFALIGN(ctx->surface_height, 16) / 16;
av_log(avctx, AV_LOG_VERBOSE, "Input %ux%u -> Surface %ux%u -> CTU %ux%u.\n",
avctx->width, avctx->height, ctx->surface_width,