changeset 36636:28ea3e45b03a

radeon_vid: small simplification.
author reimar
date Sat, 25 Jan 2014 16:55:04 +0000
parents 0b6385acafcc
children d339a982071d
files vidix/fourcc.h vidix/radeon_vid.c
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/fourcc.h	Sat Jan 25 16:55:03 2014 +0000
+++ b/vidix/fourcc.h	Sat Jan 25 16:55:04 2014 +0000
@@ -30,6 +30,8 @@
 #define vid_fourcc(a,b,c,d)\
         (((unsigned)(a)<<0)|((unsigned)(b)<<8)|((unsigned)(c)<<16)|((unsigned)(d)<<24))
 
+#define IMGFMT_IS_RGB(f) ((f & vid_fourcc(0xff,0xff,0xff, 0)) == vid_fourcc('R','G','B', 0))
+
 /* RGB fourcc */
 #define IMGFMT_RGB332  vid_fourcc('R','G','B','1') /*  8  RGB-3-3-2     */
 #define IMGFMT_RGB555  vid_fourcc('R','G','B','O') /* 16  RGB-5-5-5     */
--- a/vidix/radeon_vid.c	Sat Jan 25 16:55:03 2014 +0000
+++ b/vidix/radeon_vid.c	Sat Jan 25 16:55:04 2014 +0000
@@ -2651,21 +2651,18 @@
 			  break;
     }
     besr.load_prg_start=0;
-    besr.swap_uv=0;
+    besr.swap_uv=IMGFMT_IS_RGB(config->fourcc);
     switch(config->fourcc)
     {
 	case IMGFMT_RGB15:
-			   besr.swap_uv=1;
 	case IMGFMT_BGR15: besr.surf_id = SCALER_SOURCE_15BPP>>8;
 			   besr.load_prg_start = 1;
 			   break;
 	case IMGFMT_RGB16:
-			   besr.swap_uv=1;
 	case IMGFMT_BGR16: besr.surf_id = SCALER_SOURCE_16BPP>>8;
 			   besr.load_prg_start = 1;
 			   break;
 	case IMGFMT_RGB32:
-			   besr.swap_uv=1;
 	case IMGFMT_BGR32: besr.surf_id = SCALER_SOURCE_32BPP>>8;
 			   besr.load_prg_start = 1;
 			   break;