[svn] / trunk / xvidcore / src / bitstream / mbcoding.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/bitstream/mbcoding.c

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

revision 133, Tue Apr 23 00:05:31 2002 UTC revision 136, Thu Apr 25 06:55:00 2002 UTC
# Line 193  Line 193 
193  }  }
194    
195  static __inline void CodeVector(Bitstream *bs,  static __inline void CodeVector(Bitstream *bs,
196                                  int16_t value,                                  int32_t value,
197                                  int16_t f_code,                                  int32_t f_code,
198                                  Statistics *pStat)                                  Statistics *pStat)
199  {  {
200    
# Line 246  Line 246 
246    
247    
248  static __inline void CodeCoeff(Bitstream *bs,  static __inline void CodeCoeff(Bitstream *bs,
249                                 int16_t qcoeff[64],                                 const int16_t qcoeff[64],
250                                 VLC *table,                                 VLC *table,
251                                 const uint16_t *zigzag,                                 const uint16_t *zigzag,
252                                 uint16_t intra)                                 uint16_t intra)
# Line 280  Line 280 
280  }  }
281    
282    
283  static void CodeBlockIntra(const MBParam * pParam,  static void CodeBlockIntra(const FRAMEINFO * frame,
284                             const MACROBLOCK *pMB,                             const MACROBLOCK *pMB,
285                             int16_t qcoeff[6*64],                             int16_t qcoeff[6*64],
286                             Bitstream * bs,                             Bitstream * bs,
# Line 292  Line 292 
292          cbpy = pMB->cbp >> 2;          cbpy = pMB->cbp >> 2;
293    
294          // write mcbpc          // write mcbpc
295          if(pParam->coding_type == I_VOP) {          if(frame->coding_type == I_VOP) {
296                  mcbpc = ((pMB->mode >> 1) & 3) | ((pMB->cbp & 3) << 2);                  mcbpc = ((pMB->mode >> 1) & 3) | ((pMB->cbp & 3) << 2);
297                  BitstreamPutBits(bs, mcbpc_intra_tab[mcbpc].code, mcbpc_intra_tab[mcbpc].len);                  BitstreamPutBits(bs, mcbpc_intra_tab[mcbpc].code, mcbpc_intra_tab[mcbpc].len);
298          }          }
# Line 315  Line 315 
315                  BitstreamPutBits(bs, pMB->dquant, 2);                  BitstreamPutBits(bs, pMB->dquant, 2);
316    
317          // write interlacing          // write interlacing
318          if (pParam->global_flags & XVID_INTERLACING)          if (frame->global_flags & XVID_INTERLACING)
319          {          {
320                  BitstreamPutBit(bs, pMB->field_dct);                  BitstreamPutBit(bs, pMB->field_dct);
321          }          }
# Line 350  Line 350 
350  }  }
351    
352    
353  static void CodeBlockInter(const MBParam * pParam,  static void CodeBlockInter(const FRAMEINFO * frame,
354                             const MACROBLOCK *pMB,                             const MACROBLOCK *pMB,
355                             int16_t qcoeff[6*64],                             int16_t qcoeff[6*64],
356                             Bitstream * bs,                             Bitstream * bs,
# Line 374  Line 374 
374                  BitstreamPutBits(bs, pMB->dquant, 2);                  BitstreamPutBits(bs, pMB->dquant, 2);
375    
376          // interlacing          // interlacing
377          if (pParam->global_flags & XVID_INTERLACING)          if (frame->global_flags & XVID_INTERLACING)
378          {          {
379                  BitstreamPutBit(bs, pMB->field_dct);                  BitstreamPutBit(bs, pMB->field_dct);
380                  DEBUG1("codep: field_dct: ", pMB->field_dct);                  DEBUG1("codep: field_dct: ", pMB->field_dct);
# Line 397  Line 397 
397          // code motion vector(s)          // code motion vector(s)
398          for(i = 0; i < (pMB->mode == MODE_INTER4V ? 4 : 1); i++)          for(i = 0; i < (pMB->mode == MODE_INTER4V ? 4 : 1); i++)
399          {          {
400                  CodeVector(bs, pMB->pmvs[i].x, pParam->fixed_code, pStat);                  CodeVector(bs, pMB->pmvs[i].x, frame->fcode, pStat);
401                  CodeVector(bs, pMB->pmvs[i].y, pParam->fixed_code, pStat);                  CodeVector(bs, pMB->pmvs[i].y, frame->fcode, pStat);
402          }          }
403    
404          bits = BitstreamPos(bs);          bits = BitstreamPos(bs);
# Line 414  Line 414 
414  }  }
415    
416    
417  void MBCoding(const MBParam * pParam,  void MBCoding(const FRAMEINFO * frame,
418                MACROBLOCK *pMB,                MACROBLOCK *pMB,
419                int16_t qcoeff[6*64],                int16_t qcoeff[6*64],
420                Bitstream * bs,                Bitstream * bs,
# Line 423  Line 423 
423    
424          int intra = (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q);          int intra = (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q);
425    
426          if(pParam->coding_type == P_VOP) {          if(frame->coding_type == P_VOP) {
427                  if(pMB->cbp == 0 && pMB->mode == MODE_INTER &&                  if(pMB->cbp == 0 && pMB->mode == MODE_INTER &&
428                     pMB->mvs[0].x == 0 && pMB->mvs[0].y == 0)                     pMB->mvs[0].x == 0 && pMB->mvs[0].y == 0)
429                  {                  {
# Line 435  Line 435 
435          }          }
436    
437          if(intra)          if(intra)
438                  CodeBlockIntra(pParam, pMB, qcoeff, bs, pStat);                  CodeBlockIntra(frame, pMB, qcoeff, bs, pStat);
439          else          else
440                  CodeBlockInter(pParam, pMB, qcoeff, bs, pStat);                  CodeBlockInter(frame, pMB, qcoeff, bs, pStat);
441    
442  }  }
443    

Legend:
Removed from v.133  
changed lines
  Added in v.136

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