]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'a14a12ca137bf1526452b97bedfc9f7b301d4e04'
authorJames Almer <jamrial@gmail.com>
Sat, 11 Nov 2017 03:49:43 +0000 (00:49 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 11 Nov 2017 03:49:43 +0000 (00:49 -0300)
* commit 'a14a12ca137bf1526452b97bedfc9f7b301d4e04':
  vaapi_h265: Reduce the amount of padding in the stream

Merged-by: James Almer <jamrial@gmail.com>
libavcodec/vaapi_encode_h265.c

index 3ae92a7a09a24b3d8b3d453b39d6f61720aae520..58b30b087f5283a914d249280700f72f9874d43f 100644 (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,