[MPlayer-dev-eng] Wrong YUV4MPEG aspect ratio code
Attila Kinali
attila at kinali.ch
Sat Jul 31 05:23:48 CEST 2004
On Mon, May 24, 2004 at 09:21:32AM +0000, Leonardo Giordani wrote:
> The problem is in demux_y4m.c lines 198-200:
>
> [...]
> ratio = y4m_si_get_sampleaspect(priv->si);
> if (ratio.d != 0 && ratio.n != 0)
> sh->aspect = (float)ratio.n/(float)ratio.d;
> [...]
>
> The Sample Aspect in YUV4MPEG header is the Pixel Aspect Ratio (PAR), not the
> Movie Aspect Ratio (MAR).
>
> If you do not know the PAR just suppose it to be 1:1 and set
>
> MAR = Xdim / Ydim
>
> In this case you know the PAR, so the right computation is
>
> MAR = Xdim * PAR / Ydim
>
> giving for the above picture MAR = 1.3625 (in fact a correct PAL picture is
> 702x576 and not 720x576, thus giving a MAR = 1.3284375 = 1.33 = 4:3).
Any comments on this ?
Michael ? Alex ?
Attila Kinali
More information about the MPlayer-dev-eng
mailing list