Skip to content

Support accelerated conversion to canvas-compatible RGBA #14

@rezonant

Description

@rezonant

It would be useful to be able to consume frames from Macadam's Decklink Capture direct into HTML5 canvas. Canvas only supports RGBA frames, but Decklink can provide BGRA, ARGB, YUV chroma-subsample and 10-bit HDR forms of those.

I propose an additional option outputRGBA that will convert Decklink frames of any color space into RGBA when using the Capture functionality. For RGB-based formats we can do basic byte swap for a rough initial implementation, and for YUV we can use Decklink's built-in IDeckLinkVideoConversion to convert from the source YUV to BGRA, then perform the byte-swap. I don't have a plan on how to maintain the HDR in these conversions- suggestions welcome.

Ideally (eventually) the byte swap could be accelerated with SIMD I think.

Work in progress is at https://github.com/rezonant/macadam/commits/feat/color-conversion

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