Commit 4126fc41 authored by michaelni's avatar michaelni

fixing qmin==qmax && qsquish==1


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@865 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c34a145d
...@@ -387,7 +387,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q, ...@@ -387,7 +387,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q,
} }
} }
if(s->avctx->rc_qsquish==0.0){ if(s->avctx->rc_qsquish==0.0 || qmin==qmax){
if (q<qmin) q=qmin; if (q<qmin) q=qmin;
else if(q>qmax) q=qmax; else if(q>qmax) q=qmax;
}else{ }else{
...@@ -517,12 +517,12 @@ int ff_rate_estimate_qscale(MpegEncContext *s) ...@@ -517,12 +517,12 @@ int ff_rate_estimate_qscale(MpegEncContext *s)
q= get_qscale(s, rce, rate_factor, picture_number); q= get_qscale(s, rce, rate_factor, picture_number);
assert(q>0.0);
//printf("%f ", q); //printf("%f ", q);
if (pict_type==I_TYPE && s->avctx->i_quant_factor>0.0) if (pict_type==I_TYPE && s->avctx->i_quant_factor>0.0)
q= rcc->next_p_qscale*s->avctx->i_quant_factor + s->avctx->i_quant_offset; q= rcc->next_p_qscale*s->avctx->i_quant_factor + s->avctx->i_quant_offset;
else if(pict_type==B_TYPE && s->avctx->b_quant_factor>0.0) else if(pict_type==B_TYPE && s->avctx->b_quant_factor>0.0)
q= rcc->next_non_b_qscale*s->avctx->b_quant_factor + s->avctx->b_quant_offset; q= rcc->next_non_b_qscale*s->avctx->b_quant_factor + s->avctx->b_quant_offset;
//printf("%f ", q); //printf("%f ", q);
assert(q>0.0); assert(q>0.0);
...@@ -540,6 +540,8 @@ int ff_rate_estimate_qscale(MpegEncContext *s) ...@@ -540,6 +540,8 @@ int ff_rate_estimate_qscale(MpegEncContext *s)
rcc->pass1_wanted_bits+= s->bit_rate/fps; rcc->pass1_wanted_bits+= s->bit_rate/fps;
assert(q>0.0);
if(pict_type != B_TYPE) rcc->next_non_b_qscale= q; if(pict_type != B_TYPE) rcc->next_non_b_qscale= q;
if(pict_type == P_TYPE) rcc->next_p_qscale= q; if(pict_type == P_TYPE) rcc->next_p_qscale= q;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment