Plex Media Center for OS X Leopard

Experimenting with Bicubic scaling

So for lack of anything better to do, I played around with getting swscale (a component of ffmpeg) to attempt performing high quality software upscaling. By default we perform bilinear upscaling, and with SD content, it looks pretty crappy, with lots of jagged lines.

After getting it to work, I took a couple of screenshots to show you the difference. In terms of performance, my desktop had enough power to do bicubic upscaling of both SD and 720p content to 1080p. It has to be said that it is definitely an expensive operation.

The win was most obvious — to my eyes, at least — with SD content. Here’s a sample from the intro of a movie. The first is bilinear (notice the jagged circle), and the second is bicubic.

bilinear.png

bicubic.png

Pretty nice, right? Now let’s try 720p, with some good diagonal lines taken from Kevin Spacey’s jawline:

bilinear2.png
bicubic2.png
Again, the first is bilinear, the second is bicubic. The screenshot is unfortunately not taken from the same exact frame, and I think that’s why his face looks more “textured” in the second shot. But you’ll also notice that there doesn’t appear be a great deal of difference between the two. It’s possible that I didn’t pick a very good spot, but it’s also possible that the difference between the two algorithms doesn’t really kick in until you’re doing more than a 2x scaling. This kind of makes sense to me, but it’s late and I’ve been drinking.

8 Comments so far

  1. tajson April 4th, 2008 1:56 am

    I think you have a fault proof concept there when you always as a last exit blame the alcohol for whatever could be wrong with your ideas.

    If it works as an excuse when you do something illegal, it will work everywhere… Atleast where I live :)

  2. nefilim April 4th, 2008 5:11 am

    Pretty cool! Any chance of doing this in hardware with OpenGL?

    On a vaguely related note, I recently did a quick comparison between the H264 output of VLC,MPlayer and threw in XBMC-OSX at the end:

    http://nefilim.wordpress.com/2008/03/15/h264-quality-differences-in-players/

  3. Dudeman April 4th, 2008 9:06 am

    This is getting better and better…

    The alure of XBMC, for me at least, had always been its ability to scale a relatively low resolution (SD) image to HD, and make it look good. Yes, the interface is really slick, yes, there’s nothing like it out there, but ultimately it’s all about the quality of the image.

    I don’t know how many times I would have people over watching a movie, then they would comment on how clear the video was, and I would, just for kicks, cycle through the resolutions ’till I got to the original size, and their jaw would drop when they would see how small the original image was and how good it looked enlarged.

    Getting bicubic scaling going, and whatever other tricks the old XBOX/XBMC was capable of that made the scaling look so good, is ultimately what we’re all looking forward to.

    Yes, HD content looks great already, but not everything I have (or most of us have), is HD content, so the abiltiy to make SD content look realy good is a major plus. I don’t want to have an Xbox to play SD content AND a Mac to play HD content. One box should do it all.

    At the moment I’m still using my old Xbox connected to the HDTV, and XBMX Mac on my 24″ iMac, but I can see that soon I’ll be retiring the old box in favor of a shiny new Mac-Mini.

    Keep up the great work, and thanks again for your efforts.

  4. elan April 4th, 2008 9:07 am

    @tajson: You’re right, I need to take responsibility for my thoughts! Just because I’m usually drinking at the time doesn’t mean that it’s the booze talking. Of course, I’m enjoying a Bloody Mary at the moment, so you know what that means.

    @nefilim: It’s possible, there is a bicubic upscaling implementation in there, but it doesn’t seem to work on my desktop NVidia card, and it’s unknown whether it will work on GMA950/X3100. Thanks for the link!

  5. Martin April 4th, 2008 10:11 am

    @elan

    As you know (from MSN) :)

    - I would really like better SD movie quality!

    Maybe there could be an option to turn it off/on in an upcoming release?

    Good work, as always
    /Martin

  6. elan April 4th, 2008 10:20 am

    @Martin: Yes, look for it in the next release, with both Bicubic and Lanczos up-scaling optionally available.

  7. Ajgoyt April 4th, 2008 5:28 pm

    Wow getting better all the time - Source has a lot do with upscaling - Thanks Again for your hardwork…

    Aj

  8. elupus April 10th, 2008 2:39 am

    bicubic scaling has a tendency to blur image, so that could be why you get less detail on his jawline.

    bicubic 2(4,8..)x + sharpen + downscale to screen could look very nice.

Leave a reply

Support Plex

Mmmmm...Beer!

Contact Me

elan at plexapp dot com
  • Meta

  • Recent Comments

    • Mickey"oops I am late :( Happy Thanksgiving Elan and everyone celebrating it! I make a toast to all the things done..."
    • sham"I installed plex 7.1 for the first time yesterday, being a long time htpc guy (done dev for freevo, mce xp, mce..."
    • Anton"Hi, Thanks for the app. I’ve switched from Sapphire, some things I love some thing I hate. Overall great..."
    • Jakob Metzger"ok, yea. I kinda figured that out. I noticed that it is exactly the same OSD as the regular iTunes..."
  • What I'm Doing...

  • Archives