Log in

View Full Version : After DepanInterleave, how do I only process "real frames?


ianken
10th May 2007, 09:20
I'm using FFT3DGPU with depanestimate/interleave

I only want to use FFT3DGPU on the "real" frames, not the generated frames.

Fizick
10th May 2007, 15:27
your question is too short und unclear.

script?

ianken
11th May 2007, 05:34
Sorry, it was late and I was tired.

DepanInterleave by defualt triples the number of frames. By removing the SelectEvery() call I can see that FFT3D is being applied to all frames, not just the "real" frames.

I'd like to limit the calls of FFT3DGPU to only process the "real" frames.

Script (source is telecined 720p content):

mpeg2source("e:\convert\src.d2v")

Tdecimate( CycleR=3, Cycle=5)
crop(8,8,-8,-8).AddBorders(8,8,8,8)

motion = DepanEstimate(fftw=true)
DepanInterleave(data=motion)
FFT3dGPU(sigma=1.25,bt=3,plane=0,mode=1,degrid=1,precision=1)
SelectEvery(3,1)

AVIL
11th May 2007, 07:03
Hi,

AFAIK it is not possible. If your main concern is performance, I think there is no solution. If your target is to reuse depaninterleave result, you can store it in an intermedian variable.

Good luck

ianken
11th May 2007, 07:22
Hi,

AFAIK it is not possible. If your main concern is performance, I think there is no solution. If your target is to reuse depaninterleave result, you can store it in an intermedian variable.

Good luck

I suspected as much but wasn't sure. I think the FFT3D filter itself would need to support that.

foxyshadis
11th May 2007, 08:08
Well, this is important to how the filter works. The fft filters (and most temporal filters) work far better if given aligned frames, which Depan generates. You can put the fft3d after the selectevery, but by doing so you've just eliminated the entire usefulness of depan, because you could just as easily skip them and apply it directly for the same result!

If you bench fft3d with and without selectevery, you'll see that it still runs a little faster with it, just because some things are done to the target frame that don't need to be done to the wing frames.

Didée
11th May 2007, 09:00
@ ianken & AVIL - it's not that way. Those "wing frames" (nice denomination, foxy!;)) created by depaninterleave are not processed by fft3d.
Avisynth is evaluating the filterchain backwards. Loosely speaking, the chain requests frame x from fft3d, but feeds it with a clip where frame x has different neighbor frames. And before fft3d would start to process the extra frames, they're removed again by selectevery.

The story changes if you put a 2nd filter between fft3d, even if it's a very simple one. E.g., if you do

DepanInterleave()
FFT3dGPU() .RemoveGrain(1)
SelectEvery(3,1)

in this case, fft3d in fact has to process all extra frames, because of the request of the second filter.

foxyshadis
11th May 2007, 11:06
DepanInterleave()
FFT3dGPU() .RemoveGrain(1)
SelectEvery(3,1)

in this case, fft3d in fact has to process all extra frames, because of the request of the second filter.

Only if it was a temporal filter! So change your RemoveGrain to DegrainMedian and yes. =p

AVIL
11th May 2007, 13:02
@Didée

Every day I learn a new thing. Thanks.

Fizick
11th May 2007, 16:21
It is not new thing.

foxyshadis is correct here.
I remember AI posted about it too.

Alain2
11th May 2007, 19:20
@ ianken & AVIL - it's not that way. Those "wing frames" (nice denomination, foxy!;)) created by depaninterleave are not processed by fft3d.
Avisynth is evaluating the filterchain backwards. Loosely speaking, the chain requests frame x from fft3d, but feeds it with a clip where frame x has different neighbor frames. And before fft3d would start to process the extra frames, they're removed again by selectevery.

The story changes if you put a 2nd filter between fft3d, even if it's a very simple one. E.g., if you do

DepanInterleave()
FFT3dGPU() .RemoveGrain(1)
SelectEvery(3,1)

in this case, fft3d in fact has to process all extra frames, because of the request of the second filter.
I don't understand.. I thought the way it was processed was:

When last requests frame n, selectevery requests frames 3n+1 to fft3dGPU, and this one needs (for the default bt=3) [(3n+1)-1], [3n+1] and [(3n+1)+1] from depaninterleave to do its temporal filtering, ie uses the wing frames from depaninterleave...

So that's not the case ? Please can you expand a bit on what the frames calls are then ? Thanks :)

Didée
11th May 2007, 20:18
When last requests frame n, selectevery requests frames 3n+1 to fft3dGPU, and this one needs (for the default bt=3) [(3n+1)-1], [3n+1] and [(3n+1)+1] from depaninterleave to do its temporal filtering, ie uses the wing frames from depaninterleave.
You're fully right, it's exactly like that. The keyword is "uses": When fft3d is processing frame 3n+1, then it's using the wing frames to do so. The wing frames are used, but they are not processed (i.e.: not filtered) by themselves. That's what ianken's original issue was - he thought that all the extra frames would be processed by fft3d, too, and that CPU cycles would go down the drain because fft3d would process (->filter) frames which later will be thrown away. Which is not the case.