[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.22, Sun Jun 30 10:46:29 2002 UTC revision 1.27, Mon Sep 2 21:15:37 2002 UTC
# Line 41  Line 41 
41    *                                                                            *    *                                                                            *
42    *  Revision history:                                                         *    *  Revision history:                                                         *
43    *                                                                            *    *                                                                            *
44    *      22.05.2002 bs_put_matrix fix    *  11.07.2002 add VOP width & height return to dec when dec->width           *
45      *             or dec->height is 0  (for use in examples/ex1.c)               *
46      *             MinChen <chenm001@163.com>                                     *
47      *  22.05.2002 bs_put_matrix fix                                              *
48    *  20.05.2002 added BitstreamWriteUserData                                   *    *  20.05.2002 added BitstreamWriteUserData                                   *
49    *  19.06.2002  Fix a little bug in use custom quant matrix                   *    *  19.06.2002  Fix a little bug in use custom quant matrix                   *
50    *              MinChen <chenm001@163.com>                                    *    *              MinChen <chenm001@163.com>                                    *
# Line 327  Line 330 
330    
331                          DPRINTF(DPRINTF_HEADER,"vop_time_increment_resolution %i", time_increment_resolution);                          DPRINTF(DPRINTF_HEADER,"vop_time_increment_resolution %i", time_increment_resolution);
332    
333                          time_increment_resolution--;  //                      time_increment_resolution--;
334    
335                          if (time_increment_resolution > 0) {                          if (time_increment_resolution > 0) {
336                                  dec->time_inc_bits = log2bin(time_increment_resolution);                                  dec->time_inc_bits = log2bin(time_increment_resolution-1);
337                          } else {                          } else {
338                                  // dec->time_inc_bits = 0;                                  // dec->time_inc_bits = 0;
339                                  // for "old" xvid compatibility, set time_inc_bits = 1                                  // for "old" xvid compatibility, set time_inc_bits = 1
# Line 359  Line 362 
362                                          DPRINTF(DPRINTF_HEADER, "width %i", width);                                          DPRINTF(DPRINTF_HEADER, "width %i", width);
363                                          DPRINTF(DPRINTF_HEADER, "height %i", height);                                          DPRINTF(DPRINTF_HEADER, "height %i", height);
364    
365                                            // for auto set width & height
366                                            if (dec->width == 0)
367                                                    dec->width = width;
368                                            if (dec->height == 0)
369                                                    dec->height = height;
370    
371                                          if (width != dec->width || height != dec->height) {                                          if (width != dec->width || height != dec->height) {
372                                                  DPRINTF(DPRINTF_ERROR, "XVID_DEC_PARAM width/height does not match bitstream");                                                  DPRINTF(DPRINTF_ERROR, "XVID_DEC_PARAM width/height does not match bitstream");
373                                                  return -1;                                                  return -1;
# Line 437  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 538  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 - dec->last_non_b_time);  */                              dec->time_pp = (uint32_t)
554                                            (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                                  dec->time_bp = (uint32_t) (dec->last_non_b_time - dec->time);  */
562                                    dec->time_bp = (uint32_t)
563                                            (time_increment_resolution + dec->last_non_b_time - dec->time)%time_increment_resolution;
564                          }                          }
565    
566                          READ_MARKER();                          READ_MARKER();
# Line 703  Line 716 
716    
717  #ifdef BFRAMES  #ifdef BFRAMES
718          if (pParam->max_bframes > 0) {          if (pParam->max_bframes > 0) {
                 //DPRINTF("low_delay=1");  
719                  BitstreamPutBit(bs, 1); // vol_control_parameters                  BitstreamPutBit(bs, 1); // vol_control_parameters
720                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"                  BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"
721                  BitstreamPutBit(bs, 0); // low_delay                  BitstreamPutBit(bs, 0); // low_delay
# Line 711  Line 723 
723          } else          } else
724  #endif  #endif
725          {          {
726                  BitstreamPutBits(bs, 0, 1);     // vol_control_parameters (0=not given)                  BitstreamPutBit(bs, 1); // vol_control_parameters
727                    BitstreamPutBits(bs, 1, 2);     // chroma_format 1="4:2:0"
728                    BitstreamPutBit(bs, 1); // low_delay
729                    BitstreamPutBit(bs, 0); // vbv_parameters (0=not given)
730          }          }
731    
732    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.27

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