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 |
|
|
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); |
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(); |
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); |
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 |
|
|
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; |
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 */ |
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) |