diff h263.c @ 1505:010f76d07a27 libavcodec

use lagrange multipler instead of qp for ratecontrol, this may break some things, tell me ASAP if u notice anything broken quality which was 1..31 float is now a 1..FF_LAMBDA_MAX int, and FF_QP2LAMBDA * qp can be used to convert to the new range
author michaelni
date Tue, 07 Oct 2003 11:32:40 +0000
parents 3518325146fc
children e9f83c2323bf
line wrap: on
line diff
--- a/h263.c	Sun Oct 05 21:48:16 2003 +0000
+++ b/h263.c	Tue Oct 07 11:32:40 2003 +0000
@@ -626,7 +626,7 @@
         int best_cbpc_score= INT_MAX;
         int cbpc, cbpy;
         const int offset= (s->mv_type==MV_TYPE_16X16 ? 0 : 16) + (s->dquant ? 8 : 0);
-        const int lambda= (s->qscale*s->qscale*64*105 + 64)>>7; 
+        const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
 
         for(i=0; i<4; i++){
             int score= inter_MCBPC_bits[i + offset] * lambda;
@@ -679,7 +679,7 @@
 
     if(s->flags & CODEC_FLAG_CBP_RD){
         int score=0;
-        const int lambda= (s->qscale*s->qscale*64*105 + 64)>>7; 
+        const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
         
         for(i=0; i<6; i++){
             if(s->coded_score[i] < 0){