[vlc-commits] Added vlc_chroma_description_t::pixel_bits.
Laurent Aimar
git at videolan.org
Fri Jun 24 23:22:29 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Jun 24 22:46:35 2011 +0200| [0021f7a18a3809ccfcbd9aef4b9fab8a62e137e2] | committer: Laurent Aimar
Added vlc_chroma_description_t::pixel_bits.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0021f7a18a3809ccfcbd9aef4b9fab8a62e137e2
---
include/vlc_fourcc.h | 3 ++-
src/misc/fourcc.c | 46 ++++++++++++++++++++++++++--------------------
2 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index f201d2d..d247a6b 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -448,7 +448,8 @@ typedef struct {
unsigned den;
} h;
} p[4];
- unsigned pixel_size;
+ unsigned pixel_size; /* Number of bytes per pixel for a plane */
+ unsigned pixel_bits; /* Number of bits actually used bits per pixel for a plane */
} vlc_chroma_description_t;
/**
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 5c95381..63bfe1d 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -1710,21 +1710,23 @@ bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
return false;
}
-#define PLANAR(n, w_den, h_den, size) \
+#define PLANAR(n, w_den, h_den, size, bits) \
{ .plane_count = n, \
.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, 1}, .h = {1, 1}} }, \
- .pixel_size = size }
+ .pixel_size = size, \
+ .pixel_bits = bits }
-#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 PLANAR_8(n, w_den, h_den) PLANAR(n, w_den, h_den, 1, 8)
+#define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
-#define PACKED_FMT(size) \
+#define PACKED_FMT(size, bits) \
{ .plane_count = 1, \
.p = { {.w = {1,1}, .h = {1,1}} }, \
- .pixel_size = size }
+ .pixel_size = size, \
+ .pixel_bits = bits }
static const struct
{
@@ -1740,29 +1742,33 @@ static const struct
{ { 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_10B, 0 }, PLANAR_16(3, 2, 2, 10) },
{ { VLC_CODEC_I420_9L,
- VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2) },
+ VLC_CODEC_I420_9B, 0 }, PLANAR_16(3, 2, 2, 9) },
{ { VLC_CODEC_I422_10L,
- VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1) },
+ VLC_CODEC_I422_10B, 0 }, PLANAR_16(3, 2, 1, 10) },
{ { VLC_CODEC_I422_9L,
- VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1) },
+ VLC_CODEC_I422_9B, 0 }, PLANAR_16(3, 2, 1, 9) },
{ { VLC_CODEC_I444_10L,
- VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1) },
+ VLC_CODEC_I444_10B, 0 }, PLANAR_16(3, 1, 1, 10) },
{ { VLC_CODEC_I444_9L,
- VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1) },
+ VLC_CODEC_I444_9B, 0 }, PLANAR_16(3, 1, 1, 9) },
- { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2) },
+ { { VLC_CODEC_YUV_PACKED, 0 }, PACKED_FMT(2, 16) },
{ { VLC_CODEC_RGB8, VLC_CODEC_GREY,
- VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1) },
- { { VLC_CODEC_RGB16, VLC_CODEC_RGB15, VLC_CODEC_RGBT,
- VLC_CODEC_RGB12, VLC_CODEC_RGBA16, 0 },PACKED_FMT(2) },
- { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3) },
- { { VLC_CODEC_RGB32, VLC_CODEC_RGBA, 0 }, PACKED_FMT(4) },
+ VLC_CODEC_YUVP, VLC_CODEC_RGBP, 0 }, PACKED_FMT(1, 8) },
- { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4 } },
+ { { VLC_CODEC_RGB15, 0 }, PACKED_FMT(2, 15) },
+ { { VLC_CODEC_RGB12, 0 }, PACKED_FMT(2, 12) },
+ { { VLC_CODEC_RGB16, VLC_CODEC_RGBT,
+ VLC_CODEC_RGBA16, 0 }, PACKED_FMT(2, 16) },
+ { { VLC_CODEC_RGB24, 0 }, PACKED_FMT(3, 24) },
+ { { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
+ { { VLC_CODEC_RGBA, 0 }, PACKED_FMT(4, 32) },
- { {0}, { 0, {}, 0 } }
+ { { VLC_CODEC_Y211, 0 }, { 1, { {{1,4}, {1,1}} }, 4, 32 } },
+
+ { {0}, { 0, {}, 0, 0 } }
};
#undef PACKED_FMT
More information about the vlc-commits
mailing list