openatv / enigma2

openatv-gui
GNU General Public License v2.0
200 stars 319 forks source link

blitScale does not use antialiasing #1890

Open technic opened 3 years ago

technic commented 3 years ago

Hi,

I want to display scaled image in the eListboxPythonMultiContent with TYPE_PIXMAP_ALPHABLEND flag and BT_SCALE flag. and the scaling (upscale) is actually horrible:

pc enigma

The upper image I scaled on the PC with Gimp and the border is smooth. The bottom image is rendered with BT_SCALE flag and it has artifacts near the borders.

I have gigablue trio 4k with openatv 6.4. And I cannot figure out which code is used for scaling.

I see that there is a software scaling algorithm, which is very naive https://github.com/openatv/enigma2/blob/a5bfe42888e452c7a610f2e6b61fc719d724e401/lib/gdi/gpixmap.cpp#L676-L689

And there is also call to some hardware render https://github.com/openatv/enigma2/blob/a5bfe42888e452c7a610f2e6b61fc719d724e401/lib/gdi/gpixmap.cpp#L629-L641

Which one is used? So, can this be fixed by software? Does it use bcm_accel_blit or not, because I think this device does not have BCM cpu? The result on the tv is very similar to result when I start enigma2 on PC under SDL when there is a "software" branch of blitScale used.

According to this line https://github.com/openatv/enigma2/blob/14daa805f101e1e5b9187ea5b20a43c25c946db6/configure.ac#L570 my device has HISILICON chip but not HAVE_HISILICON_ACCEL flag. So I assume that software scaling is used. I think on modern arm cpus it should be no problem to use better algorithm for scaling with some cubic antialias or so.

jbleyel commented 1 year ago

Can you please try again with ATV 7.3.