diff options
author | Gwenole Beauchesne <gbeauchesne@splitted-desktop.com> | 2009-02-27 08:27:50 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2009-02-27 08:27:50 +0000 |
commit | 1468d503a957ad20bf458dc7e07f184399cd672d (patch) | |
tree | d12d1ab6d427b2338228936d668e5096e95ec488 /libavcodec/h263dec.c | |
parent | 6aca2c67858e4cc926ed70165ace763ff7d0a178 (diff) | |
download | ffmpeg-1468d503a957ad20bf458dc7e07f184399cd672d.tar.gz |
Add HW acceleration hooks for MPEG-4 / H.263 decoding.
Patch by Gwenole Beauchesne.
Originally committed as revision 17637 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index bb42d495fa..9a7b84a78b 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -161,8 +161,12 @@ static int decode_slice(MpegEncContext *s){ ff_set_qscale(s, s->qscale); - if (s->avctx->hwaccel) - return 0; + if (s->avctx->hwaccel) { + const uint8_t *start= s->gb.buffer + get_bits_count(&s->gb)/8; + const uint8_t *end = ff_h263_find_resync_marker(start + 1, s->gb.buffer_end); + skip_bits_long(&s->gb, 8*(end - start)); + return s->avctx->hwaccel->decode_slice(s->avctx, start, end - start); + } if(s->partitioned_frame){ const int qscale= s->qscale; @@ -617,6 +621,11 @@ retry: if(MPV_frame_start(s, avctx) < 0) return -1; + if (avctx->hwaccel) { + if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0) + return -1; + } + #ifdef DEBUG av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale); #endif |