dxr3 better (hopefully) color management
Commit Message
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
@@ -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)
@@ -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
// ==================================