or Connect
AVS › AVS Forum › Blu-ray & HD DVD › HDTV Software Media Discussion › Video pre-processing
New Posts  All Forums:Forum Nav:

Video pre-processing - Page 6

post #151 of 212
Quote:
Originally Posted by Kram Sacul View Post

Why would downscaling 4k to 2k then cropping it be the best solution? What's wrong with just downscaling to HD res?

I think that route would end up with a sharper image than doing a fractional resize. See the examples from Mr.D above of a 2k resized to 1920x1080 versus cropped, 4k to 1920x1080 would have similar issues although less pronounced.

John
post #152 of 212
Quote:
Originally Posted by Joe Bloggs View Post

Thanks trbarry & John. It can get quite complicated some of this.

Also, the fact that they usually scan film at 2K - does that mean we don't usually get the full 1920x1080 resolution (ie. all the frequencies) even if the way they filmed it would allow maximum res, and that to get the full 1920x1080 +all frequencies you'd have to scan at at least 2x that width & height (eg. 4K) because of Nquist?

Seems to me, for 1920X1080 you're always getting the full format resolution. It's just that for 'artistically' camera-filtered and selectively focused productions the higher frequencies/resolutions lack enough contrast to be clearly resolved; they merge into shades of gray (for luma or B&W). The Nyquist limitations of sampled signals (cameras, telecines/scans) limit this resolvability, too. By contrast, non-sampled signals, like 1920X1080 test patterns (computers, generators) do provide full resolvability; (discussed here in more detail).

Downconversion to 1920X1080 from 2k or 4k tends to make images appear sharper because the contrast of lower and mid-range frequencies/resolutions are boosted. Pictures can thus appear sharp without offering significant fine detail. Figure 8 in an Arri pdf paper contrasts the resolution-vs-contrast graphs of higher-resolution and 'sharper' camera images. Fig. 22 in this Arri paper shows how even with a 10k film scan, multiple stages of processing greatly reduces the final resolution (multiplication of the various MTFs).

Determining what resolutions survive onto home screens with 4k transfers/downconversions to Blu-ray , such as King Kong, seems to require spectrum analysis to distinguish between sharpness from boosted mid-range and perhaps slightly higher frequencies. For example, does it 'jump' from, say a 800--1000-line guesstimate for typical Blu-rays to only 1200? As the film-camera photos (Fig. 6) in the Arri paper show, sharpness created by the boosted contrast of coarse details can easily be misinterpreted as higher resolution. The author (below Fig. 6) draws an interesting evolution comparison involving monkeys. -- John
post #153 of 212
Quote:
Originally Posted by JohnAd View Post

I think that route would end up with a sharper image than doing a fractional resize. See the examples from Mr.D above of a 2k resized to 1920x1080 versus cropped, 4k to 1920x1080 would have similar issues although less pronounced.

Proper resampling doesn't care at all about whether you scale by exactly 0.5 or maybe 0.500001. No difference at all in terms of image quality, as long as we're talking about true video content and not about computer type test patterns. What makes a difference is whether you scale once or twice, which scaling algorithm you're using, and whether you're scaling in linear light or gamma corrected light.

Which means: 2k resized to 1920x1080 is bad because 2k was already resized from the 4k master. So it's bad because you have scaled twice. If you go directly from 4k to 1920x1080, image quality should be identical to scaling 4k to 2k and then using cropping.
post #154 of 212
Quote:
Originally Posted by madshi View Post

Proper resampling doesn't care at all about whether you scale by exactly 0.5 or maybe 0.500001..

In theory maybe, in practice it does mattter, for practical algorithms scaling down by 1/2^n is more likely to produce an artifact free image.
post #155 of 212
Quote:
Originally Posted by JohnAd View Post

In theory maybe, in practice it does mattter, for practical algorithms scaling down by 1/2^n is more likely to produce an artifact free image.

That does not match my experience. Not with video type images when using reasonably good resampling algorithms.
post #156 of 212
Quote:
Originally Posted by madshi View Post

That does not match my experience. Not with video type images when using reasonably good resampling algorithms.

Fair enough, which resampling methods are you thinking of? I usually notice a slight uptick in quality when going through powers of 2, say around branches, hair etc.
post #157 of 212
Quote:
Originally Posted by JohnAd View Post

Fair enough, which resampling methods are you thinking of? I usually notice a slight uptick in quality when going through powers of 2, say around branches, hair etc.

I like Lanczos4 with some custom tweaks to avoid ringing. Do you happen to have a sample image flying around which shows this power of 2 effect clearly? I'd like to see if I can reproduce it. Thanks!
post #158 of 212
Quote:
Originally Posted by madshi View Post

I like Lanczos4 with some custom tweaks to avoid ringing. Do you happen to have a sample image flying around which shows this power of 2 effect clearly? I'd like to see if I can reproduce it. Thanks!

