Mercurial > mplayer.hg
comparison libvo/vo_xmga.c @ 5007:18690b95b24c
round up width/height if mod 2 != 0
author | arpi |
---|---|
date | Sat, 09 Mar 2002 21:53:03 +0000 |
parents | 53c569d36b2c |
children | 3dbceaff9f77 |
comparison
equal
deleted
inserted
replaced
5006:2b9b34b7cdf8 | 5007:18690b95b24c |
---|---|
208 perror("open"); | 208 perror("open"); |
209 printf("Couldn't open %s\n",devname); | 209 printf("Couldn't open %s\n",devname); |
210 return(-1); | 210 return(-1); |
211 } | 211 } |
212 | 212 |
213 width+=width&1; | |
214 | |
213 switch(format) | 215 switch(format) |
214 { | 216 { |
215 case IMGFMT_YV12: | 217 case IMGFMT_YV12: |
218 height+=height&1; | |
216 mga_vid_config.format=MGA_VID_FORMAT_YV12; | 219 mga_vid_config.format=MGA_VID_FORMAT_YV12; |
217 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; | 220 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; |
218 break; | 221 break; |
219 case IMGFMT_I420: | 222 case IMGFMT_I420: |
223 height+=height&1; | |
220 mga_vid_config.format=MGA_VID_FORMAT_I420; | 224 mga_vid_config.format=MGA_VID_FORMAT_I420; |
221 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; | 225 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; |
222 break; | 226 break; |
223 case IMGFMT_IYUV: | 227 case IMGFMT_IYUV: |
228 height+=height&1; | |
224 mga_vid_config.format=MGA_VID_FORMAT_IYUV; | 229 mga_vid_config.format=MGA_VID_FORMAT_IYUV; |
225 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; | 230 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2; |
226 break; | 231 break; |
227 case IMGFMT_YUY2: | 232 case IMGFMT_YUY2: |
228 mga_vid_config.format=MGA_VID_FORMAT_YUY2; | 233 mga_vid_config.format=MGA_VID_FORMAT_YUY2; |