Log in

View Full Version : 16-bit color improvement


papilio
29th August 2007, 11:04
I'm considering dropping from 24 to 16-bit color in an effort to reduce video file-size. What filters might be available for VD or AviSynth to perhaps convolute the color patterns a bit to make the distinct color bands less noticeable? (Without hurting image detail very much or at all.) I'm currently using YUY2 or YV12.

Thanks,

--Michael

Sharktooth
29th August 2007, 12:15
YV12 uses 12 bits...

noclip
1st September 2007, 04:56
YV12 uses 12 bits...

YV12 is technically still 24 bits. It's storing one 8-bit pixel of chroma information for every four pixels of 8-bit luma information so it is effectively 8/4 = 2 bits per (chroma) channel, giving you a total of 8+2+2 bits per pixel, but there are still 256^3 possible color values. With 16 bits you're actually throwing away a channel to get only 256^2 possible color values.

To answer the question, using 16-bits is indeed a good compromise between size and quality.

Mug Funky
1st September 2007, 06:28
i think there's a way to use floyd-steinberg dither in virtualdub when it's displaying 16-bit colour when going from yuv to rgb.

you could screengrab that i suppose.

that aside, i remember paintshop pro could do it, but i don't think photoshop can.

you could also just add some noise in avisynth before truncating to 16 bits.

papilio
1st September 2007, 08:08
Thanks everyone! Very illuminating stuff --and boy do I need illumination!

I found noclip's reply to be especially interesting and informative.

And Meg, I'll give floyd-steinberg dither a try -- although my original video source *is* a screen capture (Fraps -- amazing, virtually lossless as far a I can tell) so this is all really an exercise in reducing those 4GB/20 second clips (I'm capturing a 24-inch 1920-pix screen) into something which will hopefully become a video with a bitrate low enough to play smoothly even on much slower, more common machines.

At reduced size, of course -- I'm sure I'll end up changing to 720p for that, though *that* certainly is a pathetic image compared to full screen at 1080p! Which I'm producing mainly for myself I suppose, though with more learning maybe I could end up Blu-Raying it.? I'm doing a Google Earth tour of Peru -- Nazca Plains, then flying in right down the landing strip in Cuzco, finally on to the Inca trail and Machu Picchu. Cruising seemingly inches over the ridges of the Andes is quite a rush!)

As far as PaintShopPro, Meg, is the suggestion to decompile and then batch process each frame? Which is fine -- no hurry here. So if that's what you meant, great -- I use PSP a *lot* and love it -- in comparison I hate Photoshop! Just one thing -- any tips on exactly which filter(s) to use? Or just adding noise might be a pretty good way to go. The lower color depth is truly only apparent on the larger, smooth regions. No sense of it at all on the jungle patches. What strikes me as being of come concern is the introduction of of temporal noise.

It seems at this point that I'm finally getting close to what I'd consider success, but there remains a necessity for a good deal more improvement.

Just had another thought -- would de-blocking the image/colors be any help?

Thanks again, and keep the lessons coming, please!

-- Michael

foxyshadis
1st September 2007, 10:16
Reducing bits per channel will never give you anything substantial outside uncompressed and lossless, and most of the time it will only significantly reduce quality. Then no matter what you input, it all gets transformed into YV12 anyway (or YV16, YV24, RGB24/32 with a few specialized codecs). You get the same lossy artifacts, compounded with glaring banding or dithering, and it's never worth it.

With lossy video, the first step is to resize it, then denoise until you reach a equilibrium between blurry and artifacty (in the final encode). Less detail usually compresses better, but there are limits. You might need to go even smaller than 720p, it's not too hard to test various sizes on a 30-second clip. View them fullscreen and see which is the best balance between detail and artifacts.

Deblocking is rarely useful for fraps, but if you see 8x8 blocking, give it a shot. You can't pre-process away deblocks that show up in the encode, though.

An important question is how are you going to view this? Is it with a media center PC, a DVD, or some divx hardware player? For the latter two, you have to pre-process everything, but with a PC you have a number of options to enhance playback, like sharpening, noise removal, noise/deband, and sharper resizing. (Usually you only get to pick a couple before you run out of CPU.)

Didée
1st September 2007, 12:15
@ papillo

You need to give a better overview of what exactly your're trying to do or to achieve.

In this thread, "in an effort to reduce video file-size" doesn't even make clear if you refer to the raw captures or the final result, nor what the final result might be.

Moreover, there are three threads which all seem to be related to this project of yours:

- "16-bit color improvement" (this thread)
- "Re-encoding HuffYUV? (http://forum.doom9.org/showthread.php?t=129362)"
- "Belated reply to Dark Shikari (http://forum.doom9.org/showthread.php?t=129291)"

Each thread contains a fraction of the problems your dealing with.
None of them gives the 'whole picture'.
Each of them is filled with misconceptions of some sort.

Re-think your strategy of getting help. We can give you answers on isolated questions, sure. But even if the answers themselves are fully correct, they might be wrong as anything when seen in the full context of what you are doing.

Example: You might get some good answers here about good ways to reduce RGB24 to RGB565...
However, if your goal is to create some mpeg-compressed video files, then you should stay away from this kind of color reduction as far as you only can.