diff options
author | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2011-10-23 20:40:31 +0000 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-03-25 23:03:15 +0200 |
commit | b223805547e7272cfa376ddf69e82806af48a602 (patch) | |
tree | 7eff7e78730bcf0ddcd157cb4afa187bd8bde1c7 /libmpcodecs | |
parent | 7d0c4c3c312a14bc5674a9f38826d79ca8f3466f (diff) | |
download | mpv-b223805547e7272cfa376ddf69e82806af48a602.tar.bz2 mpv-b223805547e7272cfa376ddf69e82806af48a602.tar.xz |
libmpcodecs: support planar GBR24 decoding
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2
Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this
commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This
was updated in revision 34492 in mplayer, but the mplayer specific
names (such as IMGFMT_GBR24) were left unchanged.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/img_format.c | 1 | ||||
-rw-r--r-- | libmpcodecs/img_format.h | 2 | ||||
-rw-r--r-- | libmpcodecs/mp_image.c | 7 | ||||
-rw-r--r-- | libmpcodecs/vf_scale.c | 1 |
4 files changed, 10 insertions, 1 deletions
diff --git a/libmpcodecs/img_format.c b/libmpcodecs/img_format.c index c4884f3eca..0938cce19f 100644 --- a/libmpcodecs/img_format.c +++ b/libmpcodecs/img_format.c @@ -50,6 +50,7 @@ const char *vo_format_name(int format) case IMGFMT_BGRA: return "BGRA"; case IMGFMT_ARGB: return "ARGB"; case IMGFMT_RGBA: return "RGBA"; + case IMGFMT_GBR24P: return "Planar GBR 24-bit"; case IMGFMT_YVU9: return "Planar YVU9"; case IMGFMT_IF09: return "Planar IF09"; case IMGFMT_YV12: return "Planar YV12"; diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 3056e29268..825bda35b3 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -49,6 +49,8 @@ #define IMGFMT_BGR24 (IMGFMT_BGR|24) #define IMGFMT_BGR32 (IMGFMT_BGR|32) +#define IMGFMT_GBR24P (('G'<<24)|('B'<<16)|('R'<<8)|24) + #if HAVE_BIGENDIAN #define IMGFMT_ABGR IMGFMT_RGB32 #define IMGFMT_BGRA (IMGFMT_RGB32|64) diff --git a/libmpcodecs/mp_image.c b/libmpcodecs/mp_image.c index 4683f41174..9c4e6d6bd7 100644 --- a/libmpcodecs/mp_image.c +++ b/libmpcodecs/mp_image.c @@ -121,8 +121,13 @@ void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){ mpi->flags|=MP_IMGFLAG_SWAPPED; return; } - mpi->flags|=MP_IMGFLAG_YUV; mpi->num_planes=3; + if (out_fmt == IMGFMT_GBR24P) { + mpi->bpp=24; + mpi->flags|=MP_IMGFLAG_PLANAR; + return; + } + mpi->flags|=MP_IMGFLAG_YUV; if (mp_get_chroma_shift(out_fmt, NULL, NULL, NULL)) { mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp = mp_get_chroma_shift(out_fmt, &mpi->chroma_x_shift, &mpi->chroma_y_shift, NULL); diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index b40654cee4..dd349655ac 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -107,6 +107,7 @@ static const unsigned int outfmt_list[]={ IMGFMT_RGB32, IMGFMT_BGR24, IMGFMT_RGB24, + IMGFMT_GBR24P, IMGFMT_RGB48LE, IMGFMT_RGB48BE, IMGFMT_BGR16, |