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

Diff of /xvidcore/src/decoder.c

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

revision 1.37.2.1, Thu Sep 26 01:54:54 2002 UTC revision 1.41, Wed Sep 25 23:37:08 2002 UTC
# Line 53  Line 53 
53   *  26.03.2002  interlacing support - moved transfers outside decode loop   *  26.03.2002  interlacing support - moved transfers outside decode loop
54   *  26.12.2001  decoder_mbinter: dequant/idct moved within if(coded) block   *  26.12.2001  decoder_mbinter: dequant/idct moved within if(coded) block
55   *  22.12.2001  lock based interpolation   *  22.12.2001  lock based interpolation
56   *  01.12.2001  inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>   *  01.12.2001  inital version; (c)2001 peter ross <pross@xvid.org>
57   *   *
58   *  $Id$   *  $Id$
59   *   *
# Line 268  Line 268 
268                  start_timer();                  start_timer();
269                  if (cbp & (1 << (5 - i)))       // coded                  if (cbp & (1 << (5 - i)))       // coded
270                  {                  {
271                          int direction = dec->alternate_vertical_scan ?                          get_intra_block(bs, &block[i * 64], pMB->acpred_directions[i],
272                                  2 : pMB->acpred_directions[i];                                                          start_coeff);
   
                         get_intra_block(bs, &block[i * 64], direction, start_coeff);  
273                  }                  }
274                  stop_coding_timer();                  stop_coding_timer();
275    
# Line 381  Line 379 
379    
380          start_timer();          start_timer();
381          if(dec->quarterpel) {          if(dec->quarterpel) {
382                  DEBUG("QUARTERPEL");                  DPRINTF(DPRINTF_DEBUG, "QUARTERPEL\n");
383                  interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, 16*x_pos, 16*y_pos,                  interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, 16*x_pos, 16*y_pos,
384                                                                    pMB->mvs[0].x, pMB->mvs[0].y, stride,  rounding);                                                                    pMB->mvs[0].x, pMB->mvs[0].y, stride,  rounding);
385                  interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, 16*x_pos + 8, 16*y_pos,                  interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, 16*x_pos + 8, 16*y_pos,
# Line 409  Line 407 
407          stop_comp_timer();          stop_comp_timer();
408    
409          for (i = 0; i < 6; i++) {          for (i = 0; i < 6; i++) {
                 int direction = dec->alternate_vertical_scan ? 2 : 0;  
   
410                  if (cbp & (1 << (5 - i)))       // coded                  if (cbp & (1 << (5 - i)))       // coded
411                  {                  {
412                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear
413    
414                          start_timer();                          start_timer();
415                          get_inter_block(bs, &block[i * 64], direction);                          get_inter_block(bs, &block[i * 64]);
416                          stop_coding_timer();                          stop_coding_timer();
417    
418                          start_timer();                          start_timer();
# Line 513  Line 509 
509    
510                          if (dec->interlacing) {                          if (dec->interlacing) {
511                                  mb->field_dct = BitstreamGetBit(bs);                                  mb->field_dct = BitstreamGetBit(bs);
512                                  DEBUG1("deci: field_dct: ", mb->field_dct);                                  DPRINTF(DPRINTF_DEBUG, "deci: field_dct: %d", mb->field_dct);
513                          }                          }
514    
515                          decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant,                          decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant,
# Line 659  Line 655 
655                                  if (dec->interlacing) {                                  if (dec->interlacing) {
656                                          if (cbp || intra) {                                          if (cbp || intra) {
657                                                  mb->field_dct = BitstreamGetBit(bs);                                                  mb->field_dct = BitstreamGetBit(bs);
658                                                  DEBUG1("decp: field_dct: ", mb->field_dct);                                                  DPRINTF(DPRINTF_DEBUG, "decp: field_dct: %d", mb->field_dct);
659                                          }                                          }
660    
661                                          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) {                                          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) {
662                                                  mb->field_pred = BitstreamGetBit(bs);                                                  mb->field_pred = BitstreamGetBit(bs);
663                                                  DEBUG1("decp: field_pred: ", mb->field_pred);                                                  DPRINTF(DPRINTF_DEBUG, "decp: field_pred: %d", mb->field_pred);
664    
665                                                  if (mb->field_pred) {                                                  if (mb->field_pred) {
666                                                          mb->field_for_top = BitstreamGetBit(bs);                                                          mb->field_for_top = BitstreamGetBit(bs);
667                                                          DEBUG1("decp: field_for_top: ", mb->field_for_top);                                                          DPRINTF(DPRINTF_DEBUG, "decp: field_for_top: %d", mb->field_for_top);
668                                                          mb->field_for_bot = BitstreamGetBit(bs);                                                          mb->field_for_bot = BitstreamGetBit(bs);
669                                                          DEBUG1("decp: field_for_bot: ", mb->field_for_bot);                                                          DPRINTF(DPRINTF_DEBUG, "decp: field_for_bot: %d", mb->field_for_bot);
670                                                  }                                                  }
671                                          }                                          }
672                                  }                                  }
# Line 710  Line 706 
706                                                                  rounding);                                                                  rounding);
707                          } else                          // not coded                          } else                          // not coded
708                          {                          {
709                                  DEBUG2("P-frame MB at (X,Y)=",x,y);                                  DPRINTF(DPRINTF_DEBUG, "P-frame MB at (X,Y)=(%d,%d)", x, y);
710    
711                                  mb->mode = MODE_NOT_CODED;                                  mb->mode = MODE_NOT_CODED;
712                                  mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = 0;                                  mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = 0;
713                                  mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = 0;                                  mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = 0;
# Line 880  Line 877 
877          stop_comp_timer();          stop_comp_timer();
878    
879          for (i = 0; i < 6; i++) {          for (i = 0; i < 6; i++) {
                 int direction = dec->alternate_vertical_scan ? 2 : 0;  
   
880                  if (cbp & (1 << (5 - i)))       // coded                  if (cbp & (1 << (5 - i)))       // coded
881                  {                  {
882                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear
883    
884                          start_timer();                          start_timer();
885                          get_inter_block(bs, &block[i * 64], direction);                          get_inter_block(bs, &block[i * 64]);
886                          stop_coding_timer();                          stop_coding_timer();
887    
888                          start_timer();                          start_timer();
# Line 1048  Line 1043 
1043          stop_comp_timer();          stop_comp_timer();
1044    
1045          for (i = 0; i < 6; i++) {          for (i = 0; i < 6; i++) {
                 int direction = dec->alternate_vertical_scan ? 2 : 0;  
   
1046                  if (cbp & (1 << (5 - i)))       // coded                  if (cbp & (1 << (5 - i)))       // coded
1047                  {                  {
1048                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear                          memset(&block[i * 64], 0, 64 * sizeof(int16_t));        // clear
1049    
1050                          start_timer();                          start_timer();
1051                          get_inter_block(bs, &block[i * 64], direction);                          get_inter_block(bs, &block[i * 64]);
1052                          stop_coding_timer();                          stop_coding_timer();
1053    
1054                          start_timer();                          start_timer();
# Line 1286  Line 1279 
1279                                  break;                                  break;
1280    
1281                          default:                          default:
1282                                  DEBUG1("Not support B-frame mb_type =", mb->mb_type);                                  DPRINTF(DPRINTF_ERROR, "Not support B-frame mb_type = %d", mb->mb_type);
1283                          }                          }
1284    
1285                  }                                               // end of FOR                  }                                               // end of FOR
# Line 1344  Line 1337 
1337                  decoder_pframe(dec, &bs, rounding, quant, fcode_forward,                  decoder_pframe(dec, &bs, rounding, quant, fcode_forward,
1338                                             intra_dc_threshold);                                             intra_dc_threshold);
1339  #ifdef BFRAMES_DEC  #ifdef BFRAMES_DEC
1340                  DEBUG1("P_VOP  Time=", dec->time);                  DPRINTF(DPRINTF_DEBUG, "P_VOP  Time=%d", dec->time);
1341  #endif  #endif
1342                  break;                  break;
1343    
1344          case I_VOP:          case I_VOP:
1345                  decoder_iframe(dec, &bs, quant, intra_dc_threshold);                  decoder_iframe(dec, &bs, quant, intra_dc_threshold);
1346  #ifdef BFRAMES_DEC  #ifdef BFRAMES_DEC
1347                  DEBUG1("I_VOP  Time=", dec->time);                  DPRINTF(DPRINTF_DEBUG, "I_VOP  Time=%d", dec->time);
1348  #endif  #endif
1349                  break;                  break;
1350    
1351          case B_VOP:          case B_VOP:
1352  #ifdef BFRAMES_DEC  #ifdef BFRAMES_DEC
1353                  if (dec->time_pp > dec->time_bp) {                  if (dec->time_pp > dec->time_bp) {
1354                          DEBUG1("B_VOP  Time=", dec->time);                          DPRINTF(DPRINTF_DEBUG, "B_VOP  Time=%d", dec->time);
1355                          decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward);                          decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward);
1356                  } else {                  } else {
1357                          DEBUG("broken B-frame!");                          DPRINTF(DPRINTF_DEBUG, "Broken B_VOP");
1358                  }                  }
1359  #else  #else
1360                  image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height);                  image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height);
# Line 1379  Line 1372 
1372    
1373  #ifdef BFRAMES_DEC_DEBUG  #ifdef BFRAMES_DEC_DEBUG
1374          if (frame->length != BitstreamPos(&bs) / 8){          if (frame->length != BitstreamPos(&bs) / 8){
1375                  DEBUG2("InLen/UseLen",frame->length, BitstreamPos(&bs) / 8);                  DPRINTF(DPRINTF_DEBUG, "InLen: %d / UseLen: %d", frame->length, BitstreamPos(&bs) / 8);
1376          }          }
1377  #endif  #endif
1378          frame->length = BitstreamPos(&bs) / 8;          frame->length = BitstreamPos(&bs) / 8;

Legend:
Removed from v.1.37.2.1  
changed lines
  Added in v.1.41

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