diff libmpcodecs/img_format.c @ 31087:9acad2e25ea1

Handle Y8/Y800 formats more similar to other YUV formats.
author reimar
date Sun, 09 May 2010 00:18:26 +0000
parents 92f88bb315c5
children 7af3e6f901fd
line wrap: on
line diff
--- a/libmpcodecs/img_format.c	Sun May 09 00:16:46 2010 +0000
+++ b/libmpcodecs/img_format.c	Sun May 09 00:18:26 2010 +0000
@@ -151,13 +151,18 @@
         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;