Based on information I received from Nvidia I believe the Nvidia chain introduces a frame delay when doing double-rate deinterlacing. There's naught I can do about it.
After some head scratching I figured out what is going on with the broken frames. Avisynth does not guarantee that the chroma pitch is 1/2 of the luma pitch! But the VPP takes only one pitch value (the luma pitch) and uses 1/2 of it for the chroma.
I can adjust the pitches with internal copies but before doing that I have a query to nVidia to see if there is any better workaround. I want to get this fixed before addressing your other questions. Thanks for your patience.
You have to be careful with that deint test file. The source version I have of it is not truly interlaced content. It is actually progressive shifted by one field so that field matching cleans it right up. Can you check that with your source?
@hydra3333
Everything is the same with the delay for DGSource and PVBob. DGBob is not affected. I will look at working around it in PVBob.
You have to be careful with that deint test file. The source version I have of it is not truly interlaced content. It is actually progressive shifted by one field so that field matching cleans it right up. Can you check that with your source?
You are right! The source is indeed field shifted and has no information from a true second field for creating a double rate bobbed output. DGTelecide(mode=0) restores the progressive picture perfectly. I just got fooled by the combed look.
Don't feel bad about it. You have a lot of company and I too initially got fooled. All the tests based on this (and there are a lot) are just nonsense. I was shocked when I discovered this. We're trusting souls, aren't we? The stream is useful for testing upsizing algorithms (after matching it back to progressive) but not for bobbing algorithms.
I use a high-quality 1080i natural video called Cityscape that has a lot of edges and problematic scenes. I can upload it if you want it.
This is why I always ask for the source video when someone shows a comparison. If there is no source provided I just ignore the comparison. Sort of like an EPR experiment where they don't give you all the data (e.g., Hensen et al).
I did few more tests and found PVBob to be most similar to TDeint or LeakKernelBob. Could this be correct?
admin wrote:
I use a high-quality 1080i natural video called Cityscape that has a lot of edges and problematic scenes. I can upload it if you want it.
I would appreciate if you could upload the Cityscape testsource, thank you. My testfiles are mostly from my home videocamera and have their own deficiencies.
I haven't looked at the kernel bob stuff for years; I'll take a look at LeakKernelBob and report back. Is there a 64-bit version? As far as TDeint() is concerned, it depends on whether you use the edeint parameter and what you invoke with it. Feel free to post comparisons...with source video (or use Cityscape).
Initial results with LeakKernelBob are not stellar for me. E.g., it trashes the buildings at the beginning of Cityscape. It also has an overall softness that is to be expected from the convolution kernel. Nowadays, I'm also not too big on hard thresholds, even though I can be blamed for introducing that with Smart Deinterlace way back in the cave-man days of desktop video.
The typical mpeg2 artefacts are sometimes overruling (or masking) the deinterlacing/bobbing artefacts. But I agree the LeakKernel algorithm leaves more residual combing and swallows more details.
I was playing around trying to fix the VPP one-frame delay for bobbing and nothing was working but then I decided to try something off-the-wall and shockingly it worked to flush the VPP and fully correct random access:
// Frame is on GPU and everything configured at this point.
err = cuvidMapVideoFrame(cuDecoder, 0, &outPtr, &_pitch, &vpp);
if (err != CUDA_SUCCESS)
env->ThrowError("PVBob: could not run the VPP");
if (vpp.second_field == 1)
{
// This is found heuristically to solve the VPP one-frame delay problem.
cuvidUnmapVideoFrame(cuDecoder, outPtr);
vpp.second_field = 0;
err = cuvidMapVideoFrame(cuDecoder, 0, &outPtr, &_pitch, &vpp);
if (err != CUDA_SUCCESS)
env->ThrowError("PVBob: could not run the VPP");
}
// Postprocessed frame gets copied back to CPU at this point.
I also found a way to reduce the GPU<-->CPU traffic, increasing the frame rate by 50fps for 1920x1080. I'll regression test a bit and then slip-stream it. I will look into applying this fix to DGIndexNV and DGSource(deinterlace=2). It's not clear that it can be applied directly.
admin wrote:I was playing around trying to fix the VPP one-frame delay for bobbing and nothing was working but then I decided to try something off-the-wall and shockingly it worked to flush the VPP and fully correct random access.
I also found a way to reduce the GPU<-->CPU traffic, increasing the frame rate by 50fps for 1920x1080. I'll regression test a bit and then slip-stream it. I will look into applying this fix to DGIndexNV and DGSource(deinterlace=2). It's not clear that it can be applied directly.
Seems like I have a blackout, but how can I IVTC a 59.94 telecined 25fps source using DGTelecide() and DGDecimate() such as to get the 25.00 fps progressive source back?
(I think the 59.94 telecined material is 3:2:3:2:2 telecined)
dgsource("C:\Users\Don\Downloads\ma_30i.dgi")
dgtelecide()
dgdecimate(cycle=6,keep=5) # makes 24.975 fps
assumefps(25)
The stream has no audio, so I could not assess whether the 24.975 vs. 25 will be an issue. Worst case, you may need to shrink the audio a bit, or leave it at 24.975 if your target format accepts that.
Thanks! I came to the exactly same conclusion with my experiments, but I thought I might have missed something. So there is no "direct route" for IVTCing this by field matching plus m by n decimation to hit the 25.00fps
Actually, it is not a real problem. I just bumped across it when I converted a 25p (deinterlaced mpeg2 PAL 25i home video) to 29.97i using good old DGPulldown, and encoding it to AVC (x264). When inspecting the hard-telecined alternating 3p-3c-3p-3c ... and 4p-2c-4p-2c... pattern every about 100 frames (p=clear, c=combed frame) I wondered how the heck to IVTC this properly.