[svn] / branches / release-1_3-branch / xvidcore / src / bitstream / bitstream.c Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/src/bitstream/bitstream.c

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

revision 2179, Tue Nov 12 14:41:36 2019 UTC revision 2180, Tue Nov 12 14:48:35 2019 UTC
# Line 400  Line 400 
400          uint32_t start_code;          uint32_t start_code;
401          uint32_t time_incr = 0;          uint32_t time_incr = 0;
402          int32_t time_increment = 0;          int32_t time_increment = 0;
         int resize = 0;  
403    
404          while ((BitstreamPos(bs) >> 3) + 4 <= bs->length) {          while ((BitstreamPos(bs) >> 3) + 4 <= bs->length) {
405    
# Line 468  Line 467 
467                          BitstreamSkip(bs, 32);  /* video_object_start_code */                          BitstreamSkip(bs, 32);  /* video_object_start_code */
468    
469                  } else if ((start_code & ~VIDOBJLAY_START_CODE_MASK) == VIDOBJLAY_START_CODE) {                  } else if ((start_code & ~VIDOBJLAY_START_CODE_MASK) == VIDOBJLAY_START_CODE) {
470                            uint32_t width = 0, height = 0;
471    
472                          DPRINTF(XVID_DEBUG_STARTCODE, "<video_object_layer>\n");                          DPRINTF(XVID_DEBUG_STARTCODE, "<video_object_layer>\n");
473                          DPRINTF(XVID_DEBUG_HEADER, "vol id %i\n", start_code & VIDOBJLAY_START_CODE_MASK);                          DPRINTF(XVID_DEBUG_HEADER, "vol id %i\n", start_code & VIDOBJLAY_START_CODE_MASK);
# Line 568  Line 568 
568                          if (dec->shape != VIDOBJLAY_SHAPE_BINARY_ONLY) {                          if (dec->shape != VIDOBJLAY_SHAPE_BINARY_ONLY) {
569    
570                                  if (dec->shape == VIDOBJLAY_SHAPE_RECTANGULAR) {                                  if (dec->shape == VIDOBJLAY_SHAPE_RECTANGULAR) {
                                         uint32_t width, height;  
   
571                                          READ_MARKER();                                          READ_MARKER();
572                                          width = BitstreamGetBits(bs, 13);       /* video_object_layer_width */                                          width = BitstreamGetBits(bs, 13);       /* video_object_layer_width */
573                                          READ_MARKER();                                          READ_MARKER();
# Line 578  Line 576 
576    
577                                          DPRINTF(XVID_DEBUG_HEADER, "width %i\n", width);                                          DPRINTF(XVID_DEBUG_HEADER, "width %i\n", width);
578                                          DPRINTF(XVID_DEBUG_HEADER, "height %i\n", height);                                          DPRINTF(XVID_DEBUG_HEADER, "height %i\n", height);
   
                                         if (dec->width != width || dec->height != height)  
                                         {  
                                                 if (dec->fixed_dimensions)  
                                                 {  
                                                         DPRINTF(XVID_DEBUG_ERROR, "decoder width/height does not match bitstream\n");  
                                                         return -1;  
                                                 }  
                                                 resize = 1;  
                                                 dec->width = width;  
                                                 dec->height = height;  
                                         }  
579                                  }                                  }
580    
581                                  dec->interlacing = BitstreamGetBit(bs);                                  dec->interlacing = BitstreamGetBit(bs);
# Line 766  Line 752 
752    
753                          }                          }
754    
755                          return (resize ? -3 : -2 );     /* VOL */                          if (((width > 0) && (height > 0)) && (dec->width != width || dec->height != height))
756                            {
757                                    if (dec->fixed_dimensions)
758                                    {
759                                            DPRINTF(XVID_DEBUG_ERROR, "decoder width/height does not match bitstream\n");
760                                            return -1;
761                                    }
762                                    dec->width = width;
763                                    dec->height = height;
764                                    return -3;
765                            }
766    
767                            return -2;      /* VOL */
768    
769                  } else if (start_code == GRPOFVOP_START_CODE) {                  } else if (start_code == GRPOFVOP_START_CODE) {
770    
# Line 922  Line 920 
920    
921                                  int i;                                  int i;
922    
923                                  for (i = 0 ; i < dec->sprite_warping_points; i++)                                  for (i = 0 ; i < MIN(4, dec->sprite_warping_points); i++)
924                                  {                                  {
925                                          int length;                                          int length;
926                                          int x = 0, y = 0;                                          int x = 0, y = 0;
# Line 984  Line 982 
982    
983                  } else if (start_code == USERDATA_START_CODE) {                  } else if (start_code == USERDATA_START_CODE) {
984                          char tmp[256];                          char tmp[256];
985                      int i, version, build;                          int i, version = 0, build = 0;
986                          char packed;                          char packed;
987    
988                          BitstreamSkip(bs, 32);  /* user_data_start_code */                          BitstreamSkip(bs, 32);  /* user_data_start_code */
# Line 992  Line 990 
990                          memset(tmp, 0, 256);                          memset(tmp, 0, 256);
991                          tmp[0] = BitstreamShowBits(bs, 8);                          tmp[0] = BitstreamShowBits(bs, 8);
992    
993                          for(i = 1; i < 256; i++){                          for(i = 1; i < 255; i++){
994                                  tmp[i] = (BitstreamShowBits(bs, 16) & 0xFF);                                  tmp[i] = (BitstreamShowBits(bs, 16) & 0xFF);
995    
996                                  if(tmp[i] == 0)                                  if(tmp[i] == 0)

Legend:
Removed from v.2179  
changed lines
  Added in v.2180

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