On Sat, 23 Nov 2013 17:53:50 -0500, Justin Ruggles <[email protected]> 
wrote:
> +
> +    if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
> +        if (!s->lossless) {
> +            /* libwebp will automatically convert RGB input to YUV when
> +               encoding lossy. */
> +            av_log(avctx, AV_LOG_WARNING,
> +                   "Using libwebp for RGB-to-YUV conversion. You may want to 
> "
> +                   "consider passing in YUV instead for lossy encoding.\n");

We probably want to print this only once, not per each frame.

> +        }
> +        pic.use_argb    = 1;
> +        pic.argb        = (uint32_t *)frame->data[0];
> +        pic.argb_stride = frame->linesize[0] / 4;
> +    } else {
> +        if (avctx->pix_fmt == AV_PIX_FMT_YUV420P)
> +            pic.colorspace = WEBP_YUV420;
> +        else
> +            pic.colorspace = WEBP_YUV420A;
> +        pic.use_argb  = 0;
> +        pic.y         = frame->data[0];
> +        pic.u         = frame->data[1];
> +        pic.v         = frame->data[2];
> +        pic.y_stride  = frame->linesize[0];
> +        pic.uv_stride = frame->linesize[1];

You should check it's equal to linesize[2] just to be safe.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to