Hi,

On Sat, Oct 15, 2011 at 4:20 AM, Mashiat Sarker Shakkhar
<[email protected]> wrote:
> +    if (!v->data_out_base) {
> +        /* Allocate temporary data buffer for range mapped pictures */
> +        v->data_out_base = av_malloc(avctx->coded_height * s->linesize + 
> (avctx->coded_height * s->linesize >> 1));
> +        v->data_out[0] = v->data_out_base;
> +        v->data_out[1] = v->data_out[0] + avctx->coded_height * s->linesize;
> +        v->data_out[2] = v->data_out[1] + (avctx->coded_height * s->linesize 
> >> 2);
> +    }
> +    if (!v->data_out_last_base) {
> +        /* We need another buffer to hold reference picture */
> +        v->data_out_last_base = av_malloc(avctx->coded_height * s->linesize 
> + (avctx->coded_height * s->linesize >> 1));
> +        v->data_out_last[0] = v->data_out_last_base;
> +        v->data_out_last[1] = v->data_out_last[0] + avctx->coded_height * 
> s->linesize;
> +        v->data_out_last[2] = v->data_out_last[1] + (avctx->coded_height * 
> s->linesize >> 2);
> +    }

Please don't allocate these directly, instead use
avctx->request_frame() to get the data.

As for the scaling code, please put them in separate functions and put
these in VC1DSPContext (see libavcodec/vc1dsp.c). That will allow us
(you? Interesting to learn) to write SIMD code (SSE2 and so on) to
speed it up by a lot.

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

Reply via email to