From patchwork Thu Apr 21 16:51:48 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 11858 Received: from 232.red-213-97-27.pooles.rima-tde.net ([213.97.27.232]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DOeuj-0001Wj-75 for vdr@linuxtv.org; Thu, 21 Apr 2005 18:52:29 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by 232.Red-213-97-27.pooles.rima-tde.net (Postfix) with ESMTP id 5DF5D18ACC44 for ; Thu, 21 Apr 2005 18:51:54 +0200 (CEST) Message-ID: <4267DA24.1050808@ventoso.org> Date: Thu, 21 Apr 2005 18:51:48 +0200 From: Luca Olivetti User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: Re: [vdr] [PATCH] DXR3 better color management References: <816406DC34E14D4A80288699FE3BA4180A9351@wiems02007.ceu.corp.heidelberg.com> In-Reply-To: <816406DC34E14D4A80288699FE3BA4180A9351@wiems02007.ceu.corp.heidelberg.com> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2005 16:52:30 -0000 Status: O X-Status: X-Keywords: X-UID: 1742 Husterer, Thomas RD-CP1 wrote: > Hi, > > like Luca Olivetti a week ago, I fixed the bug in the colormanager which caused > the color bleeding effekt. > > Unfortunately I could not compare my changes to them of Luca Olivetti because the diff-files are not stored in the mailing-archive and i was not subscribed to this mailinglist at that time. Use the archive at gmane, that stores the attachments too. Unfortunately (for the duplication of effort), that has been only a first step. I've done more radical modifications that have been commited to cvs last sunday (or saturday). > > My changes should not change too much the original performance. > I fixed the behaviour of the color-index optimization by introduction of > A maximal x-koordinate to which this color-index is valid. Already done in cvs > This ensures that no section regions are crossed. > To improve performance I removed the final memcopy which copied a help-buffer into the destination buffer. Already done in cvs > > After this fix I recognized that the last region was not closed and therefore the last color-index table was not sent to the spu. This resulted in a small > bad colored rectangle in the lower right corner of the channels-menu. > This is fixed by a closeRegion() at the end. Already done in cvs > > A small change in osd.c ensures that the default color of an empty bitmap > results in a well defined transparent color. Before that change i recognized to different colorindices for the transparent color. Is that really needed? > > At least I changed the color-to-section-map-algorithm. > The algorithm before had a problem with diagonal edged shapes like the charactar ´A´. > This edges could lead to a consumption of many regions with very flat sections because the sectionlimits move to the left from each line to another. > My changement uses in the first line of a Region only 3 colors for one section instead of 4. This leads to more sections in horizontal direction but it gives a chance to other colors in sequential lines. > This leads to more quadratic sections because the width decreases and the height increases. This is an interesting optimization, since I usually have many regions with 1 or 2 sections each. With your method it's a big improvement (if there are no more than 15 sections for region, in that case it fails, check, e.g. the solitaire plugin, not a big loss since it isn't playable anyway). > Does anybody know how these changes can be merged into the cvs-archive of the dxr3-plugin? > (my original version is a nearly HEAD version of the cvs-archive) You can check out the current version (the vdr-dxr3-0-2 branch) and send the diff against it to Ville (only the last optimization is needed, the rest is already there). I've attached it here so you'll avoid to do the work ;-) Anyway, if you didn't already do that, checkout the current version in cvs: I've changed color management so that you can have different colors at each Flush (useful if you want to use skinks with icons: with enigma I had to limit the colors for each icon to 3, but those can be different for each icon). Now, if only you could find why Dirty gives bad results, only if used with the dxr3 plugin...... ;-) Bye Index: dxr3colormanager.c =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/dxr3colormanager.c,v retrieving revision 1.1.2.9 diff --unified -r1.1.2.9 dxr3colormanager.c --- dxr3colormanager.c 19 Apr 2005 18:19:36 -0000 1.1.2.9 +++ dxr3colormanager.c 21 Apr 2005 16:49:31 -0000 @@ -68,13 +68,17 @@ // ================================== cColorManager::~cColorManager() { + //printf("NrOfRegions %d ",NrOfRegions); for (int i = 0; i < NrOfRegions; i++) { if (hlr[i]) { + //printf("%d ",hlr[i]->N); delete(hlr[i]); } } + //printf("\n"); + } // ================================== @@ -231,7 +235,7 @@ if (!curSection->HasColor(color, ColorIndex)) { // this color is new for this section - if (curSection->AllColorsUsed()) + if (curSection->AllColorsUsed(curRegion->Y1==y)) { // no more free colors if (y != curRegion->Y1) Index: dxr3colormanager.h =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/dxr3colormanager.h,v retrieving revision 1.1.2.8 diff --unified -r1.1.2.8 dxr3colormanager.h --- dxr3colormanager.h 19 Apr 2005 18:19:34 -0000 1.1.2.8 +++ dxr3colormanager.h 21 Apr 2005 16:49:31 -0000 @@ -54,12 +54,9 @@ xSection(int x); bool HasColor(unsigned int color, unsigned char &ColorIndex); unsigned char AddColor(unsigned int color); - bool AllColorsUsed() { + bool AllColorsUsed(bool FirstLine) { //DIAG("AllColorsUsed: %d\n",NrOfColors); - if(NrOfColors >= 4) - return (true); - else - return (false); + return(NrOfColors >= (FirstLine ? 3 : 4)); }; int X1; int X2;