Skip to content
Snippets Groups Projects
Commit 3fd6b336 authored by Thorsten Jordan's avatar Thorsten Jordan Committed by Benoit Fouet
Browse files

Set pixel aspect ratio for libxvid wrapper.

Patch by Thorsten Jordan tjordanATmacrosystem de

Originally committed as revision 12936 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 95a6a015
No related branches found
No related tags found
No related merge requests found
...@@ -406,6 +406,17 @@ int ff_xvid_encode_frame(AVCodecContext *avctx, ...@@ -406,6 +406,17 @@ int ff_xvid_encode_frame(AVCodecContext *avctx,
xvid_enc_frame.motion = x->me_flags; xvid_enc_frame.motion = x->me_flags;
xvid_enc_frame.type = XVID_TYPE_AUTO; xvid_enc_frame.type = XVID_TYPE_AUTO;
/* Pixel aspect ratio setting */
if (avctx->sample_aspect_ratio.num < 1 || avctx->sample_aspect_ratio.num > 255 ||
avctx->sample_aspect_ratio.den < 1 || avctx->sample_aspect_ratio.den > 255) {
av_log(avctx, AV_LOG_ERROR, "Invalid pixel aspect ratio %i/%i\n",
avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
return -1;
}
xvid_enc_frame.par = XVID_PAR_EXT;
xvid_enc_frame.par_width = avctx->sample_aspect_ratio.num;
xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den;
/* Quant Setting */ /* Quant Setting */
if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA; if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA;
else xvid_enc_frame.quant = 0; else xvid_enc_frame.quant = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment