From 89d8ae77a82461e82e7a78eb0e97a1b727675edc Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 14:54:38 +0000 Subject: [PATCH] Add big- and little-endian variants of the 15 and 16 bit RGB/BGR formats. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30353 b3059339-0415-0410-9bf9-f77b7e298cf2 --- fmt-conversion.c | 12 ++++++++---- libmpcodecs/img_format.h | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/fmt-conversion.c b/fmt-conversion.c index de2f2c572d..013e3fea55 100644 --- a/fmt-conversion.c +++ b/fmt-conversion.c @@ -28,8 +28,10 @@ static const struct { {IMGFMT_ARGB, PIX_FMT_ARGB}, {IMGFMT_BGRA, PIX_FMT_BGRA}, {IMGFMT_BGR24, PIX_FMT_BGR24}, - {IMGFMT_BGR16, PIX_FMT_RGB565}, - {IMGFMT_BGR15, PIX_FMT_RGB555}, + {IMGFMT_BGR16BE, PIX_FMT_RGB565BE}, + {IMGFMT_BGR16LE, PIX_FMT_RGB565LE}, + {IMGFMT_BGR15BE, PIX_FMT_RGB555BE}, + {IMGFMT_BGR15LE, PIX_FMT_RGB555LE}, {IMGFMT_BGR8, PIX_FMT_RGB8}, {IMGFMT_BGR4, PIX_FMT_RGB4}, {IMGFMT_BGR1, PIX_FMT_MONOBLACK}, @@ -41,8 +43,10 @@ static const struct { {IMGFMT_ABGR, PIX_FMT_ABGR}, {IMGFMT_RGBA, PIX_FMT_RGBA}, {IMGFMT_RGB24, PIX_FMT_RGB24}, - {IMGFMT_RGB16, PIX_FMT_BGR565}, - {IMGFMT_RGB15, PIX_FMT_BGR555}, + {IMGFMT_RGB16BE, PIX_FMT_BGR565BE}, + {IMGFMT_RGB16LE, PIX_FMT_BGR565LE}, + {IMGFMT_RGB15BE, PIX_FMT_BGR555BE}, + {IMGFMT_RGB15LE, PIX_FMT_BGR555LE}, {IMGFMT_RGB8, PIX_FMT_BGR8}, {IMGFMT_RGB4, PIX_FMT_BGR4}, {IMGFMT_BGR8, PIX_FMT_PAL8}, diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 6bab56632d..2aa037e5b7 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -35,12 +35,28 @@ #define IMGFMT_ARGB IMGFMT_BGR32 #define IMGFMT_RGBA (IMGFMT_BGR32|64) #define IMGFMT_RGB48NE IMGFMT_RGB48BE +#define IMGFMT_RGB15BE IMGFMT_RGB15 +#define IMGFMT_RGB15LE (IMGFMT_RGB15|64) +#define IMGFMT_RGB16BE IMGFMT_RGB16 +#define IMGFMT_RGB16LE (IMGFMT_RGB16|64) +#define IMGFMT_BGR15BE IMGFMT_BGR15 +#define IMGFMT_BGR15LE (IMGFMT_BGR15|64) +#define IMGFMT_BGR16BE IMGFMT_BGR16 +#define IMGFMT_BGR16LE (IMGFMT_BGR16|64) #else #define IMGFMT_ABGR (IMGFMT_BGR32|64) #define IMGFMT_BGRA IMGFMT_BGR32 #define IMGFMT_ARGB (IMGFMT_RGB32|64) #define IMGFMT_RGBA IMGFMT_RGB32 #define IMGFMT_RGB48NE IMGFMT_RGB48LE +#define IMGFMT_RGB15BE (IMGFMT_RGB15|64) +#define IMGFMT_RGB15LE IMGFMT_RGB15 +#define IMGFMT_RGB16BE (IMGFMT_RGB16|64) +#define IMGFMT_RGB16LE IMGFMT_RGB16 +#define IMGFMT_BGR15BE (IMGFMT_BGR15|64) +#define IMGFMT_BGR15LE IMGFMT_BGR15 +#define IMGFMT_BGR16BE (IMGFMT_BGR16|64) +#define IMGFMT_BGR16LE IMGFMT_BGR16 #endif /* old names for compatibility */