comparison rv10.c @ 646:f87dc45d921d libavcodec

fixing rv10 encoding (ffmpeg can at least decode its own rv10 files now)
author michaelni
date Thu, 05 Sep 2002 13:23:11 +0000
parents 3db611caee55
children e55b91623e09
comparison
equal deleted inserted replaced
645:f53e17dec13f 646:f87dc45d921d
221 } 221 }
222 222
223 /* write RV 1.0 compatible frame header */ 223 /* write RV 1.0 compatible frame header */
224 void rv10_encode_picture_header(MpegEncContext *s, int picture_number) 224 void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
225 { 225 {
226 int full_frame= 1;
227
226 align_put_bits(&s->pb); 228 align_put_bits(&s->pb);
227 229
230 if(full_frame){
231 put_bits(&s->pb, 8, 0xc0); /* packet header */
232 put_bits(&s->pb, 16, 0x4000); /* len */
233 put_bits(&s->pb, 16, 0x4000); /* pos */
234 }
235
236 put_bits(&s->pb, 8, picture_number&0xFF);
237
228 put_bits(&s->pb, 1, 1); /* marker */ 238 put_bits(&s->pb, 1, 1); /* marker */
229 239
230 put_bits(&s->pb, 1, (s->pict_type == P_TYPE)); 240 put_bits(&s->pb, 1, (s->pict_type == P_TYPE));
231 241
232 put_bits(&s->pb, 1, 0); /* not PB frame */ 242 put_bits(&s->pb, 1, 0); /* not PB frame */
236 if (s->pict_type == I_TYPE) { 246 if (s->pict_type == I_TYPE) {
237 /* specific MPEG like DC coding not used */ 247 /* specific MPEG like DC coding not used */
238 } 248 }
239 /* if multiple packets per frame are sent, the position at which 249 /* if multiple packets per frame are sent, the position at which
240 to display the macro blocks is coded here */ 250 to display the macro blocks is coded here */
241 put_bits(&s->pb, 6, 0); /* mb_x */ 251 if(!full_frame){
242 put_bits(&s->pb, 6, 0); /* mb_y */ 252 put_bits(&s->pb, 6, 0); /* mb_x */
243 put_bits(&s->pb, 12, s->mb_width * s->mb_height); 253 put_bits(&s->pb, 6, 0); /* mb_y */
254 put_bits(&s->pb, 12, s->mb_width * s->mb_height);
255 }
244 256
245 put_bits(&s->pb, 3, 0); /* ignored */ 257 put_bits(&s->pb, 3, 0); /* ignored */
246 } 258 }
247 259
248 static int get_num(GetBitContext *gb) 260 static int get_num(GetBitContext *gb)