[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 223, Wed Jun 19 01:01:02 2002 UTC revision 229, Thu Jun 20 14:05:58 2002 UTC
# Line 41  Line 41 
41    *                                                                            *    *                                                                            *
42    *  Revision history:                                                         *    *  Revision history:                                                         *
43    *                                                                            *    *                                                                            *
44      *  20.05.2002 added BitstreamWriteUserData                                   *
45    *  19.06.2002  Fix a little bug in use custom quant matrix                   *    *  19.06.2002  Fix a little bug in use custom quant matrix                   *
46    *              MinChen <chenm001@163.com>                                    *    *              MinChen <chenm001@163.com>                                    *
47    *  08.05.2002  add low_delay support for B_VOP decode                        *    *  08.05.2002  add low_delay support for B_VOP decode                        *
# Line 616  Line 617 
617    
618  #ifdef BFRAMES  #ifdef BFRAMES
619          if (pParam->max_bframes > 0) {          if (pParam->max_bframes > 0) {
620                  dprintf("low_delay=1");                  DPRINTF("low_delay=1");
621                  BitstreamPutBit(bs, 1); // vol_control_parameters                  BitstreamPutBit(bs, 1); // vol_control_parameters
622                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"
623                  BitstreamPutBit(bs, 0); // low_delay                  BitstreamPutBit(bs, 0); // low_delay
# Line 696  Line 697 
697  void  void
698  BitstreamWriteVopHeader(Bitstream * const bs,  BitstreamWriteVopHeader(Bitstream * const bs,
699                                                  const MBParam * pParam,                                                  const MBParam * pParam,
700                                                  const FRAMEINFO * frame)                                                  const FRAMEINFO * frame,
701                                                    int vop_coded)
702  {  {
703  #ifdef BFRAMES  #ifdef BFRAMES
704          uint32_t i;          uint32_t i;
# Line 721  Line 723 
723          // time_increment: value=nth_of_sec, nbits = log2(resolution)          // time_increment: value=nth_of_sec, nbits = log2(resolution)
724  #ifdef BFRAMES  #ifdef BFRAMES
725          BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));          BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));
726          dprintf("[%i:%i] %c\n", frame->seconds, frame->ticks,          DPRINTF("[%i:%i] %c\n", frame->seconds, frame->ticks,
727                          frame->coding_type == I_VOP ? 'I' : frame->coding_type ==                          frame->coding_type == I_VOP ? 'I' : frame->coding_type ==
728                          P_VOP ? 'P' : 'B');                          P_VOP ? 'P' : 'B');
729  #else  #else
# Line 730  Line 732 
732    
733          WRITE_MARKER();          WRITE_MARKER();
734    
735            if (!vop_coded) {
736                    BitstreamPutBits(bs, 0, 1);
737                    return;
738            }
739    
740          BitstreamPutBits(bs, 1, 1);     // vop_coded          BitstreamPutBits(bs, 1, 1);     // vop_coded
741    
742          if (frame->coding_type == P_VOP)          if (frame->coding_type == P_VOP)
# Line 751  Line 758 
758                  BitstreamPutBits(bs, frame->bcode, 3);  // backward_fixed_code                  BitstreamPutBits(bs, frame->bcode, 3);  // backward_fixed_code
759    
760  }  }
761    
762    
763    void
764    BitstreamWriteUserData(Bitstream * const bs,
765                                                    uint8_t * data,
766                                                    const int length)
767    {
768            int i;
769    
770            BitstreamPad(bs);
771            BitstreamPutBits(bs, USERDATA_START_CODE, 32);
772    
773            for (i = 0; i < length; i++) {
774                    BitstreamPutBits(bs, data[i], 8);
775            }
776    
777    }

Legend:
Removed from v.223  
changed lines
  Added in v.229

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