diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 20fe750..bf91456 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -371,7 +371,7 @@ handleVAEncSequenceParameterBufferType(vlVaDriver *drv, vlVaContext *context, vl return VA_STATUS_ERROR_ALLOCATION_FAILED; } - context->gop_coeff = ((1024 + h264->intra_idr_period - 1) / h264->intra_idr_period + 1) / 2 * 2; + context->gop_coeff = ((1024 + h264->intra_idr_period - 1) / (h264->intra_idr_period + 1)) / 2 * 2; if (context->gop_coeff > VL_VA_ENC_GOP_COEFF) context->gop_coeff = VL_VA_ENC_GOP_COEFF; context->desc.h264enc.gop_size = h264->intra_idr_period * context->gop_coeff;