aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-02-25 19:16:27 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-02-25 19:16:27 +0000
commit765e94ef9e90336751e3414da96674b3f5415977 (patch)
tree677f0558fe3c35eeaf0efe68f747be052c9701e7 /libavcodec/mpeg12.c
parent22e77e44ddf53408e2e374a33ef04b883748f09b (diff)
downloadffmpeg-765e94ef9e90336751e3414da96674b3f5415977.tar.gz
More AVhwaccel hunks from Gwenole Beauchesne.
Originally committed as revision 17590 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 0ef83b16bd..46d7946aaa 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1216,7 +1216,7 @@ static enum PixelFormat mpeg_get_pixelformat(AVCodecContext *avctx){
return PIX_FMT_VDPAU_MPEG2;
}else{
if(s->chroma_format < 2)
- return PIX_FMT_YUV420P;
+ return avctx->get_format(avctx,ff_pixfmt_list_420);
else if(s->chroma_format == 2)
return PIX_FMT_YUV422P;
else
@@ -1605,7 +1605,7 @@ static void exchange_uv(MpegEncContext *s){
s->pblocks[5] = tmp;
}
-static int mpeg_field_start(MpegEncContext *s){
+static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size){
AVCodecContext *avctx= s->avctx;
Mpeg1Context *s1 = (Mpeg1Context*)s;
@@ -1645,6 +1645,12 @@ static int mpeg_field_start(MpegEncContext *s){
}
}
}
+
+ if (avctx->hwaccel) {
+ if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
+ return -1;
+ }
+
// MPV_frame_start will call this function too,
// but we need to call it on every field
if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
@@ -2074,7 +2080,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
avctx->pix_fmt = mpeg_get_pixelformat(avctx);
avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
- if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ||
+ if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU )
if( avctx->idct_algo == FF_IDCT_AUTO )
avctx->idct_algo = FF_IDCT_SIMPLE;
@@ -2384,7 +2390,7 @@ static int decode_chunks(AVCodecContext *avctx,
if(s2->first_slice){
s2->first_slice=0;
- if(mpeg_field_start(s2) < 0)
+ if(mpeg_field_start(s2, buf, buf_size) < 0)
return -1;
}
if(!s2->current_picture_ptr){