[vlc-devel] [PATCH 6/7] codec/schroedinger: update to inform vlc about clean area
fenrir at via.ecp.fr
Sat Nov 29 11:04:37 CET 2008
On Thu, Nov 27, 2008, davidf+nntp at woaf.net wrote:
> + /* aspect_ratio_[numerator|denominator] describes the pixel aspect ratio
> + * the picture aspect ratio is related to the clean width and height */
> + /* i_aspect is the aspect ratio of the entire frame, vlc will calculate
> + * the SAR later, and hopefully just display the clean area: Eg.
> + * 625 line video shuold be 702 active samples which is rounded to 704.
> + * This is often transmited as 720 samples, with 8|9 black pels on either
> + * side (ie clean area is ~704). For wide screen, the SAR makes the
> + * 704x576 raster be 16:9; however the physical aspect ratio for using
> + * 720 samples would be >16:9. The same applies to 4:3.
> + */
> + p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR *
> ( p_sys->p_format->aspect_ratio_numerator * p_sys->p_format->width ) /
> + ( p_sys->p_format->aspect_ratio_denominator * p_sys->p_format->height );
I do not know the range of aspect_ratio_numerator/denominator, but the whole calcul
might overflow 31 bits:
- VOUT_ASPECT_FACTOR is 432000
- width can be 1920
-> numerator has to be lower or equal to 2 to not overflow 2^31...
A cast to int64_t is needed.
More information about the vlc-devel