summaryrefslogtreecommitdiff
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-13 17:54:10 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-13 17:54:10 +0000
commit9c3d33d67f2260d5ddc888e8ea380c3913e38a72 (patch)
tree46c82202d3f7c2964f7cace9e1131e97ada124bb /libavcodec/mjpeg.c
parent7984082a08cf2119da3433c245b72a91020b879d (diff)
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 Originally committed as revision 2772 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 7aed3e28ac..30029d40c0 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -531,11 +531,16 @@ static void escape_FF(MpegEncContext *s, int start)
}
}
+void ff_mjpeg_stuffing(PutBitContext * pbc)
+{
+ int length;
+ length= (-put_bits_count(pbc))&7;
+ if(length) put_bits(pbc, length, (1<<length)-1);
+}
+
void mjpeg_picture_trailer(MpegEncContext *s)
{
- int pad= (-put_bits_count(&s->pb))&7;
-
- put_bits(&s->pb, pad,0xFF>>(8-pad));
+ ff_mjpeg_stuffing(&s->pb);
flush_put_bits(&s->pb);
assert((s->header_bits&7)==0);