Skip to content

Commit 3852afa

Browse files
MikhailAMDjstewart-amd
authored andcommitted
Update AMF to 1.4
Version 1.4 includes support for the H.265 encoder (HEVC) and bug fixes.
1 parent cebe03d commit 3852afa

File tree

75 files changed

+1064
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1064
-230
lines changed

amf/doc/AMF_API_Reference.pdf

169 KB
Binary file not shown.
-654 KB
Binary file not shown.

amf/doc/AMF_Video_Decode_API.pdf

-655 KB
Binary file not shown.

amf/doc/AMF_Video_Encode_API.pdf

142 KB
Binary file not shown.
803 KB
Binary file not shown.

amf/doc/Readme.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
// THE SOFTWARE.
2828
//
2929

30+
New features are available in
31+
Driver: Radeon Software Edition Crimson; 16.12.1 Software: 16.50 and later
32+
33+
1.4.0.0 (07.12.2016) version
34+
--------------------------
35+
- Update of AMF SDK for RX 480, 470, 460
36+
- AVC new Preanalysys parameter added
37+
- Full range for color space converter and AVC encoder added
38+
- HEVC encoder component added
39+
40+
3041

3142

3243
Driver: Radeon Software Edition Crimson; 16.7.3 Software: 16.30 and later

amf/public/samples/CPPSamples/CapabilityManager/CapabilityManager.cpp

Lines changed: 113 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "public/common/AMFFactory.h"
3737
#include "public/include/components/VideoDecoderUVD.h"
3838
#include "public/include/components/VideoEncoderVCE.h"
39+
#include "public/include/components/VideoEncoderHEVC.h"
3940
#include "public/include/components/VideoConverter.h"
4041
#include "public/include/core/Context.h"
4142
#include "public/include/core/Debug.h"
@@ -173,7 +174,7 @@ bool QueryDecoderForCodec(const wchar_t *componentID, amf::AMFContext* pContext)
173174
}
174175
}
175176

176-
bool QueryEncoderForCodec(const wchar_t *componentID, amf::AMFContext* pContext)
177+
bool QueryEncoderForCodecAVC(const wchar_t *componentID, amf::AMFContext* pContext)
177178
{
178179
std::wcout << L"\tCodec " << componentID << L"\n";
179180
amf::AMFCapsPtr encoderCaps;
@@ -237,6 +238,62 @@ bool QueryEncoderForCodec(const wchar_t *componentID, amf::AMFContext* pContext)
237238
}
238239
}
239240

