aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-23 20:56:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-23 20:56:56 +0000
commitc62c07d3d7d204527bfa991bac1204cbb593747b (patch)
tree207c61727f1c992fe1a05eef9c96a7cc34f6d143 /libavcodec/mpegvideo.c
parentc0a2c42f59329811fc08a2c982d394ab49204b01 (diff)
downloadffmpeg-c62c07d3d7d204527bfa991bac1204cbb593747b.tar.gz
multithreaded mpeg2 decoding
Originally committed as revision 2810 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e92022b0cc..3b36f97244 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -468,13 +468,17 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){
#undef COPY
}
-static void update_duplicate_context(MpegEncContext *dst, MpegEncContext *src){
+void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src){
MpegEncContext bak;
+ int i;
//FIXME copy only needed parts
//START_TIMER
backup_duplicate_context(&bak, dst);
memcpy(dst, src, sizeof(MpegEncContext));
backup_duplicate_context(dst, &bak);
+ for(i=0;i<12;i++){
+ dst->pblocks[i] = (short *)(&dst->block[i]);
+ }
//STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads
}
@@ -4632,7 +4636,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s->mb_intra=0; //for the rate distoration & bit compare functions
for(i=1; i<s->avctx->thread_count; i++){
- update_duplicate_context(s->thread_context[i], s);
+ ff_update_duplicate_context(s->thread_context[i], s);
}
/* Estimate motion for every MB */