Mercurial > libavcodec.hg
comparison mjpegenc.c @ 10327:bf04c3ecdfe5 libavcodec
Use skip_put_bytes in MJPEG encoder instead of filling all bytes with 0
with put_bits.
author | reimar |
---|---|
date | Wed, 30 Sep 2009 10:48:14 +0000 |
parents | 38cfe222e1a4 |
children | 7127645ee791 |
comparison
equal
deleted
inserted
replaced
10326:b10c3bc8ea3e | 10327:bf04c3ecdfe5 |
---|---|
311 if(buf[i]==0xFF) ff_count++; | 311 if(buf[i]==0xFF) ff_count++; |
312 } | 312 } |
313 | 313 |
314 if(ff_count==0) return; | 314 if(ff_count==0) return; |
315 | 315 |
316 /* skip put bits */ | |
317 for(i=0; i<ff_count-3; i+=4) | |
318 put_bits(&s->pb, 32, 0); | |
319 put_bits(&s->pb, (ff_count-i)*8, 0); | |
320 flush_put_bits(&s->pb); | 316 flush_put_bits(&s->pb); |
317 skip_put_bytes(&s->pb, ff_count); | |
321 | 318 |
322 for(i=size-1; ff_count; i--){ | 319 for(i=size-1; ff_count; i--){ |
323 int v= buf[i]; | 320 int v= buf[i]; |
324 | 321 |
325 if(v==0xFF){ | 322 if(v==0xFF){ |