[Ffmpeg-devel] Re: Another question about cropping and scaling

Baptiste COUDURIER baptiste.coudurier
Thu Mar 9 17:29:32 CET 2006


Hi,

Luca Abeni wrote:
>[...]

> +	/*
> +	tmp.data[0] = final_picture->data[0] +
> +		((final_picture->linesize[0] * ost->padtop) + ost->padleft);
> +	tmp.data[1] = final_picture->data[1] +
> +		(((final_picture->linesize[1] * ost->padtop) + ost->padleft) >> 1);
> +	tmp.data[2] = final_picture->data[2] +
> +		(((final_picture->linesize[2] * ost->padtop) + ost->padleft) >> 1);
> ++*/
> +        picture_pad_temp.data[0] = final_picture->data[0] +
> +                (ost->padtop * final_picture->linesize[0]) + ost->padleft;
> +
> +        picture_pad_temp.data[1] = final_picture->data[1] +
> +                ((ost->padtop >> 1) * final_picture->linesize[1]) +
> +                (ost->padleft >> 1);
> +
> +        picture_pad_temp.data[2] = final_picture->data[2] +
> +                ((ost->padtop >> 1) * final_picture->linesize[2]) +
> +                (ost->padleft >> 1);
> +

Yes, those >>1 are wrong. It depends on x and y chroma shifts, depending
on enc pix_fmt.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312





More information about the ffmpeg-devel mailing list