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

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

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

revision 1.24, Thu Jul 18 23:52:39 2002 UTC revision 1.28.2.2, Sat Sep 28 13:01:02 2002 UTC
# Line 446  Line 446 
446    
447    
448                                  if (vol_ver_id != 1) {                                  if (vol_ver_id != 1) {
449                                          dec->quarterpel = BitstreamGetBit(bs);  // quarter_sampe                                          DEBUG("QUARTERPEL BITSTREAM");
450                                          if (dec->quarterpel) {                                          dec->quarterpel = BitstreamGetBit(bs);  // quarter_sample
                                                 DPRINTF(DPRINTF_ERROR, "quarter_sample not supported");  
451                                          }                                          }
452                                  } else {                                  else
453                                          dec->quarterpel = 0;                                          dec->quarterpel = 0;
454                                  }  
455    
456                                  if (!BitstreamGetBit(bs))       // complexity_estimation_disable                                  if (!BitstreamGetBit(bs))       // complexity_estimation_disable
457                                  {                                  {
# Line 547  Line 546 
546                          if (coding_type != B_VOP) {                          if (coding_type != B_VOP) {
547                                  dec->last_time_base = dec->time_base;                                  dec->last_time_base = dec->time_base;
548                                  dec->time_base += time_incr;                                  dec->time_base += time_incr;
549                                  dec->time =                                  dec->time = time_increment;
550                                          dec->time_base * time_increment_resolution +  
551    /*                                      dec->time_base * time_increment_resolution +
552                                          time_increment;                                          time_increment;
553                                  dec->time_pp = (uint32_t)  */                              dec->time_pp = (uint32_t)
554                                          (time_increment_resolution + dec->time - dec->last_non_b_time)%time_increment_resolution;                                          (time_increment_resolution + dec->time - dec->last_non_b_time)%time_increment_resolution;
555                                  dec->last_non_b_time = dec->time;                                  dec->last_non_b_time = dec->time;
556                          } else {                          } else {
557                                  dec->time =                                  dec->time = time_increment;
558    /*
559                                          (dec->last_time_base +                                          (dec->last_time_base +
560                                           time_incr) * time_increment_resolution + time_increment;                                           time_incr) * time_increment_resolution + time_increment;
561    */
562                                  dec->time_bp = (uint32_t)                                  dec->time_bp = (uint32_t)
563                                          (time_increment_resolution + dec->last_non_b_time - dec->time)%time_increment_resolution;                                          (time_increment_resolution + dec->last_non_b_time - dec->time)%time_increment_resolution;
564                          }                          }
# Line 617  Line 619 
619                                  *intra_dc_threshold =                                  *intra_dc_threshold =
620                                          intra_dc_threshold_table[BitstreamGetBits(bs, 3)];                                          intra_dc_threshold_table[BitstreamGetBits(bs, 3)];
621    
622                                    dec->top_field_first = 0;
623                                    dec->alternate_vertical_scan = 0;
624    
625                                  if (dec->interlacing) {                                  if (dec->interlacing) {
626                                          dec->top_field_first = BitstreamGetBit(bs);                                          dec->top_field_first = BitstreamGetBit(bs);
627                                          DPRINTF(DPRINTF_HEADER, "interlace top_field_first %i", dec->top_field_first);                                          DPRINTF(DPRINTF_HEADER, "interlace top_field_first %i", dec->top_field_first);
# Line 712  Line 717 
717          BitstreamPutBit(bs, 0);         // is_object_layer_identified (0=not given)          BitstreamPutBit(bs, 0);         // is_object_layer_identified (0=not given)
718          BitstreamPutBits(bs, 1, 4);     // aspect_ratio_info (1=1:1)          BitstreamPutBits(bs, 1, 4);     // aspect_ratio_info (1=1:1)
719    
 #ifdef BFRAMES  
         if (pParam->max_bframes > 0) {  
                 //DPRINTF("low_delay=1");  
720                  BitstreamPutBit(bs, 1); // vol_control_parameters                  BitstreamPutBit(bs, 1); // vol_control_parameters
721                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"
722    
723    #ifdef BFRAMES
724            if (pParam->max_bframes > 0) {
725                  BitstreamPutBit(bs, 0); // low_delay                  BitstreamPutBit(bs, 0); // low_delay
                 BitstreamPutBit(bs, 0); // vbv_parameters (0=not given)  
726          } else          } else
727  #endif  #endif
728          {          {
729                  BitstreamPutBits(bs, 0, 1);     // vol_control_parameters (0=not given)                  BitstreamPutBit(bs, 1); // low_delay
730          }          }
731            BitstreamPutBit(bs, 0); // vbv_parameters (0=not given)
732    
733          BitstreamPutBits(bs, 0, 2);     // video_object_layer_shape (0=rectangular)          BitstreamPutBits(bs, 0, 2);     // video_object_layer_shape (0=rectangular)
734    
# Line 738  Line 742 
742  #ifdef BFRAMES  #ifdef BFRAMES
743          BitstreamPutBits(bs, pParam->fbase, 16);          BitstreamPutBits(bs, pParam->fbase, 16);
744  #else  #else
745          BitstreamPutBits(bs, 2, 16);          BitstreamPutBits(bs, pParam->fbase, 16);
746  #endif  #endif
747    
748          WRITE_MARKER();          WRITE_MARKER();
# Line 747  Line 751 
751          BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1          BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1
752          BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment          BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment
753  #else  #else
754          BitstreamPutBit(bs, 0);         // fixed_vop_rate = 0          BitstreamPutBit(bs, 1);         // fixed_vop_rate = 1
755            BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase));    // fixed_vop_time_increment
756  #endif  #endif
757    
758          WRITE_MARKER();          WRITE_MARKER();
# Line 798  Line 803 
803                                                  const FRAMEINFO * frame,                                                  const FRAMEINFO * frame,
804                                                  int vop_coded)                                                  int vop_coded)
805  {  {
 #ifdef BFRAMES  
806          uint32_t i;          uint32_t i;
807  #endif  
808          BitstreamPad(bs);          BitstreamPad(bs);
809          BitstreamPutBits(bs, VOP_START_CODE, 32);          BitstreamPutBits(bs, VOP_START_CODE, 32);
810    
811          BitstreamPutBits(bs, frame->coding_type, 2);          BitstreamPutBits(bs, frame->coding_type, 2);
812    
         // time_base = 0  write n x PutBit(1), PutBit(0)  
813  #ifdef BFRAMES  #ifdef BFRAMES
814          for (i = 0; i < frame->seconds; i++) {          for (i = 0; i < frame->seconds; i++) {
815                  BitstreamPutBit(bs, 1);                  BitstreamPutBit(bs, 1);
816          }          }
817          BitstreamPutBit(bs, 0);          BitstreamPutBit(bs, 0);
818  #else  #else
819          BitstreamPutBits(bs, 0, 1);          for (i = 0; i < frame->seconds; i++) {
820                    BitstreamPutBit(bs, 1);
821            }
822            BitstreamPutBit(bs, 0);
823    //      BitstreamPutBits(bs, 0, 1);
824  #endif  #endif
825    
826          WRITE_MARKER();          WRITE_MARKER();
# Line 825  Line 832 
832                          frame->coding_type == I_VOP ? 'I' : frame->coding_type ==                          frame->coding_type == I_VOP ? 'I' : frame->coding_type ==
833                          P_VOP ? 'P' : 'B');*/                          P_VOP ? 'P' : 'B');*/
834  #else  #else
835          BitstreamPutBits(bs, 1, 1);          BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase));
836    //      BitstreamPutBits(bs, 1, 1);
837  #endif  #endif
838    
839          WRITE_MARKER();          WRITE_MARKER();
# Line 843  Line 851 
851          BitstreamPutBits(bs, 0, 3);     // intra_dc_vlc_threshold          BitstreamPutBits(bs, 0, 3);     // intra_dc_vlc_threshold
852    
853          if (frame->global_flags & XVID_INTERLACING) {          if (frame->global_flags & XVID_INTERLACING) {
854                  BitstreamPutBit(bs, 1); // top field first                  BitstreamPutBit(bs, (frame->global_flags & XVID_TOPFIELDFIRST));
855                  BitstreamPutBit(bs, 0); // alternate vertical scan                  BitstreamPutBit(bs, (frame->global_flags & XVID_ALTERNATESCAN));
856          }          }
857    
858          BitstreamPutBits(bs, frame->quant, 5);  // quantizer          BitstreamPutBits(bs, frame->quant, 5);  // quantizer

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.28.2.2

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