1 #ifndef _YCBCR_CONVERTER_H
2 #define _YCBCR_CONVERTER_H 1
6 #include <movit/ycbcr_input.h>
19 struct YCbCrConverter {
22 OUTPUT_TO_RGBA, // One texture (bottom-left origin): RGBA
23 OUTPUT_TO_DUAL_YCBCR // Two textures (top-left origin): Y'CbCr, Y'CbCr
25 YCbCrConverter(OutputMode output_mode, movit::ResourcePool *resource_pool);
27 // Returns the appropriate chain for rendering.
28 movit::EffectChain *prepare_chain_for_conversion(std::shared_ptr<Frame> frame);
31 movit::YCbCrFormat ycbcr_format;
33 // Effectively only converts from 4:2:2 to 4:4:4.
34 // TODO: Have a separate version with ResampleEffect, for scaling?
35 std::unique_ptr<movit::EffectChain> planar_chain, semiplanar_chain;
36 movit::YCbCrInput *ycbcr_planar_input, *ycbcr_semiplanar_input;
40 void setup_input_for_frame(std::shared_ptr<Frame> frame, const movit::YCbCrFormat &ycbcr_format, movit::YCbCrInput *input);
42 #endif // !defined(_YCBCR_CONVERTER_H)