Skip to content

[Bug]: AMFIOCaps input formats do not match what Init() accepts (VQEnhancer over-reports, VideoConverter under-reports) #610

Description

@JuliusBairaktaris

Setup: Windows 11, Radeon RX 9070 XT (RDNA4), driver 32.0.31041.1004, AMF runtime from the driver.

The input formats enumerated by GetCaps()/GetInputCaps() do not match the ones Init() accepts. Across the three filter components the enumeration is wrong in both directions.

AMFVQEnhancer advertises seven formats and accepts two. The other five fail with AMF_INVALID_ARG:

GetFormatAt() format Init()
1 AMF_SURFACE_NV12 AMF_OK
3 AMF_SURFACE_BGRA AMF_INVALID_ARG
4 AMF_SURFACE_ARGB AMF_INVALID_ARG
5 AMF_SURFACE_RGBA AMF_INVALID_ARG
10 AMF_SURFACE_P010 AMF_OK
11 AMF_SURFACE_RGBA_F16 AMF_INVALID_ARG
13 AMF_SURFACE_R10G10B10A2 AMF_INVALID_ARG

AMFHQScaler advertises the same seven and accepts all seven.

AMFVideoConverter advertises eleven, accepts all eleven, and additionally accepts AMF_SURFACE_Y210, AMF_SURFACE_AYUV, AMF_SURFACE_Y410, AMF_SURFACE_P012 and AMF_SURFACE_P016, which it does not advertise.

The values are stable across runs, identical before and after Init(), and all flagged native, so this is not #271. AMF_VIDEO_ENHANCER_ENGINE_TYPE is left at its default and GetAccelerationType() returns 1 for all three.

Sequence, with a fresh component for each Init() attempt:

CreateComponent(context, AMFVQEnhancer, &comp);
comp->GetCaps(&caps);
caps->GetInputCaps(&io);                    // enumerates the seven formats above
comp->Init(AMF_SURFACE_RGBA, 640, 360);     // AMF_INVALID_ARG
comp->Init(AMF_SURFACE_NV12, 640, 360);     // AMF_OK

Expected: the enumerated input formats are the ones Init() accepts.

Impact: an application that builds its format list from AMFIOCaps, which is what the interface is for, offers five formats that fail at Init() on the enhancer and needlessly rejects five working formats on the converter. The alternatives are to hardcode a list per component or to probe with one component instance per candidate format.

Init() succeeding is not proof a format is usable either: AMFHQScaler returns AMF_OK for Init(AMF_SURFACE_NV12) with AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 and then emits an unwritten surface, which is #427.

Happy to test a fix or provide traces (RDNA4 / Windows 11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions