changeset 36883:e299b6fd7eaa

Fix image size restrictions set by r35242. Luma blocks are 16x16, but chroma blocks are (two interweaved) 8x16. Since chroma is at quarter resolution it means that the image width must be multiple of 16, while height must be multiple of 32.
author iive
date Wed, 05 Mar 2014 21:58:04 +0000
parents 89c3ef454d9e
children 98568083fb1d
files libmpcodecs/vd_hmblck.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_hmblck.c	Wed Mar 05 18:48:23 2014 +0000
+++ b/libmpcodecs/vd_hmblck.c	Wed Mar 05 21:58:04 2014 +0000
@@ -81,9 +81,14 @@
 
     if(sh->format != IMGFMT_HM12) return 0;
 
-    if((sh->disp_w&31) != 0 || (sh->disp_h&31) != 0) {
+    if((sh->disp_w&15) != 0) {
         mp_msg(MSGT_DECVIDEO, MSGL_ERR,
-               "hmblck: Image size must be multiple of 32.\n");
+               "hmblck: Image width must be multiple of 16.\n");
+        return 0;
+    }
+    if((sh->disp_h&31) != 0) {
+        mp_msg(MSGT_DECVIDEO, MSGL_ERR,
+               "hmblck: Image height must be multiple of 32.\n");
         return 0;
     }
     return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);