comparison libmpcodecs/vd_hmblck.c @ 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 fbe4b3716aa0
children
comparison
equal deleted inserted replaced
36882:89c3ef454d9e 36883:e299b6fd7eaa
79 */ 79 */
80 static int init(sh_video_t *sh){ 80 static int init(sh_video_t *sh){
81 81
82 if(sh->format != IMGFMT_HM12) return 0; 82 if(sh->format != IMGFMT_HM12) return 0;
83 83
84 if((sh->disp_w&31) != 0 || (sh->disp_h&31) != 0) { 84 if((sh->disp_w&15) != 0) {
85 mp_msg(MSGT_DECVIDEO, MSGL_ERR, 85 mp_msg(MSGT_DECVIDEO, MSGL_ERR,
86 "hmblck: Image size must be multiple of 32.\n"); 86 "hmblck: Image width must be multiple of 16.\n");
87 return 0;
88 }
89 if((sh->disp_h&31) != 0) {
90 mp_msg(MSGT_DECVIDEO, MSGL_ERR,
91 "hmblck: Image height must be multiple of 32.\n");
87 return 0; 92 return 0;
88 } 93 }
89 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format); 94 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
90 } 95 }
91 /************************************************************************* 96 /*************************************************************************