[FFmpeg-devel] [PATCHv2 2/6] avcodec/libvpxenc: only allocate alpha U/V planes on size changes

James Zern jzern at google.com
Tue Nov 5 02:55:23 EET 2019


On Sat, Nov 2, 2019 at 9:20 AM Marton Balint <cus at passwd.hu> wrote:
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavcodec/libvpxenc.c | 60 ++++++++++++++++++++++++++++++--------------------
>  1 file changed, 36 insertions(+), 24 deletions(-)
>

lgtm. I'll apply this set of patches soon if there aren't any further comments.

> [...]
> +static int realloc_alpha_uv(AVCodecContext *avctx, int width, int height)
> +{
> +    VPxContext *ctx = avctx->priv_data;
> +    struct vpx_image *rawimg_alpha = &ctx->rawimg_alpha;
> +    unsigned char **planes = rawimg_alpha->planes;
> +    int *stride = rawimg_alpha->stride;
> +
> +    if (!planes[VPX_PLANE_U] ||
> +        !planes[VPX_PLANE_V] ||
> +        width  != (int)rawimg_alpha->d_w ||
> +        height != (int)rawimg_alpha->d_h)
> +    {

This should be joined with the previous line, I've updated it locally.


More information about the ffmpeg-devel mailing list