comparison mjpeg.c @ 841:4033915880d9 libavcodec

cleanup
author michaelni
date Wed, 06 Nov 2002 11:59:17 +0000
parents 4c22dcf3ba65
children d326091dae9f
comparison
equal deleted inserted replaced
840:4c22dcf3ba65 841:4033915880d9
468 put_bits(&s->pb, 8, 0); /* Ss (not used) */ 468 put_bits(&s->pb, 8, 0); /* Ss (not used) */
469 put_bits(&s->pb, 8, 63); /* Se (not used) */ 469 put_bits(&s->pb, 8, 63); /* Se (not used) */
470 put_bits(&s->pb, 8, 0); /* Ah/Al (not used) */ 470 put_bits(&s->pb, 8, 0); /* Ah/Al (not used) */
471 } 471 }
472 472
473 static void escape_FF(MpegEncContext *s) 473 static void escape_FF(MpegEncContext *s, int start)
474 { 474 {
475 int size= get_bit_count(&s->pb) - s->header_bits; 475 int size= get_bit_count(&s->pb) - start*8;
476 int i, ff_count; 476 int i, ff_count;
477 uint8_t *buf= s->pb.buf + (s->header_bits>>3); 477 uint8_t *buf= s->pb.buf + start;
478 int align= (-(int)(buf))&3; 478 int align= (-(int)(buf))&3;
479 479
480 assert((size&7) == 0); 480 assert((size&7) == 0);
481 size >>= 3; 481 size >>= 3;
482 482
531 int pad= (-get_bit_count(&s->pb))&7; 531 int pad= (-get_bit_count(&s->pb))&7;
532 532
533 put_bits(&s->pb, pad,0xFF>>(8-pad)); 533 put_bits(&s->pb, pad,0xFF>>(8-pad));
534 flush_put_bits(&s->pb); 534 flush_put_bits(&s->pb);
535 535
536 escape_FF(s); 536 assert((s->header_bits&7)==0);
537
538 escape_FF(s, s->header_bits>>3);
537 539
538 put_marker(&s->pb, EOI); 540 put_marker(&s->pb, EOI);
539 } 541 }
540 542
541 static inline void mjpeg_encode_dc(MpegEncContext *s, int val, 543 static inline void mjpeg_encode_dc(MpegEncContext *s, int val,