Hi all,

thinking again about the OSD troubles with nvidia, and that Stefan
suggested that it might be a wrong range of YUV values, I have prepared
some patches. Could someone who has these problems with the OSD please
try them separately and tell me if one resolves the problems?

I checked our conversion RGB->YUV, it respects the range. But there is
still this small bug in the scaling algorithm which sometimes produces
stray pixels at the edges. Those pixel may have any values and if the
nVidia cards gets confused by those pixels, it may well be that the
complete line looks strange.

Thank you for any reports!
Martin
Index: SoftOsd.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/SoftOsd.c,v
retrieving revision 1.16
diff -u -r1.16 SoftOsd.c
--- SoftOsd.c   10 Jul 2006 18:23:28 -0000      1.16
+++ SoftOsd.c   8 Sep 2006 17:26:31 -0000
@@ -908,7 +908,7 @@
                                 pAlphaY,pAlphaY+Ystride,pAlphaUV,
                                 //              
&pixmap[y*OSD_STRIDE],&pixmap[(y+1)*OSD_STRIDE],
                                 //              dest_Width);
-                        tmp_pixmap,&tmp_pixmap[dest_Stride],dest_Width);
+                        tmp_pixmap-1,&tmp_pixmap[dest_Stride]-1,dest_Width-2);
         };
         memset(dirty_lines,false,sizeof(dirty_lines));
         OSDDEB("CopyToBitmap YUV no Vscale end \n");
@@ -1013,7 +1013,7 @@
                               pAlphaY,pAlphaY+Ystride,pAlphaUV,
                 //              
&pixmap[y*OSD_STRIDE],&pixmap[(y+1)*OSD_STRIDE],
                 //              dest_Width);
-                              tmp_pixmap,&tmp_pixmap[OSD_STRIDE],dest_Width);
+                              
tmp_pixmap-1,&tmp_pixmap[OSD_STRIDE]-1,dest_Width-2);
         };
         memset(dirty_lines,false,sizeof(dirty_lines));
         OSDDEB("CopyToBitmap YUV down end \n");
Index: utils.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/utils.c,v
retrieving revision 1.17
diff -u -r1.17 utils.c
--- utils.c     10 Jul 2006 17:46:59 -0000      1.17
+++ utils.c     8 Sep 2006 17:29:59 -0000
@@ -636,7 +636,7 @@
 void AlphaBlend(uint8_t *dest,uint8_t *P1,uint8_t *P2,
           uint8_t *alpha,uint16_t count) {
      // printf("%x %x %x \n",P1,P2,alpha);
-
+/*
 #ifdef USE_MMX
         __asm__(" pxor %%mm3,%%mm3\n"
 #ifdef USE_MMX2
@@ -701,11 +701,15 @@
        }
        EMMS;
 #endif //USE_MMX
-
+*/
        //fallback version and the last missing bytes...
        for (int i=0; i < count; i++){
           dest[i]=(((uint16_t) P1[i] *(uint16_t) alpha[i]) +
              ((uint16_t) P2[i] *(256-(uint16_t) alpha[i])))  >>8 ;
+          if (dest[i]>235)
+                  dest[i]=235;
+          if (dest[i]<16)
+                  dest[i]=16;
        }
 }
 
Index: utils.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/utils.c,v
retrieving revision 1.17
diff -u -r1.17 utils.c
--- utils.c     10 Jul 2006 17:46:59 -0000      1.17
+++ utils.c     8 Sep 2006 17:28:50 -0000
@@ -636,7 +636,7 @@
 void AlphaBlend(uint8_t *dest,uint8_t *P1,uint8_t *P2,
           uint8_t *alpha,uint16_t count) {
      // printf("%x %x %x \n",P1,P2,alpha);
-
+/*
 #ifdef USE_MMX
         __asm__(" pxor %%mm3,%%mm3\n"
 #ifdef USE_MMX2
@@ -701,11 +701,13 @@
        }
        EMMS;
 #endif //USE_MMX
-
+*/
        //fallback version and the last missing bytes...
        for (int i=0; i < count; i++){
           dest[i]=(((uint16_t) P1[i] *(uint16_t) alpha[i]) +
              ((uint16_t) P2[i] *(256-(uint16_t) alpha[i])))  >>8 ;
+          if (dest[i]>235)
+                  dest[i]=235;
        }
 }
 
Index: utils.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/utils.c,v
retrieving revision 1.17
diff -u -r1.17 utils.c
--- utils.c     10 Jul 2006 17:46:59 -0000      1.17
+++ utils.c     8 Sep 2006 17:29:22 -0000
@@ -636,7 +636,7 @@
 void AlphaBlend(uint8_t *dest,uint8_t *P1,uint8_t *P2,
           uint8_t *alpha,uint16_t count) {
      // printf("%x %x %x \n",P1,P2,alpha);
-
+/*
 #ifdef USE_MMX
         __asm__(" pxor %%mm3,%%mm3\n"
 #ifdef USE_MMX2
@@ -701,11 +701,13 @@
        }
        EMMS;
 #endif //USE_MMX
-
+*/
        //fallback version and the last missing bytes...
        for (int i=0; i < count; i++){
           dest[i]=(((uint16_t) P1[i] *(uint16_t) alpha[i]) +
              ((uint16_t) P2[i] *(256-(uint16_t) alpha[i])))  >>8 ;
+          if (dest[i]<16)
+                  dest[i]=16;
        }
 }
 
_______________________________________________
Softdevice-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/softdevice-devel

Reply via email to