Decodes XYZ12LE, the DCDM X'Y'Z' of JPEG 2000 DCPs. More...
Detailed Description
Decodes XYZ12LE, the DCDM X'Y'Z' of JPEG 2000 DCPs.
Packed 4:4:4, three little-endian 16-bit words per pixel, each holding a 12-bit code value in its top bits. The layout is RGB48's, so the words go into an R16 texture three texels wide per pixel and are reassembled with texelFetch.
The colour pipeline is fixed by SMPTE 428-1 rather than read from the stream: the code values are X'Y'Z' = (XYZ / 52.37)^(1/2.6), with XYZ in cd/m^2 and the reference white at Y = 48 cd/m^2. Decoding is therefore gamma 2.6 -> scale to 1.0 = 48 cd/m^2 -> XYZ to RGB (D65 primaries). No chromatic adaptation is applied: the DCDM is absolute colorimetry, so a DCI-white master keeps its slightly green-tinted white, as it does in libdcp and ffmpeg.
Public Member Functions | |
| XYZ12Decoder (Video::ImageFormat &d, QString f="") | |
| 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. | |
Static Public Member Functions | |
| static QString | colorShader (const Video::ImageFormat &d) |
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 bool | isTopField (const AVFrame &frame) noexcept |
| Whether this frame carries the EVEN lines of its picture. | |
| static PlaneRows | planeRows (const Video::ImageFormat &fmt, const AVFrame &frame, int textureRows) noexcept |
| static QString | vertexShader (bool invertY=false) noexcept |
Public Attributes | |
| Video::ImageFormat & | decoder |
| QString | filter |
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 |
| static constexpr auto | dcdm_eotf |
| static constexpr auto | xyz_to_bt709 |
| static constexpr auto | xyz_to_bt2020 |
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
◆ dcdm_eotf
|
staticconstexpr |
◆ frag
|
staticconstexpr |
◆ xyz_to_bt2020
|
staticconstexpr |
◆ xyz_to_bt709
|
staticconstexpr |
The documentation for this struct was generated from the following file:
Public Member Functions inherited from