Commit 1468d503 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Benoit Fouet

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
parent 6aca2c67
...@@ -161,8 +161,12 @@ static int decode_slice(MpegEncContext *s){ ...@@ -161,8 +161,12 @@ static int decode_slice(MpegEncContext *s){
ff_set_qscale(s, s->qscale); ff_set_qscale(s, s->qscale);
if (s->avctx->hwaccel) if (s->avctx->hwaccel) {
return 0; 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){ if(s->partitioned_frame){
const int qscale= s->qscale; const int qscale= s->qscale;
...@@ -617,6 +621,11 @@ retry: ...@@ -617,6 +621,11 @@ retry:
if(MPV_frame_start(s, avctx) < 0) if(MPV_frame_start(s, avctx) < 0)
return -1; return -1;
if (avctx->hwaccel) {
if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
return -1;
}
#ifdef DEBUG #ifdef DEBUG
av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale); av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment