On Sunday 04 March 2007 22:10, Hugo Visser wrote:
> 
> On Mar 4, 2007, at 6:51 PM, Stefan Lucke wrote:
> 
> >
> > A fews days are over and SetSourceRectangle (the real name of  
> > DirectFB's
> > function) is now runtime selectable.
> >
> > But for some reason Blit() of the unichrome driver seems to be broken
> > when not beeing called with the entire area. So the result with HW  
> > assisted
> > decoding is broken when SetSourceRectangle is disabled, and the  
> > scaling
> > is wrong when it is enabled :-( .
> 
> 
> Thanks Stefan, that was really fast :) Unfortunately HW decoding is  
> almost a must have to run decent decoding on epia's. 

50 to 60 % cpu load with sw decodeing vs.
30 - 40 % is not that much difference I guess.

But here is my suggestion to fix the DirectFB unichrome blit bug.

-- 
Stefan Lucke
Index: uc_accel.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/unichrome/uc_accel.c,v
retrieving revision 1.6
diff -U 3 -r1.6 uc_accel.c
--- uc_accel.c  2 Jan 2007 17:46:19 -0000       1.6
+++ uc_accel.c  6 Mar 2007 22:42:09 -0000
@@ -258,8 +258,8 @@
 {
     UC_ACCEL_BEGIN()
 
-    int uv_dst_offset = ucdev->dst_offset + (ucdev->dst_pitch * rect->h);
-    int uv_src_offset = ucdev->src_offset + (ucdev->src_pitch * rect->h);
+    int uv_dst_offset = ucdev->dst_offset + (ucdev->dst_pitch * 
ucdev->dst_height);
+    int uv_src_offset = ucdev->src_offset + (ucdev->src_pitch * 
ucdev->src_height);
     
     int uv_dst_pitch = ucdev->dst_pitch / 2;
     int uv_src_pitch = ucdev->src_pitch / 2;
@@ -292,8 +292,8 @@
     
     // now for the second chrominance plane
     
-    uv_src_offset += uv_src_pitch * rect2.h;
-    uv_dst_offset += uv_dst_pitch * rect2.h;
+    uv_src_offset += uv_src_pitch * ucdev->src_height/2;
+    uv_dst_offset += uv_dst_pitch * ucdev->dst_height/2;
     
     UC_FIFO_PREPARE ( fifo, 6 );
     UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 );
Index: uc_hwset.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/unichrome/uc_hwset.c,v
retrieving revision 1.6
diff -U 3 -r1.6 uc_hwset.c
--- uc_hwset.c  2 Jan 2007 17:45:58 -0000       1.6
+++ uc_hwset.c  6 Mar 2007 22:42:09 -0000
@@ -161,6 +161,7 @@
      int                    dst_bpp     = DFB_BYTES_PER_PIXEL( dst_format );
 
 
+     ucdev->dst_height = destination->height;
      /* Save FIFO space and CPU cycles. */
      if (ucdev->dst_format == dst_format &&
          ucdev->dst_offset == dst_offset &&
@@ -223,6 +224,7 @@
      
      ucdev->src_offset = buffer->video.offset;
      ucdev->src_pitch = buffer->video.pitch;
+     ucdev->src_height = state->source->height;
 
      UC_VALIDATE( uc_source2d );
 }
@@ -244,7 +246,7 @@
      if (UC_IS_VALID( uc_source3d ))
           return;
 
-     src_height = source->height;
+     ucdev->src_height = src_height = source->height;
      src_offset = buffer->video.offset;
      src_pitch  = buffer->video.pitch;
 
Index: unichrome.h
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/unichrome/unichrome.h,v
retrieving revision 1.6
diff -U 3 -r1.6 unichrome.h
--- unichrome.h 1 Feb 2007 18:42:44 -0000       1.6
+++ unichrome.h 6 Mar 2007 22:42:10 -0000
@@ -108,8 +108,10 @@
      DFBSurfacePixelFormat   dst_format; // destination pixel format
      int                     dst_offset; // destination buffer byte offset
      int                     dst_pitch;  // destination buffer byte pitch
+     int                     dst_height;
      int                     src_offset; // source buffer byte offset
      int                     src_pitch;  // source buffer byte pitch
+     int                     src_height;
 
      int                     field;      // source field
 
_______________________________________________
Softdevice-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/softdevice-devel

Reply via email to