* modules/packetizer/mpegvideo.c: get aspect ratio for MPEG2 video streams (still needs to be done for MPEG1).
* modules/codec/libmpeg2.c: use p_dec->fmt_in.video.i_aspect if available.
* modules/stream_out/transcode.c, modules/codec/ffmpeg/encoder.c: respect aspect ratio during transcoding.
* vlc_block_helper.h: Helper functions for data blocks management.
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlc_block_helper.h,v 1.6 2003/12/06 23:25:23 gbazin Exp $
+ * $Id: vlc_block_helper.h,v 1.7 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*pi_offset += i_offset;
}
+ *pi_offset -= i_match;
return VLC_EGENERIC;
}
* encoder.c: video and audio encoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: encoder.c,v 1.18 2003/12/04 23:15:01 gbazin Exp $
+ * $Id: encoder.c,v 1.19 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
#if LIBAVCODEC_BUILD >= 4687
p_context->sample_aspect_ratio =
- av_d2q( p_enc->fmt_in.video.i_aspect * p_context->height /
- p_context->width / VOUT_ASPECT_FACTOR, 255 );
+ (AVRational){ p_enc->fmt_in.video.i_aspect *
+ (int64_t)p_context->height / p_context->width,
+ VOUT_ASPECT_FACTOR };
#else
p_context->aspect_ratio = ((float)p_enc->fmt_in.video.i_aspect) /
VOUT_ASPECT_FACTOR;
* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: libmpeg2.c,v 1.36 2003/12/05 14:58:03 gbazin Exp $
+ * $Id: libmpeg2.c,v 1.37 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
if( p_dec->fmt_in.video.i_aspect )
{
p_sys->i_aspect = p_dec->fmt_in.video.i_aspect;
+ if( p_sys->i_aspect <= AR_221_1_PICTURE )
switch( p_sys->i_aspect )
{
case AR_3_4_PICTURE:
p_sys->i_aspect = VOUT_ASPECT_FACTOR * 221 / 100;
break;
case AR_SQUARE_PICTURE:
- default:
p_sys->i_aspect = VOUT_ASPECT_FACTOR *
p_sys->p_info->sequence->width /
p_sys->p_info->sequence->height;
* mpegvideo.c: parse and packetize an MPEG1/2 video stream
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: mpegvideo.c,v 1.24 2003/12/06 23:25:23 gbazin Exp $
+ * $Id: mpegvideo.c,v 1.25 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
p_frag->p_buffer[9]&0x80 ? VLC_TRUE : VLC_FALSE;
}
-#if 0
p_dec->fmt_out.video.i_aspect =
mpeg2_aspect[p_sys->i_aspect_ratio_info][0] *
VOUT_ASPECT_FACTOR /
mpeg2_aspect[p_sys->i_aspect_ratio_info][1];
-#endif
}
else if( i_type == 0x08 )
* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.59 2003/12/06 22:53:07 jpsaman Exp $
+ * $Id: transcode.c,v 1.60 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
id->p_encoder->fmt_in.video.i_aspect = VOUT_ASPECT_FACTOR *
id->ff_dec_c->aspect_ratio;
#endif
+ }
+ /* Check whether a particular aspect ratio was requested */
+ if( id->f_src.video.i_aspect )
+ {
+ id->p_encoder->fmt_in.video.i_aspect = id->f_src.video.i_aspect;
+ id->f_dst.video.i_aspect = id->f_src.video.i_aspect;
}
id->p_encoder->fmt_out = id->p_encoder->fmt_in;