diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-05-09 00:18:26 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-05-09 00:18:26 +0000 |
commit | d6f26851817a465885725aedc9839e0ae16f6445 (patch) | |
tree | 6c0e2fd6154734f62c00a83ab5de7fa5fde1193c /libmpcodecs | |
parent | 6f28f44c8c48ec0de064fecfb3bf1c47950f1e3a (diff) |
Handle Y8/Y800 formats more similar to other YUV formats.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31144 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/img_format.c | 7 | ||||
-rw-r--r-- | libmpcodecs/mp_image.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libmpcodecs/img_format.c b/libmpcodecs/img_format.c index f0cb3db97e..bdf4d2f6f8 100644 --- a/libmpcodecs/img_format.c +++ b/libmpcodecs/img_format.c @@ -151,13 +151,18 @@ int mp_get_chroma_shift(int format, int *x_shift, int *y_shift) xs = 0; ys = 1; break; + case IMGFMT_Y8: + case IMGFMT_Y800: + xs = 31; + ys = 31; + break; default: err = 1; break; } if (x_shift) *x_shift = xs; if (y_shift) *y_shift = ys; - bpp = 8 + (16 >> (xs + ys)); + bpp = 8 + ((16 >> xs) >> ys); if (format == IMGFMT_420A) bpp += 8; bpp *= bpp_factor; diff --git a/libmpcodecs/mp_image.c b/libmpcodecs/mp_image.c index 898f5fac96..f23918151d 100644 --- a/libmpcodecs/mp_image.c +++ b/libmpcodecs/mp_image.c @@ -153,8 +153,7 @@ void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){ case IMGFMT_Y800: case IMGFMT_Y8: /* they're planar ones, but for easier handling use them as packed */ -// mpi->flags|=MP_IMGFLAG_PLANAR; - mpi->bpp=8; + mpi->flags&=~MP_IMGFLAG_PLANAR; mpi->num_planes=1; return; case IMGFMT_UYVY: |