Heikki Lindholm schrieb:
> The included patch makes dfb:mgatv use YV12 colourspace for video and
> the hardware subpicture layer for OSD. The patch is a prime example of
> bad goal-oriented programming, but does what I wanted: improves
> performance to the level that my 450 MHz P2 can now function as a DVB
> box like no underpowered P2 has done before! Unfortunately, the patch
> probably breaks everything else, but I'm too lazy to clean it up.
>
Can you please point out to me what the advantage of using the
subpicture layer is? To me it looks like the main speed change is that
you don't scale the osd. Or does the change to YV12 colourspace bring
some speed advantage?
I would not mind adding support for an indexed bitmap, but currently I
don't see the advantage. If we do that we should probably think again
about the interface of GetOSDMode(), I never liked that very much, it
was a hack from the start...
I also had a quick look at your patch and noticed a bug:
> + // if we have space add it
> + if (indexedPaletteEntriesFilled < 16) {
> + indexedPalette[indexedPaletteEntriesFilled] =
> + orig_palette[i]|0xFF000000;
> + palette[i] = indexedPaletteEntriesFilled++;
> + indexedPaletteChanged = true;
> + }
> + else { // if no space, try to find a closest match
> + int closest_i=-1, closest=4*0xFF;
> + for (int j = 0; j < 16; j++) {
> + // euclidean distance would be ideal, but too cumbersome
> + int r = ((uint32_t)orig_palette[i]>>16 & 0x000000FF-
> + (uint32_t)indexedPalette[j]>>16 &
> 0x000000FF)&0x000000FF;
> + int g = ((uint32_t)orig_palette[i]>>8 & 0x000000FF-
> + (uint32_t)indexedPalette[j]>>8 &
> 0x000000FF)&0x000000FF;
> + int b = ((uint32_t)orig_palette[i]>>0 & 0x000000FF-
> + (uint32_t)indexedPalette[j]>>0 &
> 0x000000FF)&0x000000FF;
> + int d = r+g+b;
This doesn't work. Consider orig_palette=126 and indexedPalette=128, the
difference will be -2=0xFFFFFFFE. So you will add 0xFE=255 instead of 2.
You either need an abs() or to square the rgb values, I would prefer the
square.
Bye,
Martin
_______________________________________________
Softdevice-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/softdevice-devel