[svn] / branches / release-1_3-branch / xvidcore / src / motion / estimation_rd_based.c Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/src/motion/estimation_rd_based.c

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

revision 1925, Mon Dec 27 16:39:33 2010 UTC revision 1930, Wed Dec 29 22:29:51 2010 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.16 2010-12-18 16:02:00 Isibaar Exp $   * $Id: estimation_rd_based.c,v 1.16.2.1 2010-12-29 22:29:44 Isibaar Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 120  Line 120 
120                                          unsigned int lambda,                                          unsigned int lambda,
121                                          const uint16_t * mpeg_quant_matrices,                                          const uint16_t * mpeg_quant_matrices,
122                                          const unsigned int quant_sq,                                          const unsigned int quant_sq,
123                                          const unsigned int metric)                                          const unsigned int metric,
124                                            const int bound)
125  {  {
126          int direction;          int direction;
127          int16_t *pCurrent;          int16_t *pCurrent;
# Line 139  Line 140 
140          }          }
141    
142          predict_acdc(pMB-(x+mb_width*y), x, y, mb_width, block, qcoeff,          predict_acdc(pMB-(x+mb_width*y), x, y, mb_width, block, qcoeff,
143                                  quant, iDcScaler, predictors, 0);                                  quant, iDcScaler, predictors, bound);
144    
145          direction = pMB->acpred_directions[block];          direction = pMB->acpred_directions[block];
146          pCurrent = (int16_t*)pMB->pred_values[block];          pCurrent = (int16_t*)pMB->pred_values[block];
# Line 535  Line 536 
536    
537  static int  static int
538  findRD_intra(SearchData * const Data, MACROBLOCK * pMB,  findRD_intra(SearchData * const Data, MACROBLOCK * pMB,
539                           const int x, const int y, const int mb_width)                           const int x, const int y, const int mb_width, const int bound)
540  {  {
541          unsigned int cbp[2] = {0, 0}, bits[2], i;          unsigned int cbp[2] = {0, 0}, bits[2], i;
542          /* minimum number of bits that WILL be coded in intra - mcbpc 5, cby 2 acdc flag - 1 and DC coeffs - 4*3+2*2 */          /* minimum number of bits that WILL be coded in intra - mcbpc 5, cby 2 acdc flag - 1 and DC coeffs - 4*3+2*2 */
# Line 553  Line 554 
554    
555                  distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, i, in, coeff, dqcoeff,                  distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, i, in, coeff, dqcoeff,
556                                                                  predictors[i], iQuant, Data->quant_type, bits, cbp,                                                                  predictors[i], iQuant, Data->quant_type, bits, cbp,
557                                                                  Data->lambda[i], Data->mpeg_quant_matrices, Data->quant_sq, Data->metric);                                                                  Data->lambda[i], Data->mpeg_quant_matrices, Data->quant_sq,
558                                                                    Data->metric, bound);
559                  bits1 += distortion + BITS_MULT * bits[0];                  bits1 += distortion + BITS_MULT * bits[0];
560                  bits2 += distortion + BITS_MULT * bits[1];                  bits2 += distortion + BITS_MULT * bits[1];
561    
# Line 568  Line 570 
570          transfer_8to16copy(in, Data->CurU, Data->iEdgedWidth/2);          transfer_8to16copy(in, Data->CurU, Data->iEdgedWidth/2);
571          distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, 4, in, coeff, dqcoeff,          distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, 4, in, coeff, dqcoeff,
572                                                                          predictors[4], iQuant, Data->quant_type, bits, cbp,                                                                          predictors[4], iQuant, Data->quant_type, bits, cbp,
573                                                                          Data->lambda[4], Data->mpeg_quant_matrices, Data->quant_sq, Data->metric);                                                                          Data->lambda[4], Data->mpeg_quant_matrices, Data->quant_sq,
574                                                                            Data->metric, bound);
575          bits1 += distortion + BITS_MULT * bits[0];          bits1 += distortion + BITS_MULT * bits[0];
576          bits2 += distortion + BITS_MULT * bits[1];          bits2 += distortion + BITS_MULT * bits[1];
577    
# Line 579  Line 582 
582          transfer_8to16copy(in, Data->CurV, Data->iEdgedWidth/2);          transfer_8to16copy(in, Data->CurV, Data->iEdgedWidth/2);
583          distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, 5, in, coeff, dqcoeff,          distortion = Block_CalcBitsIntra(pMB, x, y, mb_width, 5, in, coeff, dqcoeff,
584                                                                          predictors[5], iQuant, Data->quant_type, bits, cbp,                                                                          predictors[5], iQuant, Data->quant_type, bits, cbp,
585                                                                          Data->lambda[5], Data->mpeg_quant_matrices, Data->quant_sq, Data->metric);                                                                          Data->lambda[5], Data->mpeg_quant_matrices, Data->quant_sq,
586                                                                            Data->metric, bound);
587    
588          bits1 += distortion + BITS_MULT * bits[0];          bits1 += distortion + BITS_MULT * bits[0];
589          bits2 += distortion + BITS_MULT * bits[1];          bits2 += distortion + BITS_MULT * bits[1];
# Line 700  Line 704 
704    
705          /* there is no way for INTRA to take less than 24 bits - go to findRD_intra() for calculations */          /* there is no way for INTRA to take less than 24 bits - go to findRD_intra() for calculations */
706          if (min_rd > 24*BITS_MULT) {          if (min_rd > 24*BITS_MULT) {
707                  intra_rd = findRD_intra(Data, pMB, x, y, pParam->mb_width);                  intra_rd = findRD_intra(Data, pMB, x, y, pParam->mb_width, bound);
708                  if (intra_rd < min_rd) {                  if (intra_rd < min_rd) {
709                          *Data->iMinSAD = min_rd = intra_rd;                          *Data->iMinSAD = min_rd = intra_rd;
710                          mode = MODE_INTRA;                          mode = MODE_INTRA;
# Line 952  Line 956 
956                          }                          }
957                  }                  }
958    
959                  intra_rd = findRD_intra(Data, pMB, x, y, pParam->mb_width);                  intra_rd = findRD_intra(Data, pMB, x, y, pParam->mb_width, bound);
960                  if (intra_rd < min_rd) {                  if (intra_rd < min_rd) {
961                          *Data->iMinSAD = min_rd = intra_rd;                          *Data->iMinSAD = min_rd = intra_rd;
962                          mode = MODE_INTRA;                          mode = MODE_INTRA;

Legend:
Removed from v.1925  
changed lines
  Added in v.1930

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