20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: bitstream.c,v 1.39.2.15 2003-07-28 12:29:07 edgomez Exp $ |
* $Id: bitstream.c,v 1.39.2.17 2003-09-10 19:28:40 chl Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
1131 |
BitstreamPutBit(bs, 0); /* random_accessible_vol */ |
BitstreamPutBit(bs, 0); /* random_accessible_vol */ |
1132 |
BitstreamPutBits(bs, vol_type_ind, 8); /* video_object_type_indication */ |
BitstreamPutBits(bs, vol_type_ind, 8); /* video_object_type_indication */ |
1133 |
|
|
1134 |
if (vol_ver_id == 1) |
if (vol_ver_id == 1) { |
|
{ |
|
1135 |
BitstreamPutBit(bs, 0); /* is_object_layer_identified (0=not given) */ |
BitstreamPutBit(bs, 0); /* is_object_layer_identified (0=not given) */ |
1136 |
} |
} else { |
|
else |
|
|
{ |
|
1137 |
BitstreamPutBit(bs, 1); /* is_object_layer_identified */ |
BitstreamPutBit(bs, 1); /* is_object_layer_identified */ |
1138 |
BitstreamPutBits(bs, vol_ver_id, 4); /* vol_ver_id == 2 */ |
BitstreamPutBits(bs, vol_ver_id, 4); /* vol_ver_id == 2 */ |
1139 |
BitstreamPutBits(bs, 4, 3); /* vol_ver_priority (1==highest, 7==lowest) */ |
BitstreamPutBits(bs, 4, 3); /* vol_ver_priority (1==highest, 7==lowest) */ |
1140 |
} |
} |
1141 |
|
|
1142 |
BitstreamPutBits(bs, 1, 4); /* aspect_ratio_info (1=1:1) */ |
/* Aspect ratio */ |
1143 |
|
BitstreamPutBits(bs, pParam->par, 4); /* aspect_ratio_info (1=1:1) */ |
1144 |
|
if(pParam->par == XVID_PAR_EXT) { |
1145 |
|
BitstreamPutBits(bs, pParam->par_width, 8); |
1146 |
|
BitstreamPutBits(bs, pParam->par_height, 8); |
1147 |
|
} |
1148 |
|
|
1149 |
BitstreamPutBit(bs, 1); /* vol_control_parameters */ |
BitstreamPutBit(bs, 1); /* vol_control_parameters */ |
1150 |
BitstreamPutBits(bs, 1, 2); /* chroma_format 1="4:2:0" */ |
BitstreamPutBits(bs, 1, 2); /* chroma_format 1="4:2:0" */ |
1173 |
|
|
1174 |
if (pParam->fincr>0) { |
if (pParam->fincr>0) { |
1175 |
BitstreamPutBit(bs, 1); /* fixed_vop_rate = 1 */ |
BitstreamPutBit(bs, 1); /* fixed_vop_rate = 1 */ |
1176 |
BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase)); /* fixed_vop_time_increment */ |
BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase-1)); /* fixed_vop_time_increment */ |
1177 |
}else{ |
}else{ |
1178 |
BitstreamPutBit(bs, 0); /* fixed_vop_rate = 0 */ |
BitstreamPutBit(bs, 0); /* fixed_vop_rate = 0 */ |
1179 |
} |
} |
1234 |
BitstreamPutBit(bs, 1); /* resync_marker_disable */ |
BitstreamPutBit(bs, 1); /* resync_marker_disable */ |
1235 |
BitstreamPutBit(bs, 0); /* data_partitioned */ |
BitstreamPutBit(bs, 0); /* data_partitioned */ |
1236 |
|
|
1237 |
if (vol_ver_id != 1) |
if (vol_ver_id != 1) { |
|
{ |
|
1238 |
BitstreamPutBit(bs, 0); /* newpred_enable */ |
BitstreamPutBit(bs, 0); /* newpred_enable */ |
|
|
|
1239 |
BitstreamPutBit(bs, (pParam->vol_flags & XVID_VOL_REDUCED_ENABLE)?1:0); |
BitstreamPutBit(bs, (pParam->vol_flags & XVID_VOL_REDUCED_ENABLE)?1:0); |
1240 |
/* reduced_resolution_vop_enabled */ |
/* reduced_resolution_vop_enabled */ |
1241 |
} |
} |
1293 |
|
|
1294 |
/* time_increment: value=nth_of_sec, nbits = log2(resolution) */ |
/* time_increment: value=nth_of_sec, nbits = log2(resolution) */ |
1295 |
|
|
1296 |
BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase)); |
BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase-1)); |
1297 |
#if 0 |
#if 0 |
1298 |
DPRINTF("[%i:%i] %c", |
DPRINTF("[%i:%i] %c", |
1299 |
frame->seconds, frame->ticks, |
frame->seconds, frame->ticks, |