diff options
Diffstat (limited to 'src/video_out')
| -rw-r--r-- | src/video_out/alphablend.c | 35 | ||||
| -rw-r--r-- | src/video_out/yuv2rgb.c | 4 |
2 files changed, 22 insertions, 17 deletions
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c index f640fa38a..cbedf3ec8 100644 --- a/src/video_out/alphablend.c +++ b/src/video_out/alphablend.c @@ -944,7 +944,12 @@ void blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, int x, y; int l; int clip_right; - uint32_t yuy2; + union { + uint32_t value; + uint8_t b[4]; + uint16_t h[2]; + } yuy2; + uint8_t clr = 0; uint8_t *dst_y = dst_img + dst_pitch * y_off + 2 * x_off; @@ -1078,34 +1083,34 @@ void blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, if (o) { l = rle_this_bite>>1; if( !((x_off+x) & 1) ) { - *(((uint8_t *)&yuy2) + 0) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 1) = my_clut[clr].cb; - *(((uint8_t *)&yuy2) + 2) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 3) = my_clut[clr].cr; + yuy2.b[0] = my_clut[clr].y; + yuy2.b[1] = my_clut[clr].cb; + yuy2.b[2] = my_clut[clr].y; + yuy2.b[3] = my_clut[clr].cr; } else { - *(((uint8_t *)&yuy2) + 0) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 1) = my_clut[clr].cr; - *(((uint8_t *)&yuy2) + 2) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 3) = my_clut[clr].cb; + yuy2.b[0] = my_clut[clr].y; + yuy2.b[1] = my_clut[clr].cr; + yuy2.b[2] = my_clut[clr].y; + yuy2.b[3] = my_clut[clr].cb; } if (o >= 15) { while(l--) { - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 0); - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 1); + *((uint16_t *)dst)++ = yuy2.h[0]; + *((uint16_t *)dst)++ = yuy2.h[1]; } if(rle_this_bite & 1) - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 0); + *((uint16_t *)dst)++ = yuy2.h[0]; } else { if( l ) { - mem_blend32(dst, (uint8_t *)&yuy2, o, l); + mem_blend32(dst, &yuy2.b[0], o, l); dst += 4*l; } if(rle_this_bite & 1) { - *dst = BLEND_BYTE(*dst, *(((uint8_t *)&yuy2) + 0), o); + *dst = BLEND_BYTE(*dst, yuy2.b[0], o); dst++; - *dst = BLEND_BYTE(*dst, *(((uint8_t *)&yuy2) + 1), o); + *dst = BLEND_BYTE(*dst, yuy2.b[1], o); dst++; } } diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index 817ccecde..d959f7a8d 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: yuv2rgb.c,v 1.48 2003/12/06 18:11:56 mroi Exp $ + * $Id: yuv2rgb.c,v 1.49 2004/02/19 02:50:26 rockyb Exp $ */ #include "config.h" @@ -68,7 +68,7 @@ static void *my_malloc_aligned (size_t alignment, size_t size, void **chunk) { *chunk = pMem; - while ((int) pMem % alignment) + while ((uintptr_t) pMem % alignment) pMem++; return pMem; |