I'll have another play tomorrow and get an example together.

John
post #159 of 212
Great, maybe you're right and I just missed it until now...
post #160 of 212
Quote:
Originally Posted by Kram Sacul View Post

Why would downscaling 4k to 2k then cropping it be the best solution? What's wrong with just downscaling to HD res?

Downrezzing multiples prevents additional aliasing.

If you're working on an audio project with the intention of releasing a CD, it's the same theory. It's better to work at 44.1 kHz or 88.2 kHz rather than multiples of 48 kHz.
post #161 of 212
OK here is a quick test, this the original image, a crop from a Blu-ray



Here is same image resized by half using sinc3 in gimp not in linear light and then doubled with point scaling



now with slightly smaller than half



and a bit bigger than half



The bit more than a half and the exactly a half are quite close but I think the half one suffers from slightly less shapening and the detail degrades in more natural way. The less than half one is more obviously worse.

John
post #162 of 212
Interesting! Seems to me that Gimp is dropping the ball. Here's my own Lanczos4 implementation:

0.5:


0.5 - 1 pixel:


Your 0.5 image is sharper than any of mine. That's caused by the resampling filter you've chosen. "sinc" is even more agressive than "lanczos" (sharper, but also more ringing). So your 0.5 image is a tad sharper than my 0.5 image. However, my "less than half" image is noticeably sharper than your "less than half" image. I don't see any difference worth mentioning between my 2 images. Do you?

Please note that the resampling implementation I've used to produce these images is a simple one using gamma corrected light and integer math. My DirectShow video renderer uses float32 and (not yet, but soon) linear light scaling. So it should produce even better results, although the difference will probably be small...
post #163 of 212
Quote:
Originally Posted by madshi View Post

I don't see any difference worth mentioning between my 2 images. Do you?

It's small but say the shade of underside of the broom and the middle crane seem to change between the 2, again I find the half one closer to the original image.

Your downsampling looks pretty good though

John
post #164 of 212
Quote:
Originally Posted by JohnAd View Post

It's small but say the shade of underside of the broom and the middle crane seem to change between the 2, again I find the half one closer to the original image.

Hmmmmm... I'm trying (really), but I don't see it. Here are 2 more images:

Lanczos4 x0.5 -> Lanczos4 x2.0


Lanczos4 x0.5 - 1 pixel -> Lanczos4 + 1 pixel x2.0


Load them both in separate MSPaint instances (or browser tabs) and switch back and forth. I can't see a difference, can you? The 2nd image was scaled twice with fractional scaling factors while the 1st image was scaled twice with very clean scaling factors. Still both look virtually identical to me. Try that with Gimp, I think the result of the fractional scaling will be ugly.

Or compare this one to the original Blu-Ray crop:

Lanczos4 x2.0 - 1 pixel -> Lanczos4 + 1 pixel x0.5


I can't see a difference between this and the original. Again, my image was scaled twice with fractional scaling factors.

Quote:
Originally Posted by JohnAd View Post

Your downsampling looks pretty good though

Thanks! But it's really only a simple standard Lanczos4 implemention. No fancy special features, no tweaks, not even linear light scaling.
post #165 of 212
Quote:
Originally Posted by madshi View Post

Hmmmmm... I'm trying (really), but I don't see it.

We are not talking about big effects, it is 1 or 2 in RGB terms.

Quote:
Originally Posted by madshi View Post

Still both look virtually identical to me.

Again it's very slight but I see some of the tones of the fine structures change slightly, with color picker it's only 1 or 2 different but still different. Also I see there is quite a lot of ringing with your upscale, say along the back of the sweeper and a line under the broom.

Quote:
Originally Posted by madshi View Post

I can't see a difference between this and the original. Again, my image was scaled twice with fractional scaling factors.

agree they look very similar but upscaling then downscaling isn't what we're talking about as there is no information loss

Quote:
Originally Posted by madshi View Post

Thanks! But it's really only a simple standard Lanczos4 implemention. No fancy special features, no tweaks, not even linear light scaling.

I just meant it's nice to see you having it working well in your renderer.

John
post #166 of 212
Quote:
Originally Posted by JohnAd View Post

We are not talking about big effects, it is 1 or 2 in RGB terms.

Again it's very slight but I see some of the tones of the fine structures change slightly, with color picker it's only 1 or 2 different but still different.

Yeah, there are minimal (very minimal) differences. And there have to be, after all the scaling operation is different. But who decides which image is better? I have a hard time seeing the difference at all. I'd have an even harder time deciding whether the 0.5 is better or worse than the fractional one. Furthermore, given how small the differences are, with one sample image you may prefer 0.5x, and with another sample image you might prefer fractional scaling (or not). Looking at my own sample images I'm not convinced that fractional scaling is any worse than non-fractional scaling.

Based on the Gimp images I'd definitely agree with you, though. It just seems to me that Gimp's resampling engine is broken.

Quote:
Originally Posted by JohnAd View Post

Also I see there is quite a lot of ringing with your upscale, say along the back of the sweeper and a line under the broom.

True. Lanczos4 rings (a lot sometimes). I'm working on a tweaked implementation without ringing...
post #167 of 212
Quote:
Originally Posted by madshi View Post

Yeah, there are minimal (very minimal) differences. And there have to be, after all the scaling operation is different. But who decides which image is better?

Good question, I judge it on closeness to original, particularly in terms of visual weight between the elements and the similarity of colours. Personally I think test patterns are very useful in this context for highlighting issue with certain angles, frequencies etc.

Looking back to the first page for Stacey's demo of linear light scaling, I'm looking for similar kinds of thing. I'll be on the lookout for a better torture test image, that one isn't that helpful.

John
post #168 of 212
Quote:
Originally Posted by JohnAd View Post

Personally I think test patterns are very useful in this context for highlighting issue with certain angles, frequencies etc.

The problem with test patterns is that resampling algorithms simply don't work well with computer type data (1 pixel on/off stuff). Real photo/video stuff never contains such extreme contrast jumps. That's like trying to resample a pulse train in audio land. It's useful to draw some specific conclusions. But if I e.g. chose an audio resampling algorithm based on pulse train resampling results, I'd end up with real bad sounding real world audio...

Quote:
Originally Posted by JohnAd View Post

I'll be on the lookout for a better torture test image

Good samples for resampling are always welcome/helpful!!
post #169 of 212
Quote:
Originally Posted by madshi View Post

The problem with test patterns is that resampling algorithms simply don't work well with computer type data (1 pixel on/off stuff). Real photo/video stuff never contains such extreme contrast jumps.

I'm not saying use only test patterns, I'm saying that it can be useful to have extreme data to make stuff that's only just visible with normal video really stand out.

John
post #170 of 212
From the examples posted it seems it's not worth cropping the image for such microscopic differences.
post #171 of 212
Thread Starter 
I will post some sample images tomorrow, if I don't forget. I will post two frames from StEM. One is a test chart and the other will be a video frame. I no longer have the original 4k version, but I have the 2k (2048). I will post the full 2k frame, a 1920 crop and a 1920 resize.

I would post it tonight, but I archived the content to LTO-4 before formatting my RAID.
post #172 of 212
Quote:
Originally Posted by sspears View Post

I will post some sample images tomorrow, if I don't forget. I will post two frames from StEM. One is a test chart and the other will be a video frame. I no longer have the original 4k version, but I have the 2k (2048). I will post the full 2k frame, a 1920 crop and a 1920 resize.

Thanks! Of course it would have been great to have the 4k version, too, cause that would have allowed us to compare a direct 4k -> 1920 resize. But 2k and 1920 crop/resize images should make good test material, too.
post #173 of 212
Quote:
Originally Posted by Kram Sacul View Post

From the examples posted it seems it's not worth cropping the image for such microscopic differences.

My original point was more that in the context of the current process, some implementations of fractional rescale are not that good. Those who have seen both the 2k and the final blu-ray say there is a noticable difference in quality on some titles, particularly a loss of resolution that is bigger than can be explained by 4:2:0 and compression. I think I've shown above that a badly implemented <0.5 resize can produce a noticable blurring, it would be similar to the effect of the 0.928 resize that would be required for 2k to 1920. Similarly madshi has shown that with a well implemented resize it is barely noticable on a random image sample.

Based on that I'd still say that if by some magic I could reconfigure all the HD production chains with one simple request, under my personal trade-offs my rule would be would be crop the 2k to avoid a potentially poor resize. This is because for me the chance of loss of resolution beats a few extra safe area pixels. If by further magic we had full 4k chain for all films I'd still vote for .5 resize then crop, if only because again there is some chance that the fractional resize may be bad.

I'm not in any way suggesting that it is impossible to do the resize well, I'm just saying it is sufficently hard to do resize well that a number of implementations seem to give poor results at fractional factors.

Alternatively we could easily want to magically fix every resize implemetation but I suppose I was just restricting myself to certain kinds of magic power.

John
post #174 of 212
Quote:
Originally Posted by JohnAd View Post

My original point was more that in the context of the current process, some implementations on fractional rescale are not that good. Those who have seen both the 2k and the final blu-ray say there is a noticable difference in quality, particularly a loss of resolution that is bigger than can be explained by 4:2:0 and compression. I think I've shown above that a badly implemented <1.0 resize can produce a noticable blurring. Similarly madshi has shown that with a well implemented resize it is barely noticable on a random image sample.

Based on that I'd still say that if by some magic I could reconfigure all the HD production chains with one simple request, under my personal trade-offs my rule would be would be crop the 2k to avoid a potentially poor resize. This is because for me the chance of loss of resolution beats a few extra safe area pixels. If by further magic we had full 4k chain I'd still vote for .5 resize then crop, if only because again there is some chance that the fractional resize may be bad.

I'm not in any way suggesting that it is impossible to do the resize well, I'm just saying it is sufficently hard to do resize well that a number of implementations seem to give poor results at fractional factors.

Reasonable point of view, I can agree with that.
post #175 of 212
Thread Starter 
Here are two sample images. Both were captured on film and scanned at 6k. I am using the 2k 16-bit TIFF (2048x857) that was provided.

Here is what I did.

1. Added one line of black to the original and the crop to avoid scaling. xScaler forces an even number on output. If I did not pad black, it woud have scaled from 857 to 858.

2. I converted from PC levels to video levels. ie black went from 0 to 16.

3. As a side note, I originally used Skydrive, but it degraded the images, which was visible in the test pattern, so now I am hosting on my website. This means my original images may have been altered as well.

I am sorry this post will screw up the width of this page in the thread.

The first example set is a test chart that was captured.

2048x858 - Original


1920x858 - Cropped from the Original - Does not maintain original aspect ratio since I only cropped the sides.


1920x804 - Resized - This tries to maintain the original aspect ratio. I chose to round up to 804 instead of rounding down to 802.


1920x804 - Resized + Sharpen - This tries to maintain the original aspect ratio. I chose to round up to 804 instead of rounding down to 802.


The second example is a frame of video. I tried to find something with a lot of fine detail.

2048x858 - Original


1920x858 - Cropped from the Original - Does not maintain original aspect ratio since I only cropped the sides.


1920x804 - Resized - This tries to maintain the original aspect ratio. I chose to round up to 804 instead of rounding down to 802.


1920x804 - Resized + Sharpen - This tries to maintain the original aspect ratio. I chose to round up to 804 instead of rounding down to 802.
post #176 of 212
Intriguing images, not a big difference but definitely a little softer when resized, the wine bottle loses the slightest bit of HF, and you can see that more too in the way the light pinstripes in the two guys' suits darken in the resize.

But I would have to say that the more obvious difference is of course the AR change.

I don't really know how I feel about that, to be honest I think I am more concerned about the AR change frankly. I'm curious how others feel about that.
post #177 of 212
Thread Starter 
Quote:
definitely a little softer when resized

I just added a fourth image to both where I applied a little sharpening during the resize. I did not spend much time picking the sharpen value. I could apply more or less.
post #178 of 212
Quote:
Originally Posted by ChrisWiggles View Post

Intriguing images, not a big difference but definitely a little softer when resized, the wine bottle loses the slightest bit of HF, and you can see that more too in the way the light pinstripes in the two guys' suits darken in the resize.

But I would have to say that the more obvious difference is of course the AR change.

I don't really know how I feel about that, to be honest I think I am more concerned about the AR change frankly. I'm curious how others feel about that.

That sized crop is well within the tolerances of filmgates on lots of film equipment including the camera. Most films are cropped in slightly relative to the fullap film frame. I'm looking at a big budget film from one of the most respected directors working in film today.

The HD video rushes are a 1920x1080 crop from the 2k. The aspect ratio test slate for the film ( its rubbish and very innacurate as usual) is way more compromised than a 1920 crop from a plate.

Look at the Labrynth comparisson thread for more examples of varying film gate tolerances and HD extraction from 2k.
I for one am much happier wit the 1920 extraction from 2k rather than resize and that includes imagery I created.
I'd rather there was true 2ks worth of resolution than some mushed up image thats mistakenly trying to preserve some irrelevant bits of frame that the DP didn't see when he shot it, the editor didn't see when he cut it and no-one saw when it was projected in a theater.


Also bear in mind most people (including key personnel on the crew) never see the actual film scan in any meaningful way. They see it on video rushes or they see it written back to print and projected.
post #179 of 212
Thanks for the images, Stacey. I'm a bit torn. I think I prefer the cropping, but I'm not really sure.

One thing that I noticed is this in the 2K image:



Is this ringing coming from the 6K -> 2K downscale? Or is it even in the 6K master? Can't you use a downscaling algorithm which doesn't ring? E.g. Mitchell instead of Catmull-Rom?
post #180 of 212
Thread Starter 
They did a 6k to 4k downsample and that is what was provided to everyone. I am not sure if the 2k came from the 6k or 4k. I suspect it was the 4k.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: HDTV Software Media Discussion
AVS › AVS Forum › Blu-ray & HD DVD › HDTV Software Media Discussion › Video pre-processing