[FFmpeg-devel] [PATCH 1/2] lavc/vaapi_encode_mpeg2: add support for CBR/VBR

Mark Thompson sw at jkqxz.net
Thu Jan 24 01:34:31 EET 2019


On 16/01/2019 14:34, Linjie Fu wrote:
> Add support for VBR/CBR mode in mpeg2_vaapi encode.
> 
> Fix #7650.
> 
> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> ---
>  libavcodec/vaapi_encode_mpeg2.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
> index 22d7e306bb..a625b15461 100644
> --- a/libavcodec/vaapi_encode_mpeg2.c
> +++ b/libavcodec/vaapi_encode_mpeg2.c
> @@ -541,6 +541,13 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
>                 "%d / %d / %d for I- / P- / B-frames.\n",
>                 priv->quant_i, priv->quant_p, priv->quant_b);
>  
> +    } else if (ctx->va_rc_mode == VA_RC_CBR ||
> +               ctx->va_rc_mode == VA_RC_VBR) {
> +        // These still need to be set for quantiser_scale_code.
> +        priv->quant_i = 10;
> +        priv->quant_p = 10;
> +        priv->quant_b = 10;
> +
>      } else {
>          av_assert0(0 && "Invalid RC mode.");
>      }
> 

See existing patch <https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2018-December/237943.html>.  I'll send a new version of the remainder of that series soon.

- Mark


More information about the ffmpeg-devel mailing list