Skip to content

[Bug]: HQScaler VideoSR (sr1-0 / sr1-1) writes alpha as 0, discarding the input alpha channel #609

Description

@JuliusBairaktaris

Describe the bug

AMFHQScaler with AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 or AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 writes the alpha channel of the output surface as 0, discarding whatever the input carried. The basic algorithms on the same surface preserve it. There is no property in HQScaler.h to control this.

To Reproduce

2x upscale of an RGBA surface whose alpha is a 0..255 horizontal ramp (RGB constant at 200/64/32), read back and measured per channel:

algorithm output alpha output RGB
BILINEAR min 0, max 255, mean 127.1 (ramp preserved) correct
BICUBIC preserved correct
POINT preserved correct
VIDEOSR1_0 min 0, max 0, mean 0 correct
VIDEOSR1_1 min 0, max 0, mean 0 correct

With a fully opaque input (alpha = 255 everywhere) the two VideoSR algorithms likewise return alpha = 0, so the result is a fully transparent image for any consumer that honours alpha.

Expected behavior

Either preserve the input alpha through VideoSR as the basic algorithms do, or expose a property to control it. Writing 0 is the one value that makes the output unusable without a fix-up pass, since consumers reading RGBA see a fully transparent frame.

Setup

  • OS: Windows 11
  • Driver: 32.0.31035.1003
  • GPU: RX 9070 XT (RDNA4)
  • Component: HQScaler (DX11)

Note

This is visible from FFmpeg's sr_amf filter, which currently has to document appending format=rgb24 downstream to get an opaque result.

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