[svn] / branches / dev-api-3 / xvidcore / src / bitstream / mbcoding.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/bitstream/mbcoding.c

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

revision 529, Mon Sep 23 10:59:10 2002 UTC revision 530, Mon Sep 23 20:36:02 2002 UTC
# Line 280  Line 280 
280  }  }
281    
282    
283  static void  static __inline void
284  CodeBlockIntra(const FRAMEINFO * frame,  CodeBlockIntra(const FRAMEINFO * frame,
285                             const MACROBLOCK * pMB,                             const MACROBLOCK * pMB,
286                             int16_t qcoeff[6 * 64],                             int16_t qcoeff[6 * 64],
# Line 425  Line 425 
425    
426  }  }
427    
428    /*
429    // moved to mbcoding.h so that in can be 'static __inline'
430  void  void
431  MBSkip(Bitstream * bs)  MBSkip(Bitstream * bs)
432  {  {
433          BitstreamPutBit(bs, 1); // not coded          BitstreamPutBit(bs, 1); // not coded
         return;  
434  }  }
435    */
436    
437  /***************************************************************  /***************************************************************
438   * bframe encoding start   * bframe encoding start
# Line 446  Line 446 
446          3       0001b   forward mc+q            dbquant, mvdf          3       0001b   forward mc+q            dbquant, mvdf
447  */  */
448    
449  void  static __inline void
450  put_bvop_mbtype(Bitstream * bs,  put_bvop_mbtype(Bitstream * bs,
451                                  int value)                                  int value)
452  {  {
453          switch (value) {          switch (value) {
454          case 0:                  case MODE_FORWARD:
                 BitstreamPutBit(bs, 1);  
                 return;  
   
         case 1:  
                 BitstreamPutBit(bs, 0);  
                 BitstreamPutBit(bs, 1);  
                 return;  
   
         case 2:  
                 BitstreamPutBit(bs, 0);  
                 BitstreamPutBit(bs, 0);  
                 BitstreamPutBit(bs, 1);  
                 return;  
   
         case 3:  
455                  BitstreamPutBit(bs, 0);                  BitstreamPutBit(bs, 0);
456                    case MODE_BACKWARD:
457                  BitstreamPutBit(bs, 0);                  BitstreamPutBit(bs, 0);
458                    case MODE_INTERPOLATE:
459                  BitstreamPutBit(bs, 0);                  BitstreamPutBit(bs, 0);
460                    case MODE_DIRECT:
461                  BitstreamPutBit(bs, 1);                  BitstreamPutBit(bs, 1);
462                  return;                  default:
463                            break;
         default:;                                       // invalid!  
   
464          }          }
   
465  }  }
466    
467  /*  /*
# Line 486  Line 471 
471          +2      11b          +2      11b
472  */  */
473    
474  void  static __inline void
475  put_bvop_dbquant(Bitstream * bs,  put_bvop_dbquant(Bitstream * bs,
476                                   int value)                                   int value)
477  {  {
# Line 519  Line 504 
504                           Bitstream * bs,                           Bitstream * bs,
505                           Statistics * pStat)                           Statistics * pStat)
506  {  {
507          int i;          int vcode = fcode;
508            unsigned int i;
509    
510  /*      ------------------------------------------------------------------  /*      ------------------------------------------------------------------
511                  when a block is skipped it is decoded DIRECT(0,0)                  when a block is skipped it is decoded DIRECT(0,0)
# Line 549  Line 535 
535                  put_bvop_dbquant(bs, 0);        // todo: mb->dquant = 0                  put_bvop_dbquant(bs, 0);        // todo: mb->dquant = 0
536          }          }
537    
538          if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) {          switch (mb->mode) {
539                  CodeVector(bs, mb->pmvs[0].x, fcode, pStat);                  case MODE_INTERPOLATE:
540                  CodeVector(bs, mb->pmvs[0].y, fcode, pStat);                          CodeVector(bs, mb->pmvs[1].x, vcode, pStat); //forward vector of interpolate mode
541          }                          CodeVector(bs, mb->pmvs[1].y, vcode, pStat);
542                    case MODE_BACKWARD:
543          if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_BACKWARD) {                          vcode = bcode;
544                  CodeVector(bs, mb->b_pmvs[0].x, bcode, pStat);                  case MODE_FORWARD:
545                  CodeVector(bs, mb->b_pmvs[0].y, bcode, pStat);                          CodeVector(bs, mb->pmvs[0].x, vcode, pStat);
546          }                          CodeVector(bs, mb->pmvs[0].y, vcode, pStat);
547                            break;
548          if (mb->mode == MODE_DIRECT) {                  case MODE_DIRECT:
549                  CodeVector(bs, mb->deltamv.x, 1, pStat);                /* fcode is always 1 for delta vector */                          CodeVector(bs, mb->pmvs[3].x, 1, pStat);        // fcode is always 1 for delta vector
550                  CodeVector(bs, mb->deltamv.y, 1, pStat);                /* prediction is always (0,0) */                          CodeVector(bs, mb->pmvs[3].y, 1, pStat);        // prediction is always (0,0)
551                    default: break;
552          }          }
553    
554          for (i = 0; i < 6; i++) {          for (i = 0; i < 6; i++) {
# Line 649  Line 636 
636    
637  }  }
638    
639  int  static __inline int
640  get_mv_data(Bitstream * bs)  get_mv_data(Bitstream * bs)
641  {  {
642    
# Line 766  Line 753 
753  {  {
754    
755          const uint16_t *scan = scan_tables[direction];          const uint16_t *scan = scan_tables[direction];
756          int level;          int level, run, last;
         int run;  
         int last;  
757    
758          do {          do {
759                  level = get_coeff(bs, &run, &last, 1, 0);                  level = get_coeff(bs, &run, &last, 1, 0);

Legend:
Removed from v.529  
changed lines
  Added in v.530

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