241+
bool QueryEncoderForCodecHEVC(const wchar_t *componentID, amf::AMFContext* pContext)
242+
{
243+
std::wcout << L"\tCodec " << componentID << L"\n";
244+
amf::AMFCapsPtr encoderCaps;
245+
bool result = false;
246+
247+
amf::AMFComponentPtr pEncoder;
248+
g_AMFFactory.GetFactory()->CreateComponent(pContext, componentID, &pEncoder);
249+
if(pEncoder == NULL)
250+
{
251+
std::wcout << AccelTypeToString(amf::AMF_ACCEL_NOT_SUPPORTED) << L"\n";
252+
return false;
253+
}
254+
if (pEncoder->GetCaps(&encoderCaps) == AMF_OK)
255+
{
256+
amf::AMF_ACCELERATION_TYPE accelType = encoderCaps->GetAccelerationType();
257+
std::wcout << L"\t\tAcceleration Type:" << AccelTypeToString(accelType) << L"\n";
258+
259+
amf_uint32 maxProfile = 0;
260+
encoderCaps->GetProperty(AMF_VIDEO_ENCODER_HEVC_CAP_MAX_PROFILE, &maxProfile);
261+
std::wcout << L"\t\tmaximum profile:" <<maxProfile << L"\n";
262+
263+
amf_uint32 maxTier = 0;
264+
encoderCaps->GetProperty(AMF_VIDEO_ENCODER_HEVC_CAP_MAX_TIER, &maxTier);
265+
std::wcout << L"\t\tmaximum tier:" <<maxTier << L"\n";
266+
267+
amf_uint32 maxLevel = 0;
268+
encoderCaps->GetProperty(AMF_VIDEO_ENCODER_HEVC_CAP_MAX_LEVEL, &maxLevel);
269+
std::wcout << L"\t\tmaximum level:" <<maxLevel << L"\n";
270+
271+
amf_uint32 maxNumOfStreams = 0;
272+
encoderCaps->GetProperty(AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_STREAMS, &maxNumOfStreams);
273+
std::wcout << L"\t\tMax Number of streams supported:" << maxNumOfStreams << L"\n";
274+
275+
std::wcout << L"\t\tEncoder input:\n";
276+
amf::AMFIOCapsPtr inputCaps;
277+
if (encoderCaps->GetInputCaps(&inputCaps) == AMF_OK)
278+
{
279+
result = QueryIOCaps(inputCaps);
280+
}
281+
282+
std::wcout << L"\t\tEncoder output:\n";
283+
amf::AMFIOCapsPtr outputCaps;
284+
if (encoderCaps->GetOutputCaps(&outputCaps) == AMF_OK)
285+
{
286+
result = QueryIOCaps(outputCaps);
287+
}
288+
return true;
289+
}
290+
else
291+
{
292+
std::wcout << AccelTypeToString(amf::AMF_ACCEL_NOT_SUPPORTED) << L"\n";
293+
return false;
294+
}
295+
}
296+
240297
void QueryDecoderCaps(amf::AMFContext* pContext)
241298
{
242299
std::wcout << L"Querying video decoder capabilities...\n";
@@ -250,7 +307,11 @@ bool QueryEncoderCaps(amf::AMFContext* pContext)
250307
{
251308
std::wcout << L"Querying video encoder capabilities...\n";
252309

253-
return QueryEncoderForCodec(AMFVideoEncoderVCE_AVC, pContext) && QueryEncoderForCodec(AMFVideoEncoderVCE_SVC, pContext);
310+
QueryEncoderForCodecAVC(AMFVideoEncoderVCE_AVC, pContext);
311+
QueryEncoderForCodecAVC(AMFVideoEncoderVCE_SVC, pContext);
312+
QueryEncoderForCodecHEVC(AMFVideoEncoder_HEVC, pContext);
313+
314+
return true;
254315
}
255316

256317
bool QueryConverterCaps(amf::AMFContext* pContext)
@@ -300,56 +361,68 @@ int _tmain(int argc, _TCHAR* argv[])
300361

301362
g_AMFFactory.GetDebug()->AssertsEnable(false);
302363

303-
amf::AMFContextPtr pContext;
304-
if (g_AMFFactory.GetFactory()->CreateContext(&pContext) == AMF_OK)
305-
{
306-
bool deviceInit = false;
307-
int deviceIdx = 0;
308-
#ifdef _WIN32
364+
for(int deviceIdx = 0; ;deviceIdx++)
365+
{
309366

310-
OSVERSIONINFO osvi;
311-
memset(&osvi, 0, sizeof(osvi));
312-
osvi.dwOSVersionInfoSize = sizeof(osvi);
313-
GetVersionEx(&osvi);
314-
315-
if (osvi.dwMajorVersion >= 6)
367+
amf::AMFContextPtr pContext;
368+
if (g_AMFFactory.GetFactory()->CreateContext(&pContext) == AMF_OK)
316369
{
317-
if (osvi.dwMinorVersion >= 2) // Win 8 or Win Server 2012 or newer
370+
bool deviceInit = false;
371+
372+
#ifdef _WIN32
373+
374+
OSVERSIONINFO osvi;
375+
memset(&osvi, 0, sizeof(osvi));
376+
osvi.dwOSVersionInfoSize = sizeof(osvi);
377+
GetVersionEx(&osvi);
378+
379+
if (osvi.dwMajorVersion >= 6)
318380
{
319-
DeviceDX11 deviceDX11;
320-
if (deviceDX11.Init(deviceIdx) == AMF_OK)
381+
if (osvi.dwMinorVersion >= 2) // Win 8 or Win Server 2012 or newer
321382
{
322-
deviceInit = (pContext->InitDX11(deviceDX11.GetDevice()) == AMF_OK);
383+
DeviceDX11 deviceDX11;
384+
if (deviceDX11.Init(deviceIdx) == AMF_OK)
385+
{
386+
deviceInit = (pContext->InitDX11(deviceDX11.GetDevice()) == AMF_OK);
387+
}
388+
else
389+
{
390+
break;
391+
}
323392
}
324-
}
325-
else
326-
{
327-
DeviceDX9 deviceDX9;
328-
if (deviceDX9.Init(true, deviceIdx, false, 1, 1) == AMF_OK || deviceDX9.Init(false, deviceIdx, false, 1, 1) == AMF_OK) // For DX9 try DX9Ex first and fall back to DX9 if Ex is not available
393+
else
329394
{
330-
deviceInit = (pContext->InitDX9(deviceDX9.GetDevice()) == AMF_OK);
395+
DeviceDX9 deviceDX9;
396+
if (deviceDX9.Init(true, deviceIdx, false, 1, 1) == AMF_OK || deviceDX9.Init(false, deviceIdx, false, 1, 1) == AMF_OK) // For DX9 try DX9Ex first and fall back to DX9 if Ex is not available
397+
{
398+
deviceInit = (pContext->InitDX9(deviceDX9.GetDevice()) == AMF_OK);
399+
}
400+
else
401+
{
402+
break;
403+
}
331404
}
332405
}
406+
else // Older than Vista - not supported
407+
{
408+
std::wcerr << L"This version of Windows is too old\n";
409+
}
410+
#endif
411+
if (deviceInit == true)
412+
{
413+
QueryDecoderCaps(pContext);
414+
QueryEncoderCaps(pContext);
415+
QueryConverterCaps(pContext);
416+
result = true;
417+
}
333418
}
334-
else // Older than Vista - not supported
335-
{
336-
std::wcerr << L"This version of Windows is too old\n";
337-
}
338-
#endif
339-
if (deviceInit == true)
419+
else
340420
{
341-
QueryDecoderCaps(pContext);
342-
QueryEncoderCaps(pContext);
343-
QueryConverterCaps(pContext);
344-
result = true;
421+
std::wcerr << L"Failed to instatiate Capability Manager.\n";
422+
return -1;
345423
}
424+
pContext.Release();
346425
}
347-
else
348-
{
349-
std::wcerr << L"Failed to instatiate Capability Manager.\n";
350-
return -1;
351-
}
352-
pContext.Release();
353426
g_AMFFactory.Terminate();
354427
return result ? 0 : 1;
355428
}

amf/public/samples/CPPSamples/PlaybackHW/PlaybackHW.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// Technologies that are owed as a result of AMD providing the Software to you.
99
//
1010
// MIT license
11+
//
1112
//
1213
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
1314
//
@@ -207,6 +208,10 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
207208
UpdateMenuItems(::GetMenu(hWnd));
208209
}
209210
}
211+
else
212+
{
213+
LOG_INFO(s_pPipeline->GetParamUsage());
214+
}
210215
//------------------------------------------------------------------------------------------------------------
211216

212217

amf/public/samples/CPPSamples/PlaybackHW/PlaybackHW.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// Technologies that are owed as a result of AMD providing the Software to you.
99
//
1010
// MIT license
11+
//
1112
//
1213
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
1314
//

amf/public/samples/CPPSamples/PlaybackHW/PlaybackHW.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// Technologies that are owed as a result of AMD providing the Software to you.
99
//
1010
// MIT license
11+
//
1112
//
1213
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
1314
//

0 commit comments

Comments
 (0)