[Mplayer-cvslog] CVS: main/vidix/drivers mga_vid.c,1.15,1.16

Zoltan Ponekker pontscho at mplayerhq.hu
Fri Jul 19 22:51:51 CEST 2002


Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var/tmp.root/cvs-serv27481/vidix/drivers

Modified Files:
	mga_vid.c 
Log Message:


- fix audio equalizer
- rewrite video equalizer handling (i teszted with mga g400 [x]mga,xv,xvidix and radeon xv,xvidix )
- fix some small gtk bug
- i dunno, i don't remember ... :)


Index: mga_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/mga_vid.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- mga_vid.c	5 Jul 2002 15:29:12 -0000	1.15
+++ mga_vid.c	19 Jul 2002 20:51:48 -0000	1.16
@@ -1437,6 +1437,8 @@
 {
    uint32_t luma = 0;
    float factor = 256.0 / 2000;
+   static int32_t prev_br = 0;
+   static int32_t prev_c = 0;
 
     /* contrast and brightness control isn't supported on G200 - alex */
     if (!is_g400)
@@ -1444,11 +1446,11 @@
 	if (mga_verbose) printf("[mga] equalizer isn't supported with G200\n");
 	return(ENOTSUP);
     }
-    
-    if (eq->cap & VEQ_CAP_BRIGHTNESS)
-	luma += ((int)(eq->brightness * factor) << 16);
-    if (eq->cap & VEQ_CAP_CONTRAST)
-	luma += ((int)(eq->contrast * factor) & 0xFFFF);
+
+    if (eq->cap & VEQ_CAP_BRIGHTNESS) { prev_br=eq->brightness; if ( prev_br == 1000 ) prev_br=999; }
+    if (eq->cap & VEQ_CAP_CONTRAST) { prev_c=eq->contrast; if ( prev_c == 1000 ) prev_c=999; }
+
+    luma = ((int)(prev_br * factor) << 16) + ((int)(prev_c * factor) & 0xFFFF);
 
     regs.beslumactl = luma+0x80;
 
@@ -1471,8 +1473,8 @@
     regs.beslumactl = readl(mga_mmio_base + BESLUMACTL);
     luma = regs.beslumactl-0x80;
 
-    eq->brightness = (luma >> 16) * factor;
-    eq->contrast = (luma & 0xFFFF) * factor;
+    eq->brightness = (signed short int)(luma >> 16) * factor;
+    eq->contrast = (signed short int)(luma & 0xFFFF) * factor;
     eq->cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST;
 
     return(0);




More information about the MPlayer-cvslog mailing list