1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-05 23:58:59 +02:00

qmin/qmax cleanup

Originally committed as revision 1689 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-03-17 11:02:33 +00:00
parent 6c949d129b
commit c5a9ab69c2
3 changed files with 3 additions and 7 deletions

View File

@ -515,8 +515,6 @@ int MPV_encode_init(AVCodecContext *avctx)
s->rtp_payload_size = avctx->rtp_payload_size;
if (avctx->rtp_callback)
s->rtp_callback = avctx->rtp_callback;
s->qmin= avctx->qmin;
s->qmax= avctx->qmax;
s->max_qdiff= avctx->max_qdiff;
s->qcompress= avctx->qcompress;
s->qblur= avctx->qblur;

View File

@ -208,8 +208,6 @@ typedef struct MpegEncContext {
int fixed_qscale; ///< fixed qscale if non zero
float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
int qmin; ///< min qscale
int qmax; ///< max qscale
int max_qdiff; ///< max qscale difference between frames
int encoding; ///< true if we are encoding (vs decoding)
int flags; ///< AVCodecContext.flags (HQ, MV4, ...)

View File

@ -356,8 +356,8 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl
* gets the qmin & qmax for pict_type
*/
static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pict_type){
int qmin= s->qmin;
int qmax= s->qmax;
int qmin= s->avctx->qmin;
int qmax= s->avctx->qmax;
if(pict_type==B_TYPE){
qmin= (int)(qmin*ABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5);
@ -368,7 +368,7 @@ static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pic
}
if(qmin<1) qmin=1;
if(qmin==1 && s->qmin>1) qmin=2; //avoid qmin=1 unless the user wants qmin=1
if(qmin==1 && s->avctx->qmin>1) qmin=2; //avoid qmin=1 unless the user wants qmin=1
if(qmin<3 && s->max_qcoeff<=128 && pict_type==I_TYPE) qmin=3; //reduce cliping problems