[svn] / branches / dev-api-4 / xvidcore / src / motion / estimation_rd_based.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/motion/estimation_rd_based.c

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

revision 1204, Thu Nov 13 22:35:30 2003 UTC revision 1205, Thu Nov 13 23:11:24 2003 UTC
# Line 20  Line 20 
20   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
21   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   *   *
23   * $Id: estimation_rd_based.c,v 1.1.2.8 2003-10-11 16:36:10 syskin Exp $   * $Id: estimation_rd_based.c,v 1.1.2.9 2003-11-13 23:11:24 edgomez Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# 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.1204  
changed lines
  Added in v.1205

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