Mercurial > mplayer.hg
changeset 32374:40bb8aa55f55
Use FFALIGN macro.
author | reimar |
---|---|
date | Sat, 09 Oct 2010 11:41:10 +0000 |
parents | 67c00c59eba6 |
children | cbf877922fee |
files | libvo/mga_template.c |
diffstat | 1 files changed, 14 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/mga_template.c Sat Oct 09 11:33:50 2010 +0000 +++ b/libvo/mga_template.c Sat Oct 09 11:41:10 2010 +0000 @@ -42,7 +42,7 @@ static struct SwsContext *sws_ctx; static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; + uint32_t bespitch = FFALIGN(mga_vid_config.src_width, 32); x0+=mga_vid_config.src_width*(vo_panscan_x>>1)/(vo_dwidth+vo_panscan_x); switch(mga_vid_config.format){ case MGA_VID_FORMAT_YV12: @@ -69,7 +69,7 @@ static void draw_slice_g200(uint8_t *image[], int stride[], int width,int height,int x,int y) { - uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; + uint32_t bespitch = FFALIGN(mga_vid_config.src_width, 32); int dst_stride[4] = { bespitch, bespitch }; uint8_t *dst[4]; @@ -86,7 +86,7 @@ uint8_t *dest2; uint32_t bespitch,bespitch2; - bespitch = (mga_vid_config.src_width + 31) & ~31; + bespitch = FFALIGN(mga_vid_config.src_width, 32); bespitch2 = bespitch/2; dest = vid_data + bespitch * y + x; @@ -147,7 +147,7 @@ } static uint32_t get_image(mp_image_t *mpi){ - uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; + uint32_t bespitch = FFALIGN(mga_vid_config.src_width, 32); uint32_t bespitch2 = bespitch/2; // printf("mga: get_image() called\n"); if(mpi->type==MP_IMGTYPE_STATIC && mga_vid_config.num_frames>1) return VO_FALSE; // it is not static @@ -182,7 +182,7 @@ static uint32_t draw_image(mp_image_t *mpi){ - uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; + uint32_t bespitch = FFALIGN(mga_vid_config.src_width, 32); // if -dr or -slices then do nothing: if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE; @@ -363,21 +363,24 @@ static int mga_init(int width,int height,unsigned int format){ + uint32_t bespitch = FFALIGN(width, 32); switch(format){ case IMGFMT_YV12: - width+=width&1;height+=height&1; - mga_vid_config.frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2; + width = FFALIGN(width, 2); + height = FFALIGN(height, 2); + mga_vid_config.frame_size = bespitch * height + (bespitch * height) / 2; mga_vid_config.format=MGA_VID_FORMAT_I420; break; case IMGFMT_I420: case IMGFMT_IYUV: - width+=width&1;height+=height&1; - mga_vid_config.frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2; + width = FFALIGN(width, 2); + height = FFALIGN(height, 2); + mga_vid_config.frame_size = bespitch * height + (bespitch * height) / 2; mga_vid_config.format=MGA_VID_FORMAT_YV12; break; case IMGFMT_YUY2: - mga_vid_config.frame_size = ((width + 31) & ~31) * height * 2; + mga_vid_config.frame_size = bespitch * height * 2; mga_vid_config.format=MGA_VID_FORMAT_YUY2; break; case IMGFMT_UYVY: - mga_vid_config.frame_size = ((width + 31) & ~31) * height * 2; + mga_vid_config.frame_size = bespitch * height * 2; mga_vid_config.format=MGA_VID_FORMAT_UYVY; break; default: mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_InvalidOutputFormat,format);