--- bitstream.c 2003/01/11 14:59:24 1.28.2.16 +++ bitstream.c 2003/01/14 10:30:39 1.28.2.19 @@ -41,8 +41,8 @@ * * * Revision history: * * * - * 05.01.2003 GMC support - gruel * - * 04.10.2002 qpel support - Isibaar * + * 05.01.2003 GMC support - gruel * + * 04.10.2002 qpel support - Isibaar * * 11.07.2002 add VOP width & height return to dec when dec->width * * or dec->height is 0 (for use in examples/ex1.c) * * MinChen * @@ -1131,7 +1131,10 @@ profile = 0xf3; /* advanced simple profile/level 2 */ // visual_object_sequence_start_code - BitstreamPad(bs); +// BitstreamPad(bs); +/* no padding here, anymore. You have to make sure that you are + byte aligned, and that always 1-8 padding bits have been written */ + BitstreamPutBits(bs, VISOBJSEQ_START_CODE, 32); BitstreamPutBits(bs, profile, 8); @@ -1146,6 +1149,7 @@ BitstreamPutBits(bs, VIDOBJ_START_CODE|(vo_id&0x5), 32); // video_object_layer_start_code & vol_id + BitstreamPad(bs); BitstreamPutBits(bs, VIDOBJLAY_START_CODE|(vol_id&0x4), 32); BitstreamPutBit(bs, 0); // random_accessible_vol @@ -1279,7 +1283,10 @@ { uint32_t i; - BitstreamPad(bs); +// BitstreamPad(bs); +/* no padding here, anymore. You have to make sure that you are + byte aligned, and that always 1-8 padding bits have been written */ + BitstreamPutBits(bs, VOP_START_CODE, 32); BitstreamPutBits(bs, frame->coding_type, 2); @@ -1326,17 +1333,11 @@ int k; for (k=0;k<2;k++) { - if (pParam->m_quarterpel) - bs_put_spritetrajectory(bs, frame->warp.duv[k].x/2 ); // du[k] - else bs_put_spritetrajectory(bs, frame->warp.duv[k].x ); // du[k] - WRITE_MARKER(); + WRITE_MARKER(); - if (pParam->m_quarterpel) - bs_put_spritetrajectory(bs, frame->warp.duv[k].y/2 ); // dv[k] - else bs_put_spritetrajectory(bs, frame->warp.duv[k].y ); // dv[k] - WRITE_MARKER(); + WRITE_MARKER(); if (pParam->m_quarterpel) { @@ -1348,9 +1349,6 @@ } } } -/* GMC is halfpel in bitstream, even though GMC_MV was pseudo-qpel (2*halfpel) */ - - // no support for brightness_change! }