]> git.sesse.net Git - nageru/blobdiff - chroma_subsampler.h
Add UYVY support to ChromaSubsampler.
[nageru] / chroma_subsampler.h
index ea2b781e701d05d7fed484f1c8f676ec374cf931..811f901697fc1ae9374962195e924d1a2fceacfa 100644 (file)
@@ -19,13 +19,23 @@ public:
        // width and height are the dimensions (in pixels) of the input texture.
        void subsample_chroma(GLuint cbcr_tex, unsigned width, unsigned height, GLuint dst_tex);
 
+       // Subsamples and interleaves luma and chroma to give 4:2:2 packed Y'CbCr (UYVY).
+       // Chroma positioning is left (H.264 convention).
+       // width and height are the dimensions (in pixels) of the input textures.
+       void create_uyvy(GLuint y_tex, GLuint cbcr_tex, unsigned width, unsigned height, GLuint dst_tex);
+
 private:
        movit::ResourcePool *resource_pool;
 
+       GLuint vbo;  // Holds position and texcoord data.
+
        GLuint cbcr_program_num;  // Owned by <resource_pool>.
        GLuint cbcr_texture_sampler_uniform;
-       GLuint cbcr_vbo;  // Holds position and texcoord data.
        GLuint cbcr_position_attribute_index, cbcr_texcoord_attribute_index;
+
+       GLuint uyvy_program_num;  // Owned by <resource_pool>.
+       GLuint uyvy_y_texture_sampler_uniform, uyvy_cbcr_texture_sampler_uniform;
+       GLuint uyvy_position_attribute_index, uyvy_texcoord_attribute_index;
 };
 
 #endif  // !defined(_CHROMA_SUBSAMPLER_H)