Kodi Community Forum
HQ OpenGL HW (GPU) upscalers from Bobo1on1? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: HQ OpenGL HW (GPU) upscalers from Bobo1on1? (/showthread.php?tid=67486)

Pages: 1 2 3 4


HQ OpenGL HW (GPU) upscalers from Bobo1on1? - alanwww1 - 2010-01-16

Hi Bobo1on1 !

I made a few tests with the great new shader based upscalers you implemented.
I have to tell they really make a difference Smile. To my eyes Lanczos 3 optimized is the same quality as the software implementation. It looks really really good.

However i realized that i can't use one specific upscaler to all SD and HD videos, because my HW can not take it. For example Lanczos 3 is too slow for my Nvidia 9400 even in SD scenario, but Lanczos 3 optimized works really awesome with excellent quality. But even Lanczos 3 optimized is not fast enough in case of 720p material upscaled to 1080p.

Also i realized that in case of vdpau used, if i change the upscaler, nothing happens. I guess it uses vdpau internal upscaler in any case.

So to solve all these problems i have a suggestion. Maybe we could divide the gui setting for video "Render method" into two lines:

1. Render method for SD videos: Auto detect
2. Render method for HD videos: Auto detect

The default setting could be Auto detect, which could work just like before.
If the user sets the renderer different from Auto Detect, he gets another setting line appear for the available upscaler types for that specific renderer where he can set the desired upscaler separately for SD and for HD videos.

For example:

1. Render method for SD videos: GLSL
Upscaler used for SD videos: Lanczos 3 optimized
2. Render method for HD videos: Auto detect

Or:

1. Render method for SD videos: GLSL
Upscaler used for SD videos: Lanczos 2
2. Render method for HD videos: Crystal-HD
Upscaler used for HD videos: Bicubic

What do you think about the idea ?
Some kind of separation between SD and HD methods is really needed i think.

One other thing i realized is that now with SW upscalers i get a magnified portion of the movie. But this started before you started implementing these great HW upscalers.

Great work and thanks also in the name of all ION users who can from now enjoy HQ upscaled SD videos with minimal CPU utilization.

Thanks again, cheers,

Alan


- alanwww1 - 2010-01-16

I've just seen your new commit Smile

http://trac.xbmc.org/changeset/26891

You are ahead of everyone. I will test and report.

What i see from the code is it does not solve the problem of the SD x264 videos with non featue set C video cards.
This case xbmc uses vdpau for rendering these SD videos (apple trailer, my dvd collection ripped into x264 etc.) with the ugly vdpau internal upscaler. Wouldn't it be possible to somehow have an option to limit VDPAU just for the HD videos and NOT for SD ones ?


- bobo1on1 - 2010-01-16

I was wondering when you were going to start a thread about this :p

Anyway we want less settings in xbmc, not more, so eventually there should only be the choice between bilinear or auto, where auto chooses lanczos3 optimized for SD and bilinear for HD.
Bicubic, lanczos2 and lanczos3 optimized use the same shader, so they run at the exact same speed, the only difference is a different kernel is uploaded to the kernel texture.

It is technically possible to use the shaders for scaling vdpau, I'm planning to look into that.


- alanwww1 - 2010-01-16

bobo1on1 Wrote:I was wondering when you were going to start a thread about this :p

You know my weakness very well Big Grin

bobo1on1 Wrote:Bicubic, lanczos2 and lanczos3 optimized use the same shader, so they run at the exact same speed, the only difference is a different kernel is uploaded to the kernel texture.

If the speed is the same, how come my hardware can't take Lanczos3 (i get a lot of dropped frames) but can handle the optimized one. Maybe i used the wrong word, but actually they take up different amount of resource from the video card. Is it right ? So on a faster video card Lanczos3 might work no problem.

bobo1on1 Wrote:It is technically possible to use the shaders for scaling vdpau, I'm planning to look into that.

THAT would be awesome. It would be interesting only with SD material. But i think for that we would have to use vdpau to decode the video to it's native SD resolution without upscaling and than we can upscale it with the shaders.

