Skip to content

Commit

Permalink
lavc/vaapi_encode_h265: Use surface alignment
Browse files Browse the repository at this point in the history
This is needed to correctly set conformance window crop with Mesa AMD.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
  • Loading branch information
nowrep authored and BtbN committed Dec 17, 2024
1 parent bcfbf2b commit d0facac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libavcodec/vaapi_encode_h265.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,10 @@ static av_cold int vaapi_encode_h265_get_encoder_caps(AVCodecContext *avctx)
"min CB size %dx%d.\n", priv->ctu_size, priv->ctu_size,
priv->min_cb_size, priv->min_cb_size);

base_ctx->surface_width = FFALIGN(avctx->width, priv->min_cb_size);
base_ctx->surface_height = FFALIGN(avctx->height, priv->min_cb_size);
base_ctx->surface_width = FFALIGN(avctx->width,
FFMAX(priv->min_cb_size, priv->common.surface_alignment_width));
base_ctx->surface_height = FFALIGN(avctx->height,
FFMAX(priv->min_cb_size, priv->common.surface_alignment_height));

base_ctx->slice_block_width = base_ctx->slice_block_height = priv->ctu_size;

Expand Down

0 comments on commit d0facac

Please sign in to comment.