1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

forgot the const bits in 2pass curve matching (patch (with rounding removed) by Rémi Guyomarch <rguyom at pobox dot com>)

Originally committed as revision 866 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2002-08-26 08:14:36 +00:00
parent c695ca3bce
commit 405469cefd

View File

@ -658,7 +658,7 @@ static int init_pass2(MpegEncContext *s)
if(expected_bits < all_available_bits) avg_quantizer[P_TYPE]-= step; if(expected_bits < all_available_bits) avg_quantizer[P_TYPE]-= step;
//printf("%f %lld %f\n", expected_bits, all_available_bits, avg_quantizer[P_TYPE]); //printf("%f %lld %f\n", expected_bits, all_available_bits, avg_quantizer[P_TYPE]);
} }
printf("qp_i:%f, qp_p:%f, qp_b:%f\n", avg_quantizer[I_TYPE],avg_quantizer[P_TYPE],avg_quantizer[B_TYPE]); //printf("qp_i:%f, qp_p:%f, qp_b:%f\n", avg_quantizer[I_TYPE],avg_quantizer[P_TYPE],avg_quantizer[B_TYPE]);
for(i=0; i<5; i++){ for(i=0; i<5; i++){
available_bits[i]= const_bits[i] + complexity[i]/avg_quantizer[i]; available_bits[i]= const_bits[i] + complexity[i]/avg_quantizer[i];
@ -723,7 +723,7 @@ printf("qp_i:%f, qp_p:%f, qp_b:%f\n", avg_quantizer[I_TYPE],avg_quantizer[P_TYPE
RateControlEntry *rce= &rcc->entry[i]; RateControlEntry *rce= &rcc->entry[i];
double bits; double bits;
rce->new_qscale= modify_qscale(s, rce, blured_qscale[i], i); rce->new_qscale= modify_qscale(s, rce, blured_qscale[i], i);
bits= qp2bits(rce, rce->new_qscale); bits= qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;
//printf("%d %f\n", rce->new_bits, blured_qscale[i]); //printf("%d %f\n", rce->new_bits, blured_qscale[i]);
update_rc_buffer(s, bits); update_rc_buffer(s, bits);