Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th April 2009, 00:22 | #1 | Link |
Registered User
Join Date: Jul 2005
Posts: 30
|
Shifting Histograms
Hi,
Recently I was comparing codecs for the 100th time, and I made a surprise discovery. Some codecs shift the entire histograms of image up or down by 1-2%. Xvid and Ffdshow (trying several compressions) both exhibited clear histogram shifting. X264 and Morgan Multimedia Mj2k held the histograms in place. I was wondering if this is well known? I expect lossy compression to lose image detail, but not to make entire red, green or blue channels lighter/darker. Cheers, A |
21st April 2009, 20:05 | #2 | Link |
Derek Prestegard IRL
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
|
You sure you're decoding the outputs correctly? The TV / PC levels issue is pretty well known and causes lots of issues.
~MiSfit
__________________
These are all my personal statements, not those of my employer :) |
22nd April 2009, 00:30 | #3 | Link | |
Registered User
Join Date: Jul 2005
Posts: 30
|
Quote:
My first guess would be that there is truncation instead of rounding going on in calculations that consistently shifts all values in some direction. |
|
24th April 2009, 16:54 | #4 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
|
|
30th April 2009, 21:08 | #5 | Link | |
Registered User
Join Date: Jul 2005
Posts: 30
|
Quote:
Thanks, A |
|
30th April 2009, 22:02 | #6 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Like Ben said. Have a look at: http://avisynth.org/mediawiki/Colorimetry
|
4th May 2009, 06:04 | #7 | Link |
Registered User
Join Date: Jul 2005
Posts: 30
|
I did some more controlled testing. Using only VirtualDub, I encoded a sample clip and then decoded it. To test the YUV conversions that were occurring inside the codecs, I set VirtualDub to output RGB24 to codecs during encoding, and to request RGB24 from codecs when decoding. The histogram shifting reappeared, in contrast to tests that directly encoded/decoded YV12 instead, where there was no shifting.
Morgan MJPEG2K, X264, and Lagarith (YV12 mode) all had no histogram shifting. Xvid made all three RGB channels 1% darker or so. Ffdshow Mjpg made the Red channel 1% darker or so, the Blue channel a much smaller about darker, maybe 0.2%. To make sure this wasn't a 601/709 issue, I repeated the tests on a solid 50% gray frame. The same shifting still occurs. I iterated the procedure for Xvid and Ffdshow, and the shifting accumulates. Xvid frames get darker with each iteration. Ffdshow frames turn green/cyan. After five iterations, the differences are very clear to the naked eye. If anybody else cares to try these simple tests, I'd love to hear if they get similar results. Regards, A |
|
|