[svn] / trunk / xvidcore / src / motion / motion_est.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/motion/motion_est.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1071, Thu Jun 19 09:59:37 2003 UTC revision 1072, Thu Jun 19 10:06:40 2003 UTC
# Line 26  Line 26 
26   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
27   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
28   *   *
29   *  $Id: motion_est.h,v 1.8 2003-05-14 13:21:47 syskin Exp $   *  $Id: motion_est.h,v 1.9 2003-06-19 10:06:40 syskin Exp $
30   *   *
31   ***************************************************************************/   ***************************************************************************/
32    
# Line 340  Line 340 
340          }          }
341          bits += (BITS_MULT*BITS_MULT*distortion)/lambda;          bits += (BITS_MULT*BITS_MULT*distortion)/lambda;
342    
   
343          return bits;          return bits;
344  }  }
345    
# Line 355  Line 354 
354          int bits, i;          int bits, i;
355          const int lambda = LAMBDA*quant*quant;          const int lambda = LAMBDA*quant*quant;
356          int distortion = 0;          int distortion = 0;
357          uint32_t iDcScaler = get_dc_scaler(quant, block > 3);          uint32_t iDcScaler = get_dc_scaler(quant, block < 4);
358          int b_dc;          int b_dc;
359    
360          fdct(data);          fdct(data);
361          data[0] -= 1024;          data[0] -= 1024;
362    
363          if (quant_type == 0) quant_intra(coeff, data, quant, iDcScaler);          if (quant_type == 0) quant_intra_c(coeff, data, quant, iDcScaler); // MUST BE _C
364          else quant4_intra(coeff, data, quant, iDcScaler);          else quant4_intra_c(coeff, data, quant, iDcScaler); // MUST BE _C
365    
366          b_dc = coeff[0];          b_dc = coeff[0];
367          if (block < 4) {          if (block < 4) {
# Line 370  Line 369 
369                  *dcpred = b_dc;                  *dcpred = b_dc;
370          }          }
371    
         *cbp |= 1 << (5 - block);  
372          bits = BITS_MULT*CodeCoeffIntra_CalcBits(coeff, scan_tables[0]);          bits = BITS_MULT*CodeCoeffIntra_CalcBits(coeff, scan_tables[0]);
         bits += BITS_MULT*dcy_tab[coeff[0] + 255].len;  
373          if (bits != 0) *cbp |= 1 << (5 - block);          if (bits != 0) *cbp |= 1 << (5 - block);
374    
375            if (block < 4) bits += BITS_MULT*dcy_tab[coeff[0] + 255].len;
376            else bits += BITS_MULT*dcc_tab[coeff[0] + 255].len;
377    
378          coeff[0] = b_dc;          coeff[0] = b_dc;
379          if (quant_type == 0) dequant_intra(coeff, coeff, quant, iDcScaler);          if (quant_type == 0) dequant_intra(coeff, coeff, quant, iDcScaler);
380          else dequant4_intra(coeff, coeff, quant, iDcScaler);          else dequant4_intra(coeff, coeff, quant, iDcScaler);

Legend:
Removed from v.1071  
changed lines
  Added in v.1072

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4