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

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

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

revision 1161, Wed Oct 1 23:23:01 2003 UTC revision 1166, Fri Oct 3 14:01:59 2003 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: mbcoding.c,v 1.44.2.14 2003-10-01 23:23:01 edgomez Exp $   * $Id: mbcoding.c,v 1.44.2.16 2003-10-03 14:01:59 syskin Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 717  Line 717 
717                          DPRINTF(XVID_DEBUG_MB,"codep: field_dct: %i\n", pMB->field_dct);                          DPRINTF(XVID_DEBUG_MB,"codep: field_dct: %i\n", pMB->field_dct);
718                  }                  }
719    
720                  /* if inter block, write field ME flag */                  /* if inter block, write field ME flag ** not implemented yet */
721                  if (pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q) {                  if ((pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q) && (pMB->mcsel == 0)) {
722                          BitstreamPutBit(bs, pMB->field_pred);                          BitstreamPutBit(bs, 0 /*pMB->field_pred*/);
723                          DPRINTF(XVID_DEBUG_MB,"codep: field_pred: %i\n", pMB->field_pred);                          DPRINTF(XVID_DEBUG_MB,"codep: field_pred: %i\n", pMB->field_pred);
724    
725                          /* write field prediction references */                          /* write field prediction references */
726                          if (pMB->field_pred) {                  /*      if (pMB->field_pred) {
727                                  BitstreamPutBit(bs, pMB->field_for_top);                                  BitstreamPutBit(bs, pMB->field_for_top);
728                                  BitstreamPutBit(bs, pMB->field_for_bot);                                  BitstreamPutBit(bs, pMB->field_for_bot);
729                          }                          } */
730                  }                  }
731          }          }
732          /* code motion vector(s) if motion is local  */          /* code motion vector(s) if motion is local  */
# Line 775  Line 775 
775    
776  }  }
777    
   
 /* moved to mbcoding.h so that in can be 'static __inline' */  
 #if 0  
 void  
 MBSkip(Bitstream * bs)  
 {  
         BitstreamPutBit(bs, 1); /* not coded */  
 }  
 #endif  
   
778  /***************************************************************  /***************************************************************
779   * bframe encoding start   * bframe encoding start
780   ***************************************************************/   ***************************************************************/
# Line 848  Line 838 
838    
839    
840  void  void
841  MBCodingBVOP(const MACROBLOCK * mb,  MBCodingBVOP(const FRAMEINFO * const frame,
842                             const MACROBLOCK * mb,
843                           const int16_t qcoeff[6 * 64],                           const int16_t qcoeff[6 * 64],
844                           const int32_t fcode,                           const int32_t fcode,
845                           const int32_t bcode,                           const int32_t bcode,
846                           Bitstream * bs,                           Bitstream * bs,
847                           Statistics * pStat,                           Statistics * pStat)
                          int direction)  
848  {  {
849          int vcode = fcode;          int vcode = fcode;
850          unsigned int i;          unsigned int i;
851    
852            const uint16_t *scan_table =
853                    frame->vop_flags & XVID_VOP_ALTERNATESCAN ?
854                    scan_tables[2] : scan_tables[0];
855    
856    
857  /*      ------------------------------------------------------------------  /*      ------------------------------------------------------------------
858                  when a block is skipped it is decoded DIRECT(0,0)                  when a block is skipped it is decoded DIRECT(0,0)
859                  hence is interpolated from forward & backward frames                  hence is interpolated from forward & backward frames
# Line 887  Line 882 
882                  put_bvop_dbquant(bs, 0);        /* todo: mb->dquant = 0 */                  put_bvop_dbquant(bs, 0);        /* todo: mb->dquant = 0 */
883          }          }
884    
885            if (frame->vol_flags & XVID_VOL_INTERLACING) {
886                    if (mb->cbp) {
887                            BitstreamPutBit(bs, mb->field_dct);
888                            DPRINTF(XVID_DEBUG_MB,"codep: field_dct: %i\n", mb->field_dct);
889                    }
890    
891                    /* if not direct block, write field ME flag */
892                    if (mb->mode != MODE_DIRECT) {
893                            BitstreamPutBit(bs, 0 /*mb->field_pred*/); /* field ME not implemented */
894    
895                            /* write field prediction references */
896                    /*      if (mb->field_pred) {
897                                    BitstreamPutBit(bs, mb->field_for_top);
898                                    BitstreamPutBit(bs, mb->field_for_bot);
899                            }*/
900                    }
901            }
902    
903    
904          switch (mb->mode) {          switch (mb->mode) {
905                  case MODE_INTERPOLATE:                  case MODE_INTERPOLATE:
906                          CodeVector(bs, mb->pmvs[1].x, vcode, pStat); /* forward vector of interpolate mode */                          CodeVector(bs, mb->pmvs[1].x, vcode, pStat); /* forward vector of interpolate mode */

Legend:
Removed from v.1161  
changed lines
  Added in v.1166

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