Mercurial > libavcodec.hg
comparison libxvidff.c @ 6670:33d3c14d5a57 libavcodec
Set pixel aspect ratio for libxvid wrapper.
Patch by Thorsten Jordan tjordanATmacrosystem de
author | benoit |
---|---|
date | Thu, 24 Apr 2008 12:39:25 +0000 |
parents | c22932db0ebb |
children | 5df0c730234d |
comparison
equal
deleted
inserted
replaced
6669:5ac847f760fc | 6670:33d3c14d5a57 |
---|---|
403 /* Encoder Flags */ | 403 /* Encoder Flags */ |
404 xvid_enc_frame.vop_flags = x->vop_flags; | 404 xvid_enc_frame.vop_flags = x->vop_flags; |
405 xvid_enc_frame.vol_flags = x->vol_flags; | 405 xvid_enc_frame.vol_flags = x->vol_flags; |
406 xvid_enc_frame.motion = x->me_flags; | 406 xvid_enc_frame.motion = x->me_flags; |
407 xvid_enc_frame.type = XVID_TYPE_AUTO; | 407 xvid_enc_frame.type = XVID_TYPE_AUTO; |
408 | |
409 /* Pixel aspect ratio setting */ | |
410 if (avctx->sample_aspect_ratio.num < 1 || avctx->sample_aspect_ratio.num > 255 || | |
411 avctx->sample_aspect_ratio.den < 1 || avctx->sample_aspect_ratio.den > 255) { | |
412 av_log(avctx, AV_LOG_ERROR, "Invalid pixel aspect ratio %i/%i\n", | |
413 avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den); | |
414 return -1; | |
415 } | |
416 xvid_enc_frame.par = XVID_PAR_EXT; | |
417 xvid_enc_frame.par_width = avctx->sample_aspect_ratio.num; | |
418 xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den; | |
408 | 419 |
409 /* Quant Setting */ | 420 /* Quant Setting */ |
410 if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA; | 421 if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA; |
411 else xvid_enc_frame.quant = 0; | 422 else xvid_enc_frame.quant = 0; |
412 | 423 |