summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_h265.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-11 00:49:43 -0300
committerJames Almer <jamrial@gmail.com>2017-11-11 00:49:43 -0300
commite6d70494ce03760c6700c50380f4455c41919661 (patch)
treec5043f0b317f7f5fdf8d38ffe1be22abe539f14a /libavcodec/vaapi_encode_h265.c
parent924978341516fc234a78ff5bad89d6bd6b36de23 (diff)
parenta14a12ca137bf1526452b97bedfc9f7b301d4e04 (diff)
Merge commit 'a14a12ca137bf1526452b97bedfc9f7b301d4e04'
* commit 'a14a12ca137bf1526452b97bedfc9f7b301d4e04': vaapi_h265: Reduce the amount of padding in the stream Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/vaapi_encode_h265.c')
-rw-r--r--libavcodec/vaapi_encode_h265.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 3ae92a7a09..58b30b087f 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -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,