osdteletext-0.4.2 page render speed up
Commit Message
Hi list,
Since osdteletext page drawing is rather slow on my C3-600, I
investigated the page rendering speed of osdteletext-0.4.2. Average
rendering time is 0.74s, dividing down to 0.11s rendering, 0.45s
scaling, 0.09s osd drawing and 0.11s screen update. (numbers might be
slightly off due to additional debug output)
After a rewrite of the scaler, the scaling is down to 0.1s, speeding up
screen update from 0.74s to 0.39s - a noticeable improvement. ;)
The attached patch adds the new scaling code.
Cheers,
Udo
Comments
On Tuesday 08 March 2005 19:32, Udo Richter wrote:
> Hi list,
>
> Since osdteletext page drawing is rather slow on my C3-600, I
> investigated the page rendering speed of osdteletext-0.4.2. Average
> rendering time is 0.74s, dividing down to 0.11s rendering, 0.45s
> scaling, 0.09s osd drawing and 0.11s screen update. (numbers might be
> slightly off due to additional debug output)
>
> After a rewrite of the scaler, the scaling is down to 0.1s, speeding up
> screen update from 0.74s to 0.39s - a noticeable improvement. ;)
>
> The attached patch adds the new scaling code.
>
> Cheers,
>
> Udo
nice work !! :)
Am Dienstag 08 März 2005 19:32 schrieb Udo Richter:
> Hi list,
>
> Since osdteletext page drawing is rather slow on my C3-600, I
> investigated the page rendering speed of osdteletext-0.4.2. Average
> rendering time is 0.74s, dividing down to 0.11s rendering, 0.45s
> scaling, 0.09s osd drawing and 0.11s screen update. (numbers might be
> slightly off due to additional debug output)
>
> After a rewrite of the scaler, the scaling is down to 0.1s, speeding up
> screen update from 0.74s to 0.39s - a noticeable improvement. ;)
>
> The attached patch adds the new scaling code.
Thanks. This code really looks better.
Marcel
>
> Cheers,
>
> Udo
Udo Richter wrote:
> Since osdteletext page drawing is rather slow on my C3-600, I
> investigated the page rendering speed of osdteletext-0.4.2.
> After a rewrite of the scaler, the scaling is down to 0.1s, speeding up
> screen update from 0.74s to 0.39s - a noticeable improvement. ;)
Time to heat things up!
The new patch replaces almost the complete character rendering, and
draws directly to the osd display buffers. Render time is now down to
0.172s, giving a speed boost of 4.3x. :)
Get it at:
http://urichter.cjb.net/vdr/?h=osdtt-speedup (german)
http://urichter.cjb.net/vdr/?h=osdtt-speedup&l=en (english)
On a side note - Displaying the current page again only needs 0.08s, I
guess this is due to reading from same disk buffers again.
Cheers,
Udo
PS: @Marcel: Did you get my mail?
@@ -74,6 +74,39 @@
cBitmap *bitmap=new cBitmap(wneu, hneu, depth);
Display::SetBitmapPalette(*bitmap);
+#if 1
+ // Scale rule:
+ // xsrc=x0 + xdst*walt/wneu
+ // ysrc=y0 + ydst*halt/hneu
+
+ int xsrc,xdst,xfrac,ysrc,ydst,yfrac;
+ // exact src coordinate is floor(xsrc+xfrac/wneu),floor(ysrc+yfrac/hneu)
+ ysrc=y0;
+ ydst=0;
+ yfrac=0;
+ while (ydst<hneu) {
+ xsrc=x0;
+ xdst=0;
+ xfrac=0;
+ while (xdst<wneu) {
+ bitmap->SetIndex(xdst,ydst,*(oldBitmap->Data(xsrc, ysrc)) );
+ xdst++;
+ xfrac+=walt;
+ while (xfrac>=wneu) {
+ xfrac-=wneu;
+ xsrc++;
+ }
+ }
+ ydst++;
+ yfrac+=halt;
+ while (yfrac>=hneu) {
+ yfrac-=hneu;
+ ysrc++;
+ }
+
+ }
+
+#else
int/*float*/ oldX=0, oldY=0;
for (float x=0;x<wneu;x++)
for (float y=0;y<hneu;y++) {
@@ -84,6 +117,7 @@
oldY=(int)(((halt*10000/hneu)*y/10000));
bitmap->SetIndex((int)x,(int)y,*(oldBitmap->Data(oldX+x0, oldY+y0)) );
}
+#endif
return bitmap;
}