[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 469, Tue Sep 10 22:52:13 2002 UTC revision 499, Sat Sep 21 03:11:36 2002 UTC
# Line 3  Line 3 
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - Bitstream reader/writer functions -   *  - Bitstream reader/writer functions -
5   *   *
6   *  Copyright (C) 2001-2002 - Peter Ross <pross@cs.rmit.edu.au>   *  Copyright (C) 2001-2002 - Peter Ross <pross@xvid.org>
7   *   *
8   *  This program is an implementation of a part of one or more MPEG-4   *  This program is an implementation of a part of one or more MPEG-4
9   *  Video tools as specified in ISO/IEC 14496-2 standard.  Those intending   *  Video tools as specified in ISO/IEC 14496-2 standard.  Those intending
# Line 28  Line 28 
28   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
29   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
30   *   *
31   * $Id: bitstream.c,v 1.29 2002-09-10 22:52:12 edgomez Exp $   * $Id: bitstream.c,v 1.32 2002-09-21 03:07:56 suxen_drol Exp $
32   *   *
33   ****************************************************************************/   ****************************************************************************/
34    
# Line 161  Line 161 
161          uint32_t coding_type;          uint32_t coding_type;
162          uint32_t start_code;          uint32_t start_code;
163          uint32_t time_incr = 0;          uint32_t time_incr = 0;
164          int32_t time_increment;          int32_t time_increment = 0;
165    
166          do {          do {
167                  BitstreamByteAlign(bs);                  BitstreamByteAlign(bs);
# Line 688  Line 688 
688          BitstreamPutBit(bs, 1); // vol_control_parameters          BitstreamPutBit(bs, 1); // vol_control_parameters
689          BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"          BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"
690    
 #ifdef BFRAMES  
         if (pParam->max_bframes > 0) {  
                 BitstreamPutBit(bs, 0); // low_delay  
         } else  
 #endif  
         {  
691                  BitstreamPutBit(bs, 1); // low_delay                  BitstreamPutBit(bs, 1); // low_delay
692          }  
693          BitstreamPutBit(bs, 0); // vbv_parameters (0=not given)          BitstreamPutBit(bs, 0); // vbv_parameters (0=not given)
694    
695          BitstreamPutBits(bs, 0, 2);     // video_object_layer_shape (0=rectangular)          BitstreamPutBits(bs, 0, 2);     // video_object_layer_shape (0=rectangular)
696    
697          WRITE_MARKER();          WRITE_MARKER();
698    
699          /* time_increment_resolution; ignored by current decore versions          /*
700             eg. 2fps     res=2       inc=1           * time_increment_resolution; ignored by current decore versions
701             25fps        res=25      inc=1           *  eg. 2fps     res=2       inc=1
702             29.97fps res=30000   inc=1001           *      25fps    res=25      inc=1
703             *      29.97fps res=30000   inc=1001
704           */           */
 #ifdef BFRAMES  
705          BitstreamPutBits(bs, pParam->fbase, 16);          BitstreamPutBits(bs, pParam->fbase, 16);
706  #else  
         BitstreamPutBits(bs, pParam->fbase, 16);  
 #endif  
707    
708          WRITE_MARKER();          WRITE_MARKER();
709    
 #ifdef BFRAMES  
710          BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1          BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1
711          BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment          BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment
 #else  
         BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1  
         BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment  
 #endif  
712    
713          WRITE_MARKER();          WRITE_MARKER();
714          BitstreamPutBits(bs, pParam->width, 13);        // width          BitstreamPutBits(bs, pParam->width, 13);        // width
# Line 779  Line 766 
766          BitstreamPutBits(bs, frame->coding_type, 2);          BitstreamPutBits(bs, frame->coding_type, 2);
767    
768          // time_base = 0  write n x PutBit(1), PutBit(0)          // time_base = 0  write n x PutBit(1), PutBit(0)
 #ifdef BFRAMES  
769          for (i = 0; i < frame->seconds; i++) {          for (i = 0; i < frame->seconds; i++) {
770                  BitstreamPutBit(bs, 1);                  BitstreamPutBit(bs, 1);
771          }          }
772          BitstreamPutBit(bs, 0);          BitstreamPutBit(bs, 0);
 #else  
         for (i = 0; i < frame->seconds; i++) {  
                 BitstreamPutBit(bs, 1);  
         }  
         BitstreamPutBit(bs, 0);  
 //      BitstreamPutBits(bs, 0, 1);  
 #endif  
773    
774          WRITE_MARKER();          WRITE_MARKER();
775    
776          // time_increment: value=nth_of_sec, nbits = log2(resolution)          // time_increment: value=nth_of_sec, nbits = log2(resolution)
 #ifdef BFRAMES  
777          BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));          BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));
         /*DPRINTF("[%i:%i] %c\n", frame->seconds, frame->ticks,  
                         frame->coding_type == I_VOP ? 'I' : frame->coding_type ==  
                         P_VOP ? 'P' : 'B');*/  
 #else  
         BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));  
 //      BitstreamPutBits(bs, 1, 1);  
 #endif  
778    
779          WRITE_MARKER();          WRITE_MARKER();
780    

Legend:
Removed from v.469  
changed lines
  Added in v.499

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