Loading...
Searching...
No Matches

Decodes 10-bit 4:2:2 YCbCr packed in v210 (SMPTE ST 2110-20 / SDI native). More...

Inheritance diagram for score::gfx::V210Decoder:
score::gfx::GPUVideoDecoder

Detailed Description

Decodes 10-bit 4:2:2 YCbCr packed in v210 (SMPTE ST 2110-20 / SDI native).

v210 packs 6 source pixels into 4 little-endian 32-bit words (16 bytes): word 0: Cb01 (10b) | Y0 (10b) | Cr01 (10b) | 2b pad word 1: Y1 (10b) | Cb23 (10b) | Y2 (10b) | 2b pad word 2: Cr23 (10b) | Y3 (10b) | Cb45 (10b) | 2b pad word 3: Y4 (10b) | Cr45 (10b) | Y5 (10b) | 2b pad

Inverse of V210Encoder. The input texture is RGBA8 at ((width/6)*4) × height — each RGBA8 texel is one v210 ULWord, byte-for-byte. For the AJA capture path, that's exactly what DVP DMAs from sysmem to GPU.

Width must be a multiple of 6 (and is in practice always a multiple of 48 for SDI: 1920, 3840, 7680). Non-aligned widths would need row padding, which we don't bother with — SDI doesn't produce them.

Output: full-width RGB. The fragment shader extracts the 10-bit Y/Cb/Cr fields, normalizes to [0, 1] (10-bit limited range maps to roughly the same [16/255, 235/255] window as 8-bit limited), then runs the standard score colorMatrix() convert_to_rgb. SDR/BT.709 by default; HDR (BT.2020 PQ/HLG) routes through bt2020shader() the same way as any other 10-bit YUV input.

Public Member Functions

 V210Decoder (Video::ImageFormat &d)
 
std::pair< QShader, QShader > init (RenderList &r) override
 Initialize a GPUVideoDecoder.
 
void exec (RenderList &, QRhiResourceUpdateBatch &res, AVFrame &frame) override
 Decode and upload a video frame to the GPU.
 
- Public Member Functions inherited from score::gfx::GPUVideoDecoder
void release (RenderList &)
 This method will release all the created samplers and textures.
 

Public Attributes

Video::ImageFormatdecoder
 
- Public Attributes inherited from score::gfx::GPUVideoDecoder
std::vector< Samplersamplers
 
bool hasFrame {}
 
bool failed {}
 

Static Public Attributes

static const constexpr auto frag
 

Additional Inherited Members

- Static Public Member Functions inherited from score::gfx::GPUVideoDecoder
static QRhiTextureSubresourceUploadDescription createTextureUpload (uint8_t *pixels, int w, int h, int bytesPerPixel, int stride)
 Utility method to create a QRhiTextureSubresourceUploadDescription.
 
static QString vertexShader (bool invertY=false) noexcept
 

Member Function Documentation

◆ exec()

void score::gfx::V210Decoder::exec ( RenderList ,
QRhiResourceUpdateBatch &  res,
AVFrame &  frame 
)
inlineoverridevirtual

Decode and upload a video frame to the GPU.

Implements score::gfx::GPUVideoDecoder.

◆ init()

std::pair< QShader, QShader > score::gfx::V210Decoder::init ( RenderList r)
inlineoverridevirtual

Initialize a GPUVideoDecoder.

This method must :

  • Create samplers and textures for the video format.
  • Create shaders that will render the data put into these textures.

It returns a {vertex, fragment} shader pair.

Implements score::gfx::GPUVideoDecoder.


The documentation for this struct was generated from the following file: