View Single Post
Old 27th April 2012, 11:26   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hi Jmac,

Cant look at it just now, I've really got to get some sleep (10:27 am right now), but can you seek out the
Gavino answer thread/post, I'll take a peek later.
Been up all night on a mod to the script, Added args:- bool "Chroma",Float "ChromaWeight",string "Title".
Also added a Debug mode (When c.FrameCount == f.FrameCount), all that it does is scan through the
clips logging difference between similar position frames with no searching, at the end of the log, it will
also print out the clip Average Difference, Minimum Difference and Maximum Difference.
Also, I now think that it may be better to downsize any eg hirez clip to the same size as a smaller
clip as the Clip average difference seem to be lower when doing that, I guess that upscaling a low
rez compressed clip would also play games with the already existing compression artefacts,
better to downscale, possibly quicker too. Anyway, that was the reason for implementing the
Debug mode, and also so I can experiment with eg Luma only Average Difference and also
Chroma Only Average difference. I think I've seen elsewhere, that weighting Chroma along with
Luma, Chroma is given a combined weight of 0.5 (U+V), maybe I'm wrong on that, and its actually
0.25 combined. Anyways been doing a couple of tests and got these results (for the same f and c clips):

Test 1: Upscale Lowres f clip
DEBUG: Average Diff = 3.408322 : MinDiff=1.437595 : MaxDiff=4.771824 # Lumaweight = 1.0 (Luma Only)
DEBUG: Average Diff = 0.706108 : MinDiff=0.075863 : MaxDiff=2.565223 # Chromaweight = 1.0 (Chroma Only)

Test 2: Downscale Hires c clip
DEBUG: Average Diff = 1.099017 : MinDiff=0.162313 : MaxDiff=5.715830 # Lumaweight = 1.0 (Luma Only)
DEBUG: Average Diff = 0.587522 : MinDiff=0.079203 : MaxDiff=2.198153 # Chromaweight = 1.0 (Chroma Only)

Note, when downscaling (This clip pair):
The ave diff of both luma & chroma goes down.
The min diff luma goes down & chroma goes up.
The max diff luma goes up & chroma goes down.

Dont know if anything sensible can be deduced from that, need more samples.

I'm tempted to do something like this:

ChromaWeight = ChromaAveDiff / (LumaAveDiff+ChromaAveDiff)

0.706108 / (3.408322 + 0.706108) = 0.171617453 # Upscale

0.587522 / (1.099017 + 0.587522) = 0.348359569 # Downscale

ie for

Upscale maybe suggests ChromaWeight = ~0.17 and LumaWeight= 1.0 - 0.17 == 0.83

Downscale maybe suggests ChromaWeight = ~0.35 and LumaWeight= 1.0 - 0.35 == 0.65

Could a generally good ChromaWeight be deduced from a greater sample set or is the above,
total twaddle? (Compression has got to mangle chroma to a greater extent than luma).

Any thoughts ?

EDIT: All resizing up/down using BilinearResize.
EDIT: Above clip pair, the hirez source was 1920x1080, Lowrez resize/compressed to 352x288 MPG Low bitRate (0.2 bits per pixel).
EDIT: Aspect ratio was not taken into account (352x288), lowest rez I felt comfortable converting to.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 25th May 2012 at 23:35.
StainlessS is offline   Reply With Quote