diff options
author | Alexander Strange <astrange@ithinksw.com> | 2011-06-02 21:15:58 +0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-02 21:16:20 +0400 |
commit | 6a9c85944427e3c4355bce67d7f677ec69527bff (patch) | |
tree | df4bb83f820a5c0295485ca8b7751c4063d5165f /libavcodec/h263dec.c | |
parent | 53be7b23e9d7074d1aeee77407b008411d034e9e (diff) |
H264/MPEG frame-level multi-threading.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index e2627fa8e4..bc6d613be4 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -35,6 +35,7 @@ #include "mpeg4video_parser.h" #include "msmpeg4.h" #include "vdpau_internal.h" +#include "thread.h" #include "flv.h" #include "mpeg4video.h" @@ -229,6 +230,7 @@ static int decode_slice(MpegEncContext *s){ if(++s->mb_x >= s->mb_width){ s->mb_x=0; ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size); + MPV_report_decode_progress(s); s->mb_y++; } return 0; @@ -249,6 +251,7 @@ static int decode_slice(MpegEncContext *s){ } ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size); + MPV_report_decode_progress(s); s->mb_x= 0; } @@ -609,6 +612,8 @@ retry: if(MPV_frame_start(s, avctx) < 0) return -1; + if (!s->divx_packed) ff_thread_finish_setup(avctx); + if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); goto frame_end; @@ -639,8 +644,11 @@ retry: if(s->slice_height==0 || s->mb_x!=0 || (s->mb_y%s->slice_height)!=0 || get_bits_count(&s->gb) > s->gb.size_in_bits) break; }else{ + int prev_x=s->mb_x, prev_y=s->mb_y; if(ff_h263_resync(s)<0) break; + if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x) + s->error_occurred = 1; } if(s->msmpeg4_version<4 && s->h263_pred) |