Loading...
Searching...
No Matches
score::gfx::P010Decoder Struct Reference
Decodes P010 videos. More...
Inheritance diagram for score::gfx::P010Decoder:
Detailed Description
Decodes P010 videos.
P010 is a semi-planar 10-bit 4:2:0 format, commonly output by hardware decoders (VAAPI, NVDEC, DXVA2) for 10-bit HEVC/AV1 content.
Layout:
- Plane 0: Y (16-bit per sample, 10 bits used, left-shifted), full resolution
- Plane 1: UV interleaved (16-bit per component), half resolution in both dimensions
Public Member Functions | |
| P010Decoder (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. | |
| void | setYPixels (QRhiResourceUpdateBatch &res, uint8_t *pixels, int stride) const noexcept |
| void | setUVPixels (QRhiResourceUpdateBatch &res, uint8_t *pixels, int stride) const noexcept |
Public Member Functions inherited from score::gfx::GPUVideoDecoder | |
| 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 |
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 |
Initial value:
= R"_(#version 450
)_" SCORE_GFX_VIDEO_UNIFORMS R"_(
layout(binding=3) uniform sampler2D y_tex;
layout(binding=4) uniform sampler2D uv_tex;
layout(location = 0) in vec2 v_texcoord;
layout(location = 0) out vec4 fragColor;
%2
vec4 processTexture(vec4 tex) {
vec4 processed = convert_to_rgb(tex);
{ %1 }
return processed;
}
void main()
{
// P010 stores 10-bit data in the high bits of 16-bit words,
// so R16 unorm already returns values normalized to [0, 1].
float y = texture(y_tex, v_texcoord).r;
float u = texture(uv_tex, v_texcoord).r;
float v = texture(uv_tex, v_texcoord).g;
fragColor = processTexture(vec4(y, u, v, 1.));
})_"
The documentation for this struct was generated from the following file:
Public Member Functions inherited from