[cvs] / xvidcore / src / motion / estimation_rd_based.c Repository:
ViewVC logotype

Diff of /xvidcore/src/motion/estimation_rd_based.c

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

revision 1.1.2.8, Sat Oct 11 16:36:10 2003 UTC revision 1.1.2.9, Thu Nov 13 23:11:24 2003 UTC
# Line 60  Line 60 
60          int sum;          int sum;
61          int bits;          int bits;
62          int distortion = 0;          int distortion = 0;
         int i;  
63    
64          fdct(data);          fdct(data);
65    
# Line 74  Line 73 
73                  if (quant_type) dequant_h263_inter(dqcoeff, coeff, quant);                  if (quant_type) dequant_h263_inter(dqcoeff, coeff, quant);
74                  else dequant_mpeg_inter(dqcoeff, coeff, quant);                  else dequant_mpeg_inter(dqcoeff, coeff, quant);
75    
76                  for (i = 0; i < 64; i++)                  distortion = sse8_16bit(data, dqcoeff, 8*sizeof(int16_t));
                         distortion += (data[i] - dqcoeff[i])*(data[i] - dqcoeff[i]);  
   
77          } else {          } else {
78                    const static int16_t zero_block[64] =
79                            {
80                                    0, 0, 0, 0, 0, 0, 0, 0,
81                                    0, 0, 0, 0, 0, 0, 0, 0,
82                                    0, 0, 0, 0, 0, 0, 0, 0,
83                                    0, 0, 0, 0, 0, 0, 0, 0,
84                                    0, 0, 0, 0, 0, 0, 0, 0,
85                                    0, 0, 0, 0, 0, 0, 0, 0,
86                                    0, 0, 0, 0, 0, 0, 0, 0,
87                                    0, 0, 0, 0, 0, 0, 0, 0,
88                            };
89                  bits = 0;                  bits = 0;
90                  for (i = 0; i < 64; i++)                  distortion = sse8_16bit(data, zero_block, 8*sizeof(int16_t));
                         distortion += data[i]*data[i];  
91          }          }
92    
93    
94          return bits + (LAMBDA*distortion)/(quant*quant);          return bits + (LAMBDA*distortion)/(quant*quant);
95  }  }
96    
# Line 156  Line 164 
164          bits[1] += coded = CodeCoeffIntra_CalcBits(qcoeff, scan_tables[direction]);          bits[1] += coded = CodeCoeffIntra_CalcBits(qcoeff, scan_tables[direction]);
165          if (coded > 0) cbp[1] |= 1 << (5 - block);          if (coded > 0) cbp[1] |= 1 << (5 - block);
166    
167          for (i = 0; i < 64; i++)          distortion = sse8_16bit(coeff, dqcoeff, 8*sizeof(int16_t));
                 distortion += (coeff[i] - dqcoeff[i])*(coeff[i] - dqcoeff[i]);  
   
168    
169          return (LAMBDA*distortion)/(quant*quant);          return (LAMBDA*distortion)/(quant*quant);
   
170  }  }
171    
172    

Legend:
Removed from v.1.1.2.8  
changed lines
  Added in v.1.1.2.9

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