diff options
author | NVIDIA Corporation <> | 2009-11-10 18:52:39 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-11-10 18:52:39 +0000 |
commit | 70e0c871eb2546355063b455b2db4c8247c94a5d (patch) | |
tree | 9cb96ce213fcdb919aaa1859a4b1c2f11730f07e /libavcodec/h263dec.c | |
parent | 00962abaa03a4ac6acb3501ec2ef89ac746b2473 (diff) | |
download | ffmpeg-70e0c871eb2546355063b455b2db4c8247c94a5d.tar.gz |
Add VDPAU hardware accelerated decoding for MPEG-4 ASP which can be used
by video players.
Original patch by NVIDIA corporation.
Originally committed as revision 20502 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 224668dea4..c158436574 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -32,6 +32,7 @@ #include "h263_parser.h" #include "mpeg4video_parser.h" #include "msmpeg4.h" +#include "vdpau_internal.h" //#define DEBUG //#define PRINT_FRAME_TIME @@ -621,6 +622,11 @@ retry: if(MPV_frame_start(s, avctx) < 0) return -1; + if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { + ff_vdpau_mpeg4_decode_picture(s, buf, buf_size); + goto frame_end; + } + if (avctx->hwaccel) { if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0) return -1; @@ -695,6 +701,7 @@ retry: intrax8_decoded: ff_er_frame_end(s); +frame_end: if (avctx->hwaccel) { if (avctx->hwaccel->end_frame(avctx) < 0) return -1; @@ -835,3 +842,19 @@ AVCodec flv_decoder = { .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), .pix_fmts= ff_pixfmt_list_420, }; + +#if CONFIG_MPEG4_VDPAU_DECODER +AVCodec mpeg4_vdpau_decoder = { + "mpeg4_vdpau", + CODEC_TYPE_VIDEO, + CODEC_ID_MPEG4, + sizeof(MpegEncContext), + ff_h263_decode_init, + NULL, + ff_h263_decode_end, + ff_h263_decode_frame, + CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, + .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"), + .pix_fmts= (const enum PixelFormat[]){PIX_FMT_VDPAU_MPEG4, PIX_FMT_NONE}, +}; +#endif |