Mercurial > libavcodec.hg
comparison mjpeg.c @ 1799:95612d423fde libavcodec
multithreaded/SMP motion estimation
multithreaded/SMP encoding for MPEG1/MPEG2/MPEG4/H263
all pthread specific code is in pthread.c
to try it, run configure --enable-pthreads and ffmpeg ... -threads <num>
the internal thread API is a simple AVCodecContext.execute() callback which executes a given function pointer with different arguments and returns after finishing all, that way no mutexes or other thread-mess is needed outside pthread.c
author | michael |
---|---|
date | Fri, 13 Feb 2004 17:54:10 +0000 |
parents | 920e6381e1fe |
children | 5ac49e7a1b8f |
comparison
equal
deleted
inserted
replaced
1798:a3da4b429984 | 1799:95612d423fde |
---|---|
529 | 529 |
530 buf[i+ff_count]= v; | 530 buf[i+ff_count]= v; |
531 } | 531 } |
532 } | 532 } |
533 | 533 |
534 void ff_mjpeg_stuffing(PutBitContext * pbc) | |
535 { | |
536 int length; | |
537 length= (-put_bits_count(pbc))&7; | |
538 if(length) put_bits(pbc, length, (1<<length)-1); | |
539 } | |
540 | |
534 void mjpeg_picture_trailer(MpegEncContext *s) | 541 void mjpeg_picture_trailer(MpegEncContext *s) |
535 { | 542 { |
536 int pad= (-put_bits_count(&s->pb))&7; | 543 ff_mjpeg_stuffing(&s->pb); |
537 | |
538 put_bits(&s->pb, pad,0xFF>>(8-pad)); | |
539 flush_put_bits(&s->pb); | 544 flush_put_bits(&s->pb); |
540 | 545 |
541 assert((s->header_bits&7)==0); | 546 assert((s->header_bits&7)==0); |
542 | 547 |
543 escape_FF(s, s->header_bits>>3); | 548 escape_FF(s, s->header_bits>>3); |