[FFmpeg-devel] Added HW H.264 and HEVC encoding for AMD GPUs based on AMF SDK

Mironov, Mikhail Mikhail.Mironov at amd.com
Tue Nov 7 01:28:38 EET 2017


> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Michael Niedermayer
> Sent: November 6, 2017 5:47 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] Added HW H.264 and HEVC encoding for AMD
> GPUs based on AMF SDK
> 
> On Sat, Nov 04, 2017 at 10:49:44PM -0500, Mikhail Mironov wrote:
> > From fc6a3f63eb9c3734f4101cee2a2f5707e063ab62 Mon Sep 17 00:00:00
> 2001
> > From: mmironov <mikhail.mironov at amd.com>
> > Date: Fri, 27 Oct 2017 13:03:15 -0400
> > Subject: [PATCH] Added: HW accelerated H.264 and HEVC encoding for
> AMD
> > GPUs  based on AMF SDK
> >
> > Signed-off-by: mmironov <mikhail.mironov at amd.com>
> > ---
> >  Changelog                |    3 +-
> >  compat/amd/amfsdkenc.h   | 1753
> ++++++++++++++++++++++++++++++++++++++++++++++
> >  configure                |   25 +
> >  libavcodec/Makefile      |    4 +
> >  libavcodec/allcodecs.c   |    2 +
> >  libavcodec/amfenc.c      |  515 ++++++++++++++
> >  libavcodec/amfenc.h      |  137 ++++
> >  libavcodec/amfenc_h264.c |  366 ++++++++++  libavcodec/amfenc_hevc.c
> > |  294 ++++++++
> >  libavcodec/version.h     |    4 +-
> >  10 files changed, 3100 insertions(+), 3 deletions(-)  create mode
> > 100644 compat/amd/amfsdkenc.h  create mode 100644
> libavcodec/amfenc.c
> > create mode 100644 libavcodec/amfenc.h  create mode 100644
> > libavcodec/amfenc_h264.c  create mode 100644 libavcodec/amfenc_hevc.c
> 
> This seems to fail building in mingw64

This is strange. Just in case: my build setup is described here:
https://github.com/Xaymar/ffmpeg-amf/blob/master/Build.txt

I also attached full amfsdkenc.h header file in case I made a mistake with git integration.


> 
> make
> CC      libavcodec/amfenc.o
> In file included from src/libavcodec/amfenc.c:22:0:
> src/libavutil/hwcontext_d3d11va.h:71:5: error: unknown type name
> ‘ID3D11VideoDevice’
>      ID3D11VideoDevice   *video_device;
>      ^
> src/libavutil/hwcontext_d3d11va.h:79:5: error: unknown type name
> ‘ID3D11VideoContext’
>      ID3D11VideoContext  *video_context;
>      ^

This is declared in d3d11.h and came with mingw64. Mine version has it:
msys64new\mingw64\x86_64-w64-mingw32\include\d3d11.h  - attached.
Is it possible that we use different versions of mingw? Do you have it declared?

> In file included from src/libavcodec/amfenc.h:24:0,
>                  from src/libavcodec/amfenc.c:27:
> src/compat/amd/amfsdkenc.h:191:23: error: no previous prototype for
> ‘AMFConstructRect’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFRect AMFConstructRect(amf_int32 left, amf_int32 top, amf_int32 right,
> amf_int32 bottom)
>                        ^

Compiled for me. Corrupted H file? I don’t have declare inline functions, don’t I?


> src/compat/amd/amfsdkenc.h:203:23: error: no previous prototype for
> ‘AMFConstructSize’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFSize AMFConstructSize(amf_int32 width, amf_int32 height)
>                        ^
> src/compat/amd/amfsdkenc.h:215:24: error: no previous prototype for
> ‘AMFConstructPoint’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFPoint AMFConstructPoint(amf_int32 x, amf_int32 y)
>                         ^
> src/compat/amd/amfsdkenc.h:227:23: error: no previous prototype for
> ‘AMFConstructRate’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFRate AMFConstructRate(amf_uint32 num, amf_uint32 den)
>                        ^
> src/compat/amd/amfsdkenc.h:239:24: error: no previous prototype for
> ‘AMFConstructRatio’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFRatio AMFConstructRatio(amf_uint32 num, amf_uint32 den)
>                         ^
> In file included from src/libavcodec/amfenc.h:24:0,
>                  from src/libavcodec/amfenc.c:27:
> src/compat/amd/amfsdkenc.h:275:24: error: no previous prototype for
> ‘AMFConstructColor’ [-Werror=missing-prototypes]  AMF_INLINE struct
> AMFColor AMFConstructColor(amf_uint8 r, amf_uint8 g, amf_uint8 b,
> amf_uint8 a)
>                         ^
> In file included from src/libavcodec/amfenc.h:24:0,
>                  from src/libavcodec/amfenc.c:27:
> src/compat/amd/amfsdkenc.h:293:45: error: no previous prototype for
> ‘amf_variant_alloc’ [-Werror=missing-prototypes]
>      AMF_INLINE void* AMF_CDECL_CALL amf_variant_alloc(amf_size count)
>                                              ^
> src/compat/amd/amfsdkenc.h:297:44: error: no previous prototype for
> ‘amf_variant_free’ [-Werror=missing-prototypes]
>      AMF_INLINE void AMF_CDECL_CALL amf_variant_free(void* ptr)
>                                             ^
> cc1: some warnings being treated as errors
> make: *** [libavcodec/amfenc.o] Error 1
> 
> 
> [...]
> --
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Those who would give up essential Liberty, to purchase a little temporary
> Safety, deserve neither Liberty nor Safety -- Benjamin Franklin

Thanks,
Mikhail
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: amfsdkenc.h
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171106/153e5dfa/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: d3d11.h
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171106/153e5dfa/attachment-0001.h>


More information about the ffmpeg-devel mailing list