119 |
} |
} |
120 |
} |
} |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
// for PVOP addbits == fcode - 1 |
125 |
|
// for BVOP addbits == max(fcode,bcode) - 1 |
126 |
|
// returns mbpos |
127 |
|
int |
128 |
|
read_video_packet_header(Bitstream *bs, int addbits) |
129 |
|
{ |
130 |
|
int nbits; |
131 |
|
int mbnum; |
132 |
|
int quant; |
133 |
|
int hec; |
134 |
|
|
135 |
|
nbits = NUMBITS_VP_RESYNC_MARKER; |
136 |
|
|
137 |
|
BitstreamSkip(bs, BitstreamNumBitsToByteAlign(bs)); |
138 |
|
BitstreamSkip(bs, nbits); |
139 |
|
|
140 |
|
// if (dec->shape != VIDOBJLAY_SHAPE_RECTANGULAR) { |
141 |
|
// hec |
142 |
|
// vop_width |
143 |
|
// marker_bit |
144 |
|
// vop_height |
145 |
|
// marker_bit |
146 |
|
|
147 |
|
//} |
148 |
|
|
149 |
|
mbnum = BitstreamGetBits(bs, 9); |
150 |
|
//printf("mbnum %i [%i,%i]\n", mbnum, mbnum % dec->mb_width, mbnum / dec->mb_width); |
151 |
|
|
152 |
|
// if (dec->shape != VIDOBJLAY_SHAPE_BINARYONLY) |
153 |
|
quant = BitstreamGetBits(bs, 5); |
154 |
|
|
155 |
|
// if (dec->shape != VIDOBJLAY_SHAPE_RECTANGULAR) |
156 |
|
hec = BitstreamGetBit(bs); |
157 |
|
// if (hec) |
158 |
|
// .. decoder hec-header ... |
159 |
|
|
160 |
|
return mbnum; |
161 |
|
} |
162 |
|
|
163 |
|
|
164 |
|
|
165 |
/* |
/* |
166 |
decode headers |
decode headers |
167 |
returns coding_type, or -1 if error |
returns coding_type, or -1 if error |