[PATCH][Regression] BETA4: Scaling: needs better algo...

Postings relating to old VirtualBox pre-releases

[PATCH][Regression] BETA4: Scaling: needs better algo...

Postby Technologov » 2. Apr 2015, 01:45

Congrats for adding a new Retina-display mode !

Right now I have re-sized Windows XP to 150% on normal, non-retina display... (90 PPI) and eh... it is Ugg-lee.

Worse: Fonts are unreable. It kills my eyes.
Please consider a better image scaling algorithm.
I know GIMP gives a *MUCH* better result. (Lanczos algo, but probably not real-time...)
Is there anything good a modern GPU offers on OpenGL ?

(at least 200% looks fine. This is what I will use for old guests, once I get Retina display.)

Screenshot attached.
Attachments
notepad-WinXP-at-150-percent.png
Screenshot
notepad-WinXP-at-150-percent.png (6.37 KiB) Viewed 9181 times
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Re: Display resizing needs better scaling ...

Postby Technologov » 2. Apr 2015, 01:47

A text font like that (above) kills my eyes.

This is because part of the letter has 2 pixels, part has one pixel, and with low vision like myself my brain needs to work harder to interpret this image. Problem is particularly visible on the letter "o".
This results in head-ache after several minutes of work, as my brain need to concentrate harder to see the letters and recognize. Worse yet - this happens at sub-conscious level, making people angry and frustrated.
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Re: Scaling: needs better algo...

Postby Dsen » 2. Apr 2015, 14:38

I'm not sure what we can do for the software rendering case.
I can (and will) enable smooth Qt scaling algorithm but it will be much slower than that we have now (at least not that ugly as currently).
Finding 3rd party image scaling algorithm which is fast and smooth at the same time - is not an easy task.
For the 3D rendering case we at least will be able to do something more, there are known techniques already.
Dsen
Oracle Corporation
 
Posts: 164
Joined: 10. Sep 2007, 10:42

Re: Scaling: needs better algo...

Postby birdie » 2. Apr 2015, 14:42

Dsen wrote:I'm not sure what we can do for the software rendering case.
I can (and will) enable smooth Qt scaling algorithm but it will be much slower than that we have now (at least not that ugly as currently).
Finding 3rd party image scaling algorithm which is fast and smooth at the same time - is not an easy task.
For the 3D rendering case we at least will be able to do something more, there are known techniques already.


Like I mentioned in the other thread, if any scaling algorithms are to be implemented it must use OpenGL shaders otherwise it will be prohibitively computationally expensive (which also means that VM must be output via OpenGL).
birdie
 
Posts: 199
Joined: 2. May 2010, 14:19
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows, Linux, other Unixes

Re: Scaling: needs better algo...

Postby Dsen » 2. Apr 2015, 14:45

birdie wrote:
Dsen wrote:I'm not sure what we can do for the software rendering case.
I can (and will) enable smooth Qt scaling algorithm but it will be much slower than that we have now (at least not that ugly as currently).
Finding 3rd party image scaling algorithm which is fast and smooth at the same time - is not an easy task.
For the 3D rendering case we at least will be able to do something more, there are known techniques already.


Like I mentioned in the other thread, if any scaling algorithms are to be implemented it must use OpenGL shaders otherwise it will be prohibitively computationally expensive (which also means that VM must be output via OpenGL).


Yep, I have seen that your proposal, but currently we can't use embedded OpenGL scaling for software rendering mode. GUI architecture limitation. It will be probably possible in future releases.
Of course for 3D rendering case that will come more early I suppose.
Dsen
Oracle Corporation
 
Posts: 164
Joined: 10. Sep 2007, 10:42

Re: Scaling: needs better algo...

Postby Technologov » 2. Apr 2015, 15:08

What is theoretically possible - but tricky - is to do 2-stage algo.

