Mercurial > mplayer.hg
changeset 20278:3c8ab2eecc74
Round buffer width and height to 16 pixels.
author | syrjala |
---|---|
date | Tue, 17 Oct 2006 13:19:31 +0000 |
parents | f4a8ffefaffa |
children | 9c2bad38b1ce |
files | libvo/vo_dfbmga.c |
diffstat | 1 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_dfbmga.c Tue Oct 17 11:30:59 2006 +0000 +++ b/libvo/vo_dfbmga.c Tue Oct 17 13:19:31 2006 +0000 @@ -122,6 +122,7 @@ static uint32_t in_width; static uint32_t in_height; +static uint32_t buf_height; static uint32_t screen_width; static uint32_t screen_height; static uint32_t sub_width; @@ -608,8 +609,8 @@ dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; - dsc.width = in_width; - dsc.height = in_height; + dsc.width = (in_width + 15) & ~15; + dsc.height = (in_height + 15) & ~15; dsc.pixelformat = dlc.pixelformat; /* Don't waste video memory since we don't need direct stretchblit */ @@ -632,6 +633,7 @@ frame = bufs[0]; current_buf = 0; current_ip_buf = 0; + buf_height = dsc.height; } frame->GetPixelFormat( frame, &frame_format ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Video surface %dx%d %s\n", @@ -1047,7 +1049,7 @@ memcpy_pic( dst + pitch * y + x, src[0], w, h, pitch, stride[0] ); - dst += pitch * in_height; + dst += pitch * buf_height; y /= 2; h /= 2; @@ -1070,7 +1072,7 @@ memcpy_pic( dst + pitch * y + x, src[2], w, h, pitch, stride[2] ); - dst += pitch * in_height / 2; + dst += pitch * buf_height / 2; if (frame_format == DSPF_I420 ) memcpy_pic( dst + pitch * y + x, src[2], @@ -1253,17 +1255,17 @@ if (mpi->flags & MP_IMGFLAG_SWAPPED) { /* I420 */ - mpi->planes[1] = dst + in_height * pitch; - mpi->planes[2] = mpi->planes[1] + in_height * pitch / 4; + mpi->planes[1] = dst + buf_height * pitch; + mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4; } else { /* YV12 */ - mpi->planes[2] = dst + in_height * pitch; - mpi->planes[1] = mpi->planes[2] + in_height * pitch / 4; + mpi->planes[2] = dst + buf_height * pitch; + mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4; } } else { /* NV12/NV21 */ mpi->stride[1] = pitch; - mpi->planes[1] = dst + in_height * pitch; + mpi->planes[1] = dst + buf_height * pitch; } }