View Single Post
Old 5th June 2011, 14:10   #123  |  Link
NicolasRobidoux
Nicolas Robidoux
 
NicolasRobidoux's Avatar
 
Join Date: Mar 2011
Location: Montreal Canada
Posts: 269
There indeed seems to be some misunderstanding going on here.

First, my "I(t) should not make much difference" (yes, there was a typo, a missing "t") was an answer to henryho_hk 's question "Since EWA distort involves much more pixels than normal resizers, may I presume that there is a greater need to "linearize" the image beforehand?", which I understood as concerning the use of linear light.

In this context, I was not counting flops---flop-wise, an EWA method is definitely more expensive than a comparable separable method implemented accordingly---I was counting the raw number of values that are combined to get a single output value.

Let's compare, say, the typical number of pixels "averaged" to get an orthogonal Lanczos 2-lobes or Bicubic (Keys filtering or cubic B-Spline smoothing, say) filtered output value when downsampling by a factor of 2 in both directions, to the number required by Clampled EWA Robidoux of Jinc Lanczos 2.

Note also that I am filtering, not interpolating. If you are doing a 2:1 downscale by interpolating, you are begging for moire and jaggies. Not as much if you filter. So, generally, I don't recommend using interpolation in and by itself when downsampling. (Of course, you could low pass the original with, for example, box filtering, and then interpolate, but this is not what I'm comparing. I'm looking at using exactly one filter to do the downsampling. Please clarify if I am missing something.)

For simplicity, I'll consider an output pixel value located at the average of four nearby input pixel locations ("interlaced," kind of). I could also consider other locations, to get a typical value.

With the orthogonal versions, you are grabbing everything that falls strictly within a (2*4)x(2*4)=8x8 square centered at the output location. This is 64 pixel values.

With the EWA versions, you are grabbing everything that falls within a disk of radius 2*2=4 (actually, EWA Jinc Lanczos 2 extends slightly past radius 2; I'll ignore this for now; I like Robidoux more anyway). A little programming establishes that there are 52 such pixel locations.

Compare this to my earlier estimate:

52/64 = .81

4pi/16 = .79

Pretty close.

(Yes, I understand that I should consider other possible locations for the output pixel and average the counts. I need coffee.)

-----

P.S. It finally dawned on me what IPOPIP count is. I'll do THAT count in a future post.

Quote:
Originally Posted by *.mp4 guy View Post
Presumably you are talking about orthogonal linear interpolation as if it was carried out on a two dimensional area, This is not the case, As I believe was mentioned in reference to the superiority of ewa filters.

A 2 lobe orthogonal linear interpolator would typically require 7.5 total input pixel operations per input pixel (IPOPIP's) for a 2:1 downscale, as implemented by a separable filter, whereas it would take 25 IPOPIP's if implemented as a 2 dimensional filter. I cannot see how a viable 2 lobed interpolation kernel could be implemented with less then 7.5 IPOPIP's, though 25 IPOPIP's is an easily bested number.

Its possible I have misunderstood you due to differing conventions, but that's how it hashes out after everything is broken down into convolution operations.
...

Last edited by NicolasRobidoux; 5th June 2011 at 15:06.
NicolasRobidoux is offline   Reply With Quote