dxr3 better (hopefully) color management

Message ID 42592DF2.9040704@ventoso.org
State New
Headers

Commit Message

Luca Olivetti April 10, 2005, 1:45 p.m. UTC
  Hi,
try the attached patch.
Note that the number of regions is arbitrary, the real limit is the 
total spu data (see 
http://web.archive.org/web/20020309020308/http://members.aol.com/mpucoder/DVD/spu.html), 
but that's more difficult to foresee (anyway, in case it's reached the 
dxr3 plugin won't send any data to the spu).
Note also that the plugin doesn't check the maximum number of sections 
(I've added a warning but it will probably segfault in case too many 
sections are added).
I still couldn't find the cause of color bleeding: both the color 
manager (apart from the error fixed by the patch) and the spu encoder 
seems ok to me.

Bye
  

Patch

--- dxr3colormanager.c.orig	2005-04-10 15:32:25.322780808 +0200
+++ dxr3colormanager.c	2005-04-10 15:33:13.146114757 +0200
@@ -67,13 +67,16 @@ 
 // ==================================
 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");	
 }
 
 // ==================================
@@ -103,7 +106,7 @@ 
 
 	if (hlr[NrOfRegions]->N != 0)		// skip this region if there is no section defined
 	{
-		if (NrOfRegions < MAX_NO_OF_SECTIONS -1)
+		if (NrOfRegions < MAX_NO_OF_REGIONS -1)
         {
 			NrOfRegions++;
    		}
@@ -306,6 +309,7 @@ 
 {
 	xSection* sec = new xSection(x);
     int N = hlr[NrOfRegions]->N;
+    if (N>=MAX_NO_OF_SECTIONS-1) printf("Bummer, too many sections\n");
 
 	hlr[NrOfRegions]->Section[hlr[NrOfRegions]->N] = sec;
 	if (N > 0)
--- dxr3colormanager.h.orig	2005-04-10 15:22:25.995573817 +0200
+++ dxr3colormanager.h	2005-04-10 15:22:25.999572591 +0200
@@ -48,7 +48,7 @@ 
 #define OSD_SPU_CM_DUMP 0
 
 #define MAX_NO_OF_SECTIONS	15
-#define MAX_NO_OF_REGIONS	30
+#define MAX_NO_OF_REGIONS	60
 
 
 // ==================================