558 |
DPRINTF(DPRINTF_HEADER, "low_delay %i", dec->low_delay); |
DPRINTF(DPRINTF_HEADER, "low_delay %i", dec->low_delay); |
559 |
if (BitstreamGetBit(bs)) // vbv_parameters |
if (BitstreamGetBit(bs)) // vbv_parameters |
560 |
{ |
{ |
561 |
|
unsigned int bitrate; |
562 |
|
unsigned int buffer_size; |
563 |
|
unsigned int occupancy; |
564 |
|
|
565 |
DPRINTF(DPRINTF_HEADER,"+ vbv_parameters"); |
DPRINTF(DPRINTF_HEADER,"+ vbv_parameters"); |
566 |
BitstreamSkip(bs, 15); // first_half_bitrate |
|
567 |
|
bitrate = BitstreamGetBits(bs,15) << 15; // first_half_bit_rate |
568 |
READ_MARKER(); |
READ_MARKER(); |
569 |
BitstreamSkip(bs, 15); // latter_half_bitrate |
bitrate |= BitstreamGetBits(bs,15); // latter_half_bit_rate |
570 |
READ_MARKER(); |
READ_MARKER(); |
571 |
BitstreamSkip(bs, 15); // first_half_vbv_buffer_size |
|
572 |
|
buffer_size = BitstreamGetBits(bs, 15) << 3; // first_half_vbv_buffer_size |
573 |
READ_MARKER(); |
READ_MARKER(); |
574 |
BitstreamSkip(bs, 3); // latter_half_vbv_buffer_size |
buffer_size |= BitstreamGetBits(bs, 3); // latter_half_vbv_buffer_size |
575 |
BitstreamSkip(bs, 11); // first_half_vbv_occupancy |
|
576 |
|
occupancy = BitstreamGetBits(bs, 11) << 15; // first_half_vbv_occupancy |
577 |
READ_MARKER(); |
READ_MARKER(); |
578 |
BitstreamSkip(bs, 15); // latter_half_vbv_occupancy |
occupancy |= BitstreamGetBits(bs, 15); // latter_half_vbv_occupancy |
579 |
READ_MARKER(); |
READ_MARKER(); |
580 |
|
|
581 |
|
DPRINTF(DPRINTF_HEADER,"bitrate %d (unit=400 bps)", bitrate); |
582 |
|
DPRINTF(DPRINTF_HEADER,"buffer_size %d (unit=16384 bits)", buffer_size); |
583 |
|
DPRINTF(DPRINTF_HEADER,"occupancy %d (unit=64 bits)", occupancy); |
584 |
} |
} |
585 |
}else{ |
}else{ |
586 |
dec->low_delay = dec->low_delay_default; |
dec->low_delay = dec->low_delay_default; |
1142 |
profile = 0xf3; /* advanced simple profile/level 2 */ |
profile = 0xf3; /* advanced simple profile/level 2 */ |
1143 |
|
|
1144 |
// visual_object_sequence_start_code |
// visual_object_sequence_start_code |
1145 |
BitstreamPad(bs); |
// BitstreamPad(bs); |
1146 |
|
/* no padding here, anymore. You have to make sure that you are |
1147 |
|
byte aligned, and that always 1-8 padding bits have been written */ |
1148 |
|
|
1149 |
BitstreamPutBits(bs, VISOBJSEQ_START_CODE, 32); |
BitstreamPutBits(bs, VISOBJSEQ_START_CODE, 32); |
1150 |
BitstreamPutBits(bs, profile, 8); |
BitstreamPutBits(bs, profile, 8); |
1151 |
|
|
1160 |
BitstreamPutBits(bs, VIDOBJ_START_CODE|(vo_id&0x5), 32); |
BitstreamPutBits(bs, VIDOBJ_START_CODE|(vo_id&0x5), 32); |
1161 |
|
|
1162 |
// video_object_layer_start_code & vol_id |
// video_object_layer_start_code & vol_id |
1163 |
|
BitstreamPad(bs); |
1164 |
BitstreamPutBits(bs, VIDOBJLAY_START_CODE|(vol_id&0x4), 32); |
BitstreamPutBits(bs, VIDOBJLAY_START_CODE|(vol_id&0x4), 32); |
1165 |
|
|
1166 |
BitstreamPutBit(bs, 0); // random_accessible_vol |
BitstreamPutBit(bs, 0); // random_accessible_vol |
1294 |
{ |
{ |
1295 |
uint32_t i; |
uint32_t i; |
1296 |
|
|
1297 |
BitstreamPad(bs); |
// BitstreamPad(bs); |
1298 |
|
/* no padding here, anymore. You have to make sure that you are |
1299 |
|
byte aligned, and that always 1-8 padding bits have been written */ |
1300 |
|
|
1301 |
BitstreamPutBits(bs, VOP_START_CODE, 32); |
BitstreamPutBits(bs, VOP_START_CODE, 32); |
1302 |
|
|
1303 |
BitstreamPutBits(bs, frame->coding_type, 2); |
BitstreamPutBits(bs, frame->coding_type, 2); |