For example, Red Hat SPICE uses 2-stage algo for remote desktop protocol (Red Hat's SPICE).
1st level algo is fast, but ugly. (can work with animation, video and the like)
2nd level algo kicks in after few seconds, if no change to guest image (i.e. when reading text).

This 2nd level algo can be slow but high-quality.
No GPU needed.
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Re: Scaling: needs better algo...

Postby birdie » 2. Apr 2015, 15:20

Dsen wrote:Yep, I have seen that your proposal, but currently we can't use embedded OpenGL scaling for software rendering mode. GUI architecture limitation. It will be probably possible in future releases.
Of course for 3D rendering case that will come more early I suppose.


Take a look at this:

http://www.vips.ecs.soton.ac.uk/index.p ... untu_14.10

Perhaps the VIPS library (licensed under the LGPL which is appropriate for VBox) is the best solution - it sports many algorithms not limited to Bilinear and Bicubic and it's really fast.
birdie
 
Posts: 199
Joined: 2. May 2010, 14:19
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows, Linux, other Unixes

Re: Scaling: needs better algo...

Postby frank » 2. Apr 2015, 16:54

birdie wrote:Take a look at this:

http://www.vips.ecs.soton.ac.uk/index.p ... untu_14.10

Perhaps the VIPS library (licensed under the LGPL which is appropriate for VBox) is the best solution - it sports many algorithms not limited to Bilinear and Bicubic and it's really fast.

Nice suggestion but adding the usage of LGPL software to VirtualBox is almost impossible. It's hard to get legal approval and for LGPL it's almost impossible.
frank
Oracle Corporation
 
Posts: 3362
Joined: 7. Jun 2007, 09:11
Location: Dresden, Germany
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows

Re: Scaling: needs better algo...

Postby birdie » 2. Apr 2015, 18:11

Frank Mehnert wrote:Nice suggestion but adding the usage of LGPL software to VirtualBox is almost impossible. It's hard to get legal approval and for LGPL it's almost impossible.


It's very strange since LGPL is a very permissive license.
birdie
 
Posts: 199
Joined: 2. May 2010, 14:19
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows, Linux, other Unixes

Re: Scaling: needs better algo...

Postby Technologov » 2. Apr 2015, 18:14

LGPL requires Oracle to publish library's code when they are selling Oracle VDI, so they don't like it.
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Re: Scaling: needs better algo...

Postby michaln » 2. Apr 2015, 19:08

birdie wrote:It's very strange since LGPL is a very permissive license.

You got that exactly backwards :) GPL is about the least permissive license, and LGPL is only slightly more permissive. For licenses that are actually permissive (i.e. place very few restrictions on the licensee), see the BSD or MIT licenses.
michaln
Oracle Corporation
 
Posts: 2957
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all

Re: Scaling: needs better algo...

Postby bostjan » 9. Apr 2015, 08:56

Technologov wrote:LGPL requires Oracle to publish library's code when they are selling Oracle VDI, so they don't like it.

I thought the code only needs to be published if you modify the library? Unmodified 'official' binaries cannot be used?
bostjan
 
Posts: 5
Joined: 9. Apr 2015, 08:42

Re: Scaling: needs better algo...

Postby Technologov » 9. Apr 2015, 09:10

Code for unmodified libs must be published also.
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Re: Scaling: needs better algo...

Postby twipley » 14. May 2015, 21:59

Dsen wrote:I have seen that your proposal, but currently we can't use embedded OpenGL scaling for software rendering mode. GUI architecture limitation. It will be probably possible in future releases.
Of course for 3D rendering case that will come more early I suppose.

This is why locking the scale factor to integer values makes sense. (Or at least, putting an option for this restriction.) As noted by Technologov, 200% is exact multiply (2x, 3x, etc.) and every pixel end up being given as much love. No smaller lines than the others, or such.

GL_NEAREST interpolation might be a good candidate when the afore-mentioned limitation is bypassed in the future. Nearest-neighbor, in an integer-scaling scenario, is the mapping of individual pixels to larger (2x2, 3x3, 4x4, and so forth) blocks of like-value pixels. That scaling method is implementable because, if my logic is correct, no rights protect it. It's just doubling. There's no complicated code to borrow, but the limitation is that it only works great on 2x or something. Personally, I like it best than bilinear and ever lanczos in integer-scaling environments. It's an algorithm that should be selectable in every scaling software. It preserves detail and original data like no other can.
twipley
 
Posts: 72
Joined: 5. Jul 2011, 20:46
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Scaling: needs better algo...

Postby Technologov » 14. May 2015, 22:08

One idea is to allow integer-only scaling for software rendering. And require OpenGL for non integer scaling.
Technologov
Volunteer
 
Posts: 3305
Joined: 10. May 2007, 16:59
Location: Israel

Next

Return to Old Beta Postings

Who is online

Users browsing this forum: No registered users and 0 guests