I think it would be easier to implement to let users decide whether they want hw decode for SD videos or not. It could be done also in as.xml. I am not sure (beacuse i don't have one) if IONs need hw decode for SD x264 files.

The best way of course would be if we could use shaders to upscale SD vdpau material. I can tell that your Lanczos 3 optimized scaler looks a lot better than the nvidia hq upscaler introduced in the new G2x0 cards. And of course this way the ION users and all others (like me) without having a fearure set "C" card can also be very happy.


- bobo1on1 - 2010-01-16

alanwww1 Wrote:If the speed is the same, how come my hardware can't take Lanczos3 (i get a lot of dropped frames) but can handle the optimized one. Maybe i used the wrong word, but actually they take up different amount of resource from the video card. Is it right ? So on a faster video card Lanczos3 might work no problem.
I said bicubic, lanczos2 and lanczos3 optimized use the same shader, which means lanczos3 uses a different shader, which is a slower one.
Lanczos3 runs at 90 fps on my 8600gt, so if you have a fast card you're good.
For comparison, the lanczos3 optimized scaler runs at more than 200 fps, and lanczos3 in software maxes out at 50 fps on my amd X2 4000+.


- ezechiel1917 - 2010-01-16

Decent hw upscaler for SD? Great Smile Thanks bobo1on1 Nod


- alanwww1 - 2010-01-17

I have put together a diff if anyone wants to use these great upscalers in the latest stable release XBMC Camelot. I tested it. It compiles and works great. Big Grin

For new users just make an svn checkout for the stable branch:

Code:
svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/tags/9.11_Camelot/ xbmc_camelot

after that download and unzip the patch to the xbmc-camelot directory. And than patch it:

Code:
cd xbmc-camelot
patch -p0 < shader_upscalers_for_camelot.diff
./bootstrap
./configure --prefix=/usr
make
sudo make install

All done. You can enjoy the great upscalers in the STABLE release. Don't forget to set the upscaler to "auto".

Thanks Bobo1on1 for this !

Cheers, Alan


- dteirney - 2010-01-17

I'm not sure if ATI is playing nicely with some of these changes.

With my Render Method set to "Auto detect" in settings and Scaling Method set to "Bilinear" within the Video OSD, playback shows a white screen or a shade of a color across almost the entire screen (almost like a massively blurry pane is over the screen, sort of averaging the picture out to almost a single color).

Same blurred behaviour with the "Advanced shaders (GLSL)" option.

Fine with "Basic Shaders (ARB)" or "Software" though.

I'm running with the latest ATI Catalyst Drivers (9.12) on Mythbuntu 8.10 with r26918.

Debug log opening a few files that showed a white screen or black screen at http://xbmc.pastebin.com/m109c55ea


- alanwww1 - 2010-01-17

dteirney Wrote:With my Render Method set to "Auto detect" in settings and Scaling Method set to "Bilinear" within the Video OSD, playback shows a white screen or a shade of ...

I think auto detect chooses GLSL in your case.

As i know (Bobo has to confirm) the BILINEAR upscaler was NOT changed at all !
Only other scaler options were added. So it might be that the problem is related in an other changset in the code, not the scaler part.

Might be some change with the GLSL renderer.

You could try out my diff against the Camelot stable code (Post #7 ) This way we can test out the shaders by itself, to check if your problems comes from the shader side or from an other area...


- bionicmunky - 2010-01-17

Just did my first ever compile using your diff Alan, I can confirm this is working nice :-)

Thanks Bobo1on1 & Alan et al.

p.s. using a G210 here


- alanwww1 - 2010-01-17

bionicmunky Wrote:Just did my first ever compile using your diff Alan, I can confirm this is working nice :-)
Thanks Bobo1on1 & Alan et al.
p.s. using a G210 here

Glad it worked for you. Credit to the Devs. I remeber my "old" days when i started compiling...

I created the DEB packages for people don't want to recompile Camelot. Download it from here:

http://jkft.info/xbmc/xbmc_camelot_mod_alanwww1_debpackages.zip

just download unzip it to an empty dir. Than:

Code:
sudo dpkg -i xbmc*

These packages contain other improvements. Full changelog:

- HQ HW opengl upscalers bacported, credits to Bobo1on1
- CD Eject dialog added for Confluence skin, credits to Jezz_x
- Music Media flagging support in fullscreen visualization, credits to ...well me :-)

Have fun ! Alan


- athloni - 2010-01-20

Does the Asrock ION support this also?
And will it work with GL builds for Windows?


- spiff - 2010-01-20

yes. and yes but unnecessary since they are also avail for d3d now.


- athloni - 2010-01-20

spiff Wrote:yes. and yes but unnecessary since they are also avail for d3d now.

Oke...so Harware HQ upscaling works also on the DX builds?
It gets better and better Smile


- spiff - 2010-01-20

yes.

sorry if the dot makes my answer ungraspable.