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

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

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

revision 1912, Sat Dec 18 10:17:35 2010 UTC revision 1913, Sat Dec 18 16:02:08 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: bitstream.c,v 1.59 2010-08-10 15:00:06 Isibaar Exp $   * $Id: bitstream.c,v 1.60 2010-12-18 16:02:00 Isibaar Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 1072  Line 1072 
1072  void  void
1073  BitstreamWriteVolHeader(Bitstream * const bs,  BitstreamWriteVolHeader(Bitstream * const bs,
1074                                                  const MBParam * pParam,                                                  const MBParam * pParam,
1075                                                  const FRAMEINFO * const frame)                                                  const FRAMEINFO * const frame,
1076                                                    const int num_slices)
1077  {  {
1078          static const unsigned int vo_id = 0;          static const unsigned int vo_id = 0;
1079          static const unsigned int vol_id = 0;          static const unsigned int vol_id = 0;
# Line 1237  Line 1238 
1238          }          }
1239    
1240          BitstreamPutBit(bs, 1);         /* complexity_estimation_disable */          BitstreamPutBit(bs, 1);         /* complexity_estimation_disable */
1241          BitstreamPutBit(bs, 1);         /* resync_marker_disable */  
1242            if (num_slices > 1)
1243                    BitstreamPutBit(bs, 0);         /* resync_marker_enabled */
1244            else
1245                    BitstreamPutBit(bs, 1);         /* resync_marker_disabled */
1246    
1247          BitstreamPutBit(bs, 0);         /* data_partitioned */          BitstreamPutBit(bs, 0);         /* data_partitioned */
1248    
1249          if (vol_ver_id != 1) {          if (vol_ver_id != 1) {
# Line 1446  Line 1452 
1452    
1453      if (frame->coding_type == I_VOP)      if (frame->coding_type == I_VOP)
1454        nbitsresyncmarker = NUMBITS_VP_RESYNC_MARKER;  /* 16 zeros followed by a 1. */        nbitsresyncmarker = NUMBITS_VP_RESYNC_MARKER;  /* 16 zeros followed by a 1. */
1455      else if (frame->coding_type == P_VOP)      else if (frame->coding_type == B_VOP) /* B_VOP */
1456        nbitsresyncmarker = NUMBITS_VP_RESYNC_MARKER-1 + frame->fcode;        nbitsresyncmarker = MAX(NUMBITS_VP_RESYNC_MARKER+1, NUMBITS_VP_RESYNC_MARKER + MAX(frame->fcode, frame->bcode) - 1);
1457      else /* B_VOP */      else /*(frame->coding_type == P_VOP)*/
1458        nbitsresyncmarker = MAX(NUMBITS_VP_RESYNC_MARKER+1, NUMBITS_VP_RESYNC_MARKER-1 + MAX(frame->fcode, frame->bcode));                  nbitsresyncmarker = NUMBITS_VP_RESYNC_MARKER + frame->fcode - 1;
1459    
     BitstreamPadAlways(bs);  
1460      BitstreamPutBits(bs, RESYNC_MARKER, nbitsresyncmarker);      BitstreamPutBits(bs, RESYNC_MARKER, nbitsresyncmarker);
1461      BitstreamPutBits(bs, mbnum, mbnum_bits);      BitstreamPutBits(bs, mbnum, mbnum_bits);
1462      BitstreamPutBits(bs, frame->quant, 5);      BitstreamPutBits(bs, frame->quant, 5);

Legend:
Removed from v.1912  
changed lines
  Added in v.1913

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