-typedef struct
-{
- unsigned i_plane_count;
- struct
- {
- struct
- {
- unsigned i_num;
- unsigned i_den;
- } w;
- struct
- {
- unsigned i_num;
- unsigned i_den;
- } h;
- } p[VOUT_MAX_PLANES];
- unsigned i_pixel_size;
-
-} chroma_description_t;
-
-#define PLANAR(n, w_den, h_den) \
- { n, { {{1,1}, {1,1}}, {{1,w_den}, {1,h_den}}, {{1,w_den}, {1,h_den}}, {{1,1}, {1,1}} }, 1 }
-#define PACKED(size) \
- { 1, { {{1,1}, {1,1}} }, size }
-
-static const struct
-{
- vlc_fourcc_t p_fourcc[5];
- chroma_description_t description;
-} p_chromas[] = {
- { { VLC_CODEC_I411, 0 }, PLANAR(3, 4, 1) },
- { { VLC_CODEC_I410, VLC_CODEC_YV9, 0 }, PLANAR(3, 4, 4) },
- { { VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, 0 }, PLANAR(3, 2, 2) },
- { { VLC_CODEC_I422, VLC_CODEC_J422, 0 }, PLANAR(3, 2, 1) },
- { { VLC_CODEC_I440, VLC_CODEC_J440, 0 }, PLANAR(3, 1, 2) },
- { { VLC_CODEC_I444, VLC_CODEC_J444, 0 }, PLANAR(3, 1, 1) },
- { { VLC_CODEC_YUVA, 0 }, PLANAR(4, 1, 1) },
-
- { { VLC_CODEC_UYVY, VLC_CODEC_VYUY, VLC_CODEC_YUYV, VLC_CODEC_YVYU, 0 }, PACKED(2) },
- { { VLC_CODEC_RGB8, VLC_CODEC_GREY, VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED(1) },
- { { VLC_CODEC_RGB16, VLC_CODEC_RGB15, 0 }, PACKED(2) },
- { { VLC_CODEC_RGB24, 0 }, PACKED(3) },
- { { VLC_CODEC_RGB32, VLC_CODEC_RGBA, 0 }, PACKED(4) },
-
- { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4 } },
-
- { {0}, { 0, {}, 0 } }
-};
-
-#undef PACKED
-#undef PLANAR
-
-static const chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
-{
- for( unsigned i = 0; p_chromas[i].p_fourcc[0]; i++ )
- {
- const vlc_fourcc_t *p_fourcc = p_chromas[i].p_fourcc;
- for( unsigned j = 0; p_fourcc[j]; j++ )
- {
- if( p_fourcc[j] == i_fourcc )
- return &p_chromas[i].description;
- }
- }
- return NULL;
-}
-