From 6b77a10e43e1a8ed8ead20f344485d400440055c Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Wed, 15 Nov 2017 20:59:29 -0800 Subject: avcodec: Implement mpeg4 nvdec hwaccel This was predictably nightmarish, given how ridiculous mpeg4 is. I had to stare at the cuvid parser output for a long time to work out what each field was supposed to be, and even then, I still don't fully understand some of them. Particularly: vop_coded: If I'm reading the decoder correctly, this flag will always be 1 as the decoder will not pass the hwaccel any frame where it is not 1. divx_flags: There's obviously no documentation on what the possible flags are. I simply observed that this is '0' for a normal bitstream and '5' for packed b-frames. gmc_enabled: I had a number of guesses as to what this mapped to. I picked the condition I did based on when the cuvid parser was setting flag. Also note that as with the vdpau hwaccel, the decoder needs to consume the entire frame and not the slice. --- libavcodec/nvdec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libavcodec/nvdec.c') diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index d5cf1058cb..efcd47a7f7 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -56,6 +56,7 @@ static int map_avcodec_id(enum AVCodecID id) case AV_CODEC_ID_HEVC: return cudaVideoCodec_HEVC; case AV_CODEC_ID_MPEG1VIDEO: return cudaVideoCodec_MPEG1; case AV_CODEC_ID_MPEG2VIDEO: return cudaVideoCodec_MPEG2; + case AV_CODEC_ID_MPEG4: return cudaVideoCodec_MPEG4; case AV_CODEC_ID_VC1: return cudaVideoCodec_VC1; case AV_CODEC_ID_VP9: return cudaVideoCodec_VP9; case AV_CODEC_ID_WMV3: return cudaVideoCodec_VC1; -- cgit v1.2.3