Decodes Y210 packed 4:2:2 10-bit videos. More...
Detailed Description
Decodes Y210 packed 4:2:2 10-bit videos.
Packed as Y0 Cb Y1 Cr, each a 16-bit little-endian word with the 10 bits of data in the high end. 8 bytes per macropixel (2 pixels), so 4 * width bytes per row.
QRhi has no four-channel 16-bit UNORM format, so the samples are uploaded into an RG16 texture at {w, h}: 4 bytes per texel is exactly one luma plus one chroma sample, and texel x holds (Y of pixel x, Cb on even columns / Cr on odd columns). The shader takes the luma of its own texel and the two chroma samples of the macropixel it belongs to.
Public Member Functions | |
| Y210Decoder (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 | |
| virtual void | release (RenderList &) |
| This method will release all the created samplers and textures. | |
Public Attributes | |
| Video::ImageFormat & | decoder |
Public Attributes inherited from score::gfx::GPUVideoDecoder | |
| std::vector< Sampler > | samplers |
| bool | hasFrame {} |
| bool | failed {} |
| bool | formatChanged {} |
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()
|
inlineoverridevirtual |
Decode and upload a video frame to the GPU.
Implements score::gfx::GPUVideoDecoder.
◆ init()
|
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.
Member Data Documentation
◆ frag
|
staticconstexpr |
The documentation for this struct was generated from the following file:
Public Member Functions inherited from