Commit 80861b6e authored by Laurent Aimar's avatar Laurent Aimar

Added planar I420 9/10-bit VLC_CODEC_* definitions and fallbacks.

parent 11353001
...@@ -126,14 +126,32 @@ ...@@ -126,14 +126,32 @@
#define VLC_CODEC_I410 VLC_FOURCC('I','4','1','0') #define VLC_CODEC_I410 VLC_FOURCC('I','4','1','0')
/* Planar YUV 4:1:1 Y:U:V */ /* Planar YUV 4:1:1 Y:U:V */
#define VLC_CODEC_I411 VLC_FOURCC('I','4','1','1') #define VLC_CODEC_I411 VLC_FOURCC('I','4','1','1')
/* Planar YUV 4:2:0 Y:U:V */ /* Planar YUV 4:2:0 Y:U:V 8-bit */
#define VLC_CODEC_I420 VLC_FOURCC('I','4','2','0') #define VLC_CODEC_I420 VLC_FOURCC('I','4','2','0')
/* Planar YUV 4:2:2 Y:U:V */ /* Planar YUV 4:2:0 Y:U:V 9-bit stored on 16 bits */
#define VLC_CODEC_I420_9L VLC_FOURCC('I','0','9','L')
#define VLC_CODEC_I420_9B VLC_FOURCC('I','0','9','B')
/* Planar YUV 4:2:0 Y:U:V 10-bit stored on 16 bits */
#define VLC_CODEC_I420_10L VLC_FOURCC('I','0','A','L')
#define VLC_CODEC_I420_10B VLC_FOURCC('I','0','A','B')
/* Planar YUV 4:2:2 Y:U:V 8-bit */
#define VLC_CODEC_I422 VLC_FOURCC('I','4','2','2') #define VLC_CODEC_I422 VLC_FOURCC('I','4','2','2')
/* Planar YUV 4:2:2 Y:U:V 9-bit stored on 16 bits */
#define VLC_CODEC_I422_9L VLC_FOURCC('I','2','9','L')
#define VLC_CODEC_I422_9B VLC_FOURCC('I','2','9','B')
/* Planar YUV 4:2:2 Y:U:V 10-bit stored on 16 bits */
#define VLC_CODEC_I422_10L VLC_FOURCC('I','2','A','L')
#define VLC_CODEC_I422_10B VLC_FOURCC('I','2','A','B')
/* Planar YUV 4:4:0 Y:U:V */ /* Planar YUV 4:4:0 Y:U:V */
#define VLC_CODEC_I440 VLC_FOURCC('I','4','4','0') #define VLC_CODEC_I440 VLC_FOURCC('I','4','4','0')
/* Planar YUV 4:4:4 Y:U:V */ /* Planar YUV 4:4:4 Y:U:V 8-bit */
#define VLC_CODEC_I444 VLC_FOURCC('I','4','4','4') #define VLC_CODEC_I444 VLC_FOURCC('I','4','4','4')
/* Planar YUV 4:2:2 Y:U:V 9-bit stored on 16 bits */
#define VLC_CODEC_I444_9L VLC_FOURCC('I','4','9','L')
#define VLC_CODEC_I444_9B VLC_FOURCC('I','4','9','B')
/* Planar YUV 4:2:2 Y:U:V 10-bit stored on 16 bits */
#define VLC_CODEC_I444_10L VLC_FOURCC('I','4','A','L')
#define VLC_CODEC_I444_10B VLC_FOURCC('I','4','A','B')
/* Planar YUV 4:2:0 Y:U:V full scale */ /* Planar YUV 4:2:0 Y:U:V full scale */
#define VLC_CODEC_J420 VLC_FOURCC('J','4','2','0') #define VLC_CODEC_J420 VLC_FOURCC('J','4','2','0')
/* Planar YUV 4:2:2 Y:U:V full scale */ /* Planar YUV 4:2:2 Y:U:V full scale */
...@@ -328,6 +346,7 @@ ...@@ -328,6 +346,7 @@
# define VLC_CODEC_U16I VLC_CODEC_U16L # define VLC_CODEC_U16I VLC_CODEC_U16L
# define VLC_CODEC_S24I VLC_CODEC_S24L # define VLC_CODEC_S24I VLC_CODEC_S24L
# define VLC_CODEC_S32I VLC_CODEC_S32L # define VLC_CODEC_S32I VLC_CODEC_S32L
#else #else
# define VLC_CODEC_S16N VLC_CODEC_S16L # define VLC_CODEC_S16N VLC_CODEC_S16L
# define VLC_CODEC_U16N VLC_CODEC_U16L # define VLC_CODEC_U16N VLC_CODEC_U16L
......
...@@ -724,6 +724,32 @@ static const entry_t p_list_video[] = { ...@@ -724,6 +724,32 @@ static const entry_t p_list_video[] = {
B(VLC_CODEC_NV12, "Planar Y, Packet UV (420)"), B(VLC_CODEC_NV12, "Planar Y, Packet UV (420)"),
A("NV12"), A("NV12"),
B(VLC_CODEC_I420_9L, "Planar 4:2:0 YUV 9-bit LE"),
A("I09L"),
B(VLC_CODEC_I420_9B, "Planar 4:2:0 YUV 9-bit BE"),
A("I09B"),
B(VLC_CODEC_I422_9L, "Planar 4:2:2 YUV 9-bit LE"),
A("I29L"),
B(VLC_CODEC_I422_9B, "Planar 4:2:2 YUV 9-bit BE"),
A("I29B"),
B(VLC_CODEC_I444_9L, "Planar 4:4:4 YUV 9-bit LE"),
A("I49L"),
B(VLC_CODEC_I444_9B, "Planar 4:4:4 YUV 9-bit BE"),
A("I49B"),
B(VLC_CODEC_I420_10L, "Planar 4:2:0 YUV 10-bit LE"),
A("I0AL"),
B(VLC_CODEC_I420_10B, "Planar 4:2:0 YUV 10-bit BE"),
A("I0AB"),
B(VLC_CODEC_I422_10L, "Planar 4:2:2 YUV 10-bit LE"),
A("I2AL"),
B(VLC_CODEC_I422_10B, "Planar 4:2:2 YUV 10-bit BE"),
A("I2AB"),
B(VLC_CODEC_I444_10L, "Planar 4:4:4 YUV 10-bit LE"),
A("I4AL"),
B(VLC_CODEC_I444_10B, "Planar 4:4:4 YUV 10-bit BE"),
A("I4AB"),
/* Videogames Codecs */ /* Videogames Codecs */
/* Interplay MVE */ /* Interplay MVE */
...@@ -1379,15 +1405,24 @@ const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc ) ...@@ -1379,15 +1405,24 @@ const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
#define VLC_CODEC_YUV_PLANAR_420 \ #define VLC_CODEC_YUV_PLANAR_420 \
VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420 VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
#define VLC_CODEC_YUV_PLANAR_420_16 \
VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_I420_9L, VLC_CODEC_I420_9B
#define VLC_CODEC_YUV_PLANAR_422 \ #define VLC_CODEC_YUV_PLANAR_422 \
VLC_CODEC_I422, VLC_CODEC_J422 VLC_CODEC_I422, VLC_CODEC_J422
#define VLC_CODEC_YUV_PLANAR_422_16 \
VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_I422_9L, VLC_CODEC_I422_9B
#define VLC_CODEC_YUV_PLANAR_440 \ #define VLC_CODEC_YUV_PLANAR_440 \
VLC_CODEC_I440, VLC_CODEC_J440 VLC_CODEC_I440, VLC_CODEC_J440
#define VLC_CODEC_YUV_PLANAR_444 \ #define VLC_CODEC_YUV_PLANAR_444 \
VLC_CODEC_I444, VLC_CODEC_J444 VLC_CODEC_I444, VLC_CODEC_J444
#define VLC_CODEC_YUV_PLANAR_444_16 \
VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_I444_9L, VLC_CODEC_I444_9B
#define VLC_CODEC_YUV_PACKED \ #define VLC_CODEC_YUV_PACKED \
VLC_CODEC_YUYV, VLC_CODEC_YVYU, \ VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
VLC_CODEC_UYVY, VLC_CODEC_VYUY VLC_CODEC_UYVY, VLC_CODEC_VYUY
...@@ -1407,6 +1442,22 @@ static const vlc_fourcc_t p_YV12_fallback[] = { ...@@ -1407,6 +1442,22 @@ static const vlc_fourcc_t p_YV12_fallback[] = {
VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0 VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
}; };
#define VLC_CODEC_FALLBACK_420_16 \
VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
static const vlc_fourcc_t p_I420_9L_fallback[] = {
VLC_CODEC_I420_9L, VLC_CODEC_I420_9B, VLC_CODEC_FALLBACK_420_16, 0
};
static const vlc_fourcc_t p_I420_9B_fallback[] = {
VLC_CODEC_I420_9B, VLC_CODEC_I420_9L, VLC_CODEC_FALLBACK_420_16, 0
};
static const vlc_fourcc_t p_I420_10L_fallback[] = {
VLC_CODEC_I420_10L, VLC_CODEC_I420_10B, VLC_CODEC_FALLBACK_420_16, 0
};
static const vlc_fourcc_t p_I420_10B_fallback[] = {
VLC_CODEC_I420_10B, VLC_CODEC_I420_10L, VLC_CODEC_FALLBACK_420_16, 0
};
#define VLC_CODEC_FALLBACK_422 \ #define VLC_CODEC_FALLBACK_422 \
VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \ VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \ VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
...@@ -1419,6 +1470,22 @@ static const vlc_fourcc_t p_J422_fallback[] = { ...@@ -1419,6 +1470,22 @@ static const vlc_fourcc_t p_J422_fallback[] = {
VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0 VLC_CODEC_J422, VLC_CODEC_I422, VLC_CODEC_FALLBACK_422, 0
}; };
#define VLC_CODEC_FALLBACK_422_16 \
VLC_CODEC_I422, VLC_CODEC_J422, VLC_CODEC_FALLBACK_422
static const vlc_fourcc_t p_I422_9L_fallback[] = {
VLC_CODEC_I422_9L, VLC_CODEC_I422_9B, VLC_CODEC_FALLBACK_422_16, 0
};
static const vlc_fourcc_t p_I422_9B_fallback[] = {
VLC_CODEC_I422_9B, VLC_CODEC_I422_9L, VLC_CODEC_FALLBACK_422_16, 0
};
static const vlc_fourcc_t p_I422_10L_fallback[] = {
VLC_CODEC_I422_10L, VLC_CODEC_I422_10B, VLC_CODEC_FALLBACK_422_16, 0
};
static const vlc_fourcc_t p_I422_10B_fallback[] = {
VLC_CODEC_I422_10B, VLC_CODEC_I422_10L, VLC_CODEC_FALLBACK_422_16, 0
};
#define VLC_CODEC_FALLBACK_444 \ #define VLC_CODEC_FALLBACK_444 \
VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \ VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \ VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
...@@ -1431,6 +1498,22 @@ static const vlc_fourcc_t p_J444_fallback[] = { ...@@ -1431,6 +1498,22 @@ static const vlc_fourcc_t p_J444_fallback[] = {
VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0 VLC_CODEC_J444, VLC_CODEC_I444, VLC_CODEC_FALLBACK_444, 0
}; };
#define VLC_CODEC_FALLBACK_444_16 \
VLC_CODEC_I444, VLC_CODEC_J444, VLC_CODEC_FALLBACK_444
static const vlc_fourcc_t p_I444_9L_fallback[] = {
VLC_CODEC_I444_9L, VLC_CODEC_I444_9B, VLC_CODEC_FALLBACK_444_16, 0
};
static const vlc_fourcc_t p_I444_9B_fallback[] = {
VLC_CODEC_I444_9B, VLC_CODEC_I444_9L, VLC_CODEC_FALLBACK_444_16, 0
};
static const vlc_fourcc_t p_I444_10L_fallback[] = {
VLC_CODEC_I444_10L, VLC_CODEC_I444_10B, VLC_CODEC_FALLBACK_444_16, 0
};
static const vlc_fourcc_t p_I444_10B_fallback[] = {
VLC_CODEC_I444_10B, VLC_CODEC_I444_10L, VLC_CODEC_FALLBACK_444_16, 0
};
static const vlc_fourcc_t p_I440_fallback[] = { static const vlc_fourcc_t p_I440_fallback[] = {
VLC_CODEC_I440, VLC_CODEC_I440,
VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_420,
...@@ -1477,16 +1560,30 @@ static const vlc_fourcc_t p_VYUY_fallback[] = { ...@@ -1477,16 +1560,30 @@ static const vlc_fourcc_t p_VYUY_fallback[] = {
static const vlc_fourcc_t *pp_YUV_fallback[] = { static const vlc_fourcc_t *pp_YUV_fallback[] = {
p_YV12_fallback, p_YV12_fallback,
p_I420_fallback, p_I420_fallback,
p_I420_9L_fallback,
p_I420_9B_fallback,
p_I420_10L_fallback,
p_I420_10B_fallback,
p_J420_fallback, p_J420_fallback,
p_I422_fallback, p_I422_fallback,
p_I422_9L_fallback,
p_I422_9B_fallback,
p_I422_10L_fallback,
p_I422_10B_fallback,
p_J422_fallback, p_J422_fallback,
p_I444_fallback, p_I444_fallback,
p_J444_fallback, p_J444_fallback,
p_I444_9L_fallback,
p_I444_9B_fallback,
p_I444_10L_fallback,
p_I444_10B_fallback,
p_I440_fallback, p_I440_fallback,
p_YUYV_fallback, p_YUYV_fallback,
p_YVYU_fallback, p_YVYU_fallback,
p_UYVY_fallback, p_UYVY_fallback,
p_VYUY_fallback, p_VYUY_fallback,
NULL, NULL,
}; };
...@@ -1497,6 +1594,9 @@ static const vlc_fourcc_t p_list_YUV[] = { ...@@ -1497,6 +1594,9 @@ static const vlc_fourcc_t p_list_YUV[] = {
VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_444,
VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PACKED,
VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211, VLC_CODEC_I411, VLC_CODEC_YUV_PLANAR_410, VLC_CODEC_Y211,
VLC_CODEC_YUV_PLANAR_420_16,
VLC_CODEC_YUV_PLANAR_422_16,
VLC_CODEC_YUV_PLANAR_444_16,
0, 0,
}; };
...@@ -1610,13 +1710,16 @@ bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc) ...@@ -1610,13 +1710,16 @@ bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
return false; return false;
} }
#define PLANAR(n, w_den, h_den) \ #define PLANAR(n, w_den, h_den, size) \
{ .plane_count = n, \ { .plane_count = n, \
.p = { {.w = {1, 1}, .h = {1, 1}}, \ .p = { {.w = {1, 1}, .h = {1, 1}}, \
{.w = {1,w_den}, .h = {1,h_den}}, \ {.w = {1,w_den}, .h = {1,h_den}}, \
{.w = {1,w_den}, .h = {1,h_den}}, \ {.w = {1,w_den}, .h = {1,h_den}}, \
{.w = {1, 1}, .h = {1, 1}} }, \ {.w = {1, 1}, .h = {1, 1}} }, \
.pixel_size = 1 } .pixel_size = size }
#define PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1)
#define PLANAR_16(n, w_den, h_den) PLANAR(n, w_den, h_den, 2)
#define PACKED_FMT(size) \ #define PACKED_FMT(size) \
{ .plane_count = 1, \ { .plane_count = 1, \
...@@ -1628,13 +1731,26 @@ static const struct ...@@ -1628,13 +1731,26 @@ static const struct
vlc_fourcc_t p_fourcc[6]; vlc_fourcc_t p_fourcc[6];
vlc_chroma_description_t description; vlc_chroma_description_t description;
} p_list_chroma_description[] = { } p_list_chroma_description[] = {
{ { VLC_CODEC_I411, 0 }, PLANAR(3, 4, 1) }, { { VLC_CODEC_I411, 0 }, PLANAR_8(3, 4, 1) },
{ { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR(3, 4, 4) }, { { VLC_CODEC_YUV_PLANAR_410, 0 }, PLANAR_8(3, 4, 4) },
{ { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR(3, 2, 2) }, { { VLC_CODEC_YUV_PLANAR_420, 0 }, PLANAR_8(3, 2, 2) },
{ { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR(3, 2, 1) }, { { VLC_CODEC_YUV_PLANAR_422, 0 }, PLANAR_8(3, 2, 1) },
{ { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR(3, 1, 2) }, { { VLC_CODEC_YUV_PLANAR_440, 0 }, PLANAR_8(3, 1, 2) },
{ { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR(3, 1, 1) }, { { VLC_CODEC_YUV_PLANAR_444, 0 }, PLANAR_8(3, 1, 1) },
{ { VLC_CODEC_YUVA, 0 }, PLANAR(4, 1, 1) }, { { VLC_CODEC_YUVA, 0 }, PLANAR_8(4, 1, 1) },
{ { VLC_CODEC_I420_10L,
VLC_CODEC_I420_10B, 0 }, PLANAR_16(3, 2, 2) },
{ { VLC_CODEC_I420_9L,
VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2) },
{ { VLC_CODEC_I422_10L,
VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1) },
{ { VLC_CODEC_I422_9L,
VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1) },
{ { VLC_CODEC_I444_10L,
VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1) },
{ { VLC_CODEC_I444_9L,
VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1) },
{ { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2) }, { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2) },
{ { VLC_CODEC_RGB8, VLC_CODEC_GREY, { { VLC_CODEC_RGB8, VLC_CODEC_GREY,
...@@ -1650,6 +1766,8 @@ static const struct ...@@ -1650,6 +1766,8 @@ static const struct
}; };
#undef PACKED_FMT #undef PACKED_FMT
#undef PLANAR_16
#undef PLANAR_8
#undef PLANAR #undef PLANAR
const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc ) const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment