summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/img_format.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-09 00:18:26 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-09 00:18:26 +0000
commitd6f26851817a465885725aedc9839e0ae16f6445 (patch)
tree6c0e2fd6154734f62c00a83ab5de7fa5fde1193c /libmpcodecs/img_format.c
parent6f28f44c8c48ec0de064fecfb3bf1c47950f1e3a (diff)
downloadmpv-d6f26851817a465885725aedc9839e0ae16f6445.tar.bz2
mpv-d6f26851817a465885725aedc9839e0ae16f6445.tar.xz
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/img_format.c')
-rw-r--r--libmpcodecs/img_format.c7
1 files changed, 6 insertions, 1 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;