https://github.com/regular/gpyu
OpenGL fragment shader code generator tool for multi-format YUV to RGB color space conversion on the GPU
https://github.com/regular/gpyu
Last synced: 3 months ago
JSON representation
OpenGL fragment shader code generator tool for multi-format YUV to RGB color space conversion on the GPU
- Host: GitHub
- URL: https://github.com/regular/gpyu
- Owner: regular
- Created: 2009-12-05T07:22:53.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-12-05T08:01:28.000Z (over 16 years ago)
- Last Synced: 2025-05-24T11:08:34.113Z (11 months ago)
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
GPYU
----
Command line tool and Python module for GLSL source code generation of fragment shaders that perform color space conversions on the GPU.
GPYU synthesizes a shader program that transforms texture data in a given YUV pixel format to RGB on the fly (while rendering a textured quad). Planar and non-planar YUV formats with various subsampling ratios are supported. Image planes can be sampled from different textures (multitexturing) or from one packed texture that contains all planes.
The input pixel format can be specified in a generic way or as a name string as used in libavcodec/ffmpeg.
import gpyu
source = gpyu.createShaderSource(gpyu.PixelFormat("yuv420p"), width=1920, height=1080, pitch=1200, packing=BANDS)
Supported packing modes are:
* INTERLEAVED: 1 texture, non-planar, U and V channels are interleaved with the Y channel
* TEXTURES: 3 separate textures for Y, U and V channels
* RECTS: 1 texture with Y on top and U and V side-by-side below
* BANDS: 1 texture with Y on top, then U, then V, texture may have horizontal padding on the right.
The BANDS layout exists, because it may make copying pixel data from a decoding buffer more efficient.
This is work in progress.