Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IVTC, Motion-Adaptive, DEFT (Avisynth)
#1
1. IVTC

The NTSC pulldown pattern (3:2) is a repeating of fields every 4 fields. The odd and even fields have their repeats at oposite times, for instance:

EVEN: 1, 2, 3, 4, 4.
ODD: 1, 2, 2, 3, 4.

This gives you three progressive frames, and two interlaced ones, and that pattern repeats.

In Avisynth you can use a simple function to recover the underlying 23.976p frames as so:

Code:
TFM(order=0)
TDecimate()

However, it can also be done manually. It's usually not desirable to do it manually, but it does help to understand how to do it nevertheless. One advantage of doing it this way is that you can find where edits were made in the stream that break the pattern.

Code:
converttoyv24()
separatefields()
fields_evn=selecteven()
fields_odd=selectodd()
fields_evn
fields_evn=interleave(selectevery(5,0), \
   selectevery(5,1), \
   average(selectevery(5,2),0.5,selectevery(5,3),0.5), \
   selectevery(5,4))
fields_odd
fields_odd=interleave(average(selectevery(5,0),0.5,selectevery(5,1),0.5), \
   selectevery(5,2), \
   selectevery(5,3), \
   selectevery(5,4))
interleave(fields_evn,fields_odd)
weave()
converttoyv12()

2. Motion-Adaptive.

Field-blended material. Some people have labelled these "improper conversions", which is unhelpful because it's not the case. If we assume that they were improper conversions, then we assume there's not a proper way to restore them to their original frame-rates. However understanding that they are a proper standards conversion allows us to find the best way to restore their original frame rate. One such method used is described in this patent. It worked by dropping about every 6th frame when going from NTSC to PAL, and by repeating or interpolating every 5th frame the other way.

Prior to the invention of the DEFT device in 1989 it was not possible to IVTC a NTSC telecine. Even after that no method could go from 30i to 25i without field blending. There was a method to go from 25i to 30i without blending, and that involved converting the video to film - developed by the BBC in the 1960's. That method threw away half of the video fields, converting 25i video to 16mm film @ 25fps. Besides the use of film-out as a go-between, if the standards conversion was done before DEFTs were invented your source will have intra-field blending. If it was done sometime in the 90's, there's still every chance they used a motion-adaptive method to go between formats. This is especially the case when going from PAL to NTSC. It is possible to create a 3:2 pulldown from a PAL source as well.

Sometimes you need to use AssumeTFF() or AssumeBFF() at the start of the scripts below to correct the input field order, as IcePrick has found.

2a. Good quality standards conversion

"scharfis_brain" on the Doom9 forums posted a method to remove the field blending. I improved upon the method.

Code:
separatefields()
PointResize(width(),height()*2)
interleave(selecteven().crop(0,2,0,0).addborders(0,0,0,2),selectodd())
interleave(repair(selecteven(),selectodd(),0,9,9),repair(selectodd(),selecteven(),0,9,9))
interleave(selecteven().crop(0,0,0,-2).addborders(0,2,0,0),selectodd())
crop(0,4,0,-4)
PointResize(width(),height()/2)
weave()
QTGMC(Preset="Placebo")
AssumeFPS(60000,1001)
Part1=trim(0,183056).FixBlend()
Part2=trim(183057,0).FixBlend()
Part1 ++ Part2
Function FixBlend(clip orig){
   orig.changefps(25*4,linear=false)
   selectevery(4,2)
   return last
}

That's just an example. You need to find the right value for FixBlend(try selectevery(4,0) ... (4,1) ... (4,2) ... (4,3) until you find the right value), and you can use whatever bob-deinterlace you want, however QTGMC is very good. The first part of the script does chroma correction - not perfect, but you will notice a significant improvement especially in high-contrast scenes, for quite little cost. The result will still contain ghosting in a number of frames, but should contain no blended frames. It needs to be called two or three times for a whole movie because Avisynth will loose sync eventually, no matter what.

This usually works if the source was done with a good standards converter. This is because the conversion usually runs the whole length of the original format tape at once, converting from NTSC to PAL (or vice versa) on the fly. This is also why the speed doesn't change - the only time the speed would change is if modified equipment was used to change either the playback speed or the recording speed. Although this is possible, after extensive testing on these sources I haven't yet seen one.

2b. Poorer quality standards conversion

If the pattern doesn't seem repeat itself, first confirm the original framerate. Use separatefields and count out the number of unique frames in the video over a length of 500 or so. This gives you the true framerate, so that when you use "changefps" you can use the correct value - if it still doesn't work, and you know the correct framerate, this is a poorer quality standards conversion and you need to use Srestore. Srestore doesn't like going to non-integer framerates, it's usually best to use assumefps first to change the framerate to a value that will allow the restored value to be a whole number. Of course, just like above you need to bob-deinterlace first.

Here's an example:

Code:
QTGMC(Preset="Placebo")
AssumeFPS(60)
srestore(frate=24,speed=-25)
AssumeFPS(24000,1001)

3. DEFT

The DEFT (Digital Electronic Film Transfer) device was the first device to be able to automatically identify duplicate fields and remove them whilst converting the video from 59.94Hz to 47.952Hz. The DEFT device won an Emmy award in 1994 - it was the best, by far, way to convert a NTSC telecine to PAL. In order to record the output onto a PAL tape, a modified recording device would be used that would record the tape at 47.952Hz instead of 50Hz. Here's a paper by the company that made the device, with an explanation of how standards conversions work. Essentially it's a device that IVTC's a NTSC telecine, it works pretty well, but it does leave behind a few problem fields throughout the output, and also pretty much all frames have some quite light combing due to individual filed resizing (and some frames have worse combing). There's a very very easy way to fix this:

Code:
QTGMC(Preset="Placebo",TR2=0,NoiseProcess=2,NoiseRestore=0,GrainRestore=0.5)
selecteven()

On those settings, it doesn't distort the output or lose detail, all the combing is fixed, and there will be no more interlaced frames. Tweak the 'Grainrestore' option from 0 to 1 as desired.
Reply
Thanks given by: spoRv
#2
(2015-06-22, 04:57 PM)Valeyard Wrote: The manual method can also be used for field-blended material, with the understanding that field-blending is generally the result of a DEFT conversion. Some people have labelled DEFTs "improper conversions", which is unhelpful because it's not the case. It was a standard thing done all the time.

Please understand, I'm not trying to be a smart-a**, but I have a problem with your statement. Just because something was a "standard thing done all the time," IMHO doesn't make it "proper." I am part of that group of people that call these conversions "improper." To me, a "proper" NTSC to PAL conversion is done via speed-up and "improper" would be by way of field blending. Field blending is destructive to the original material and is not an accurate representation of the original material. Personally, I look at it as an "eye-sore."

Another problem that I have with the statement, "standard thing done all the time," is that this could be said about all the "newschool" color re-grading that we see studios do with so many films that are released on BD. It's also a "standard" (maybe not "official" but it seems to be the "standard" with how often it happens) and there are many of "us" that look at this as an "improper" transfer as well, just like field-blended materialWink

Again, not trying to be an a**... just stating my opinion.
Reply
Thanks given by:
#3
As per the updated op, it wasn't possible to go from a NTSC telecine to PAL without frame-blending prior to the invention of the DEFT device (to my limited knowledge anyway). The PAL speed-up was NOT a result of standards conversion, it was the result of using a PAL telecine machine - the film is scanned, it's structure isn't changed, and the tape is intended to play at 50Hz instead of 48Hz resulting in the speed-up... at least that's my understanding. Some were better than others though, and the script that I posted above only works for good standards conversions. I've seen some that have a non-repeating pattern even within a single shot. You can still fully extract a progressive result if you're prepared to put in the effort - first run srestore and save the result. Then go through it and replace all the problem frames with frames from the de-interlaced source that you fed into srestore.

Of course - any questions with using the scripts above do post here.
Reply
Thanks given by:
#4
Hi Valeyard. I've used the Motion-Adaptive script above a few times, and it has generally yielded good results. However, I have a 1080i file that's particularly problematic. It's a film that's encoded at 29.97i but it definitely runs at PAL speed. Whatever variation of the script above I use, I always get missing frames and blended frames. So, am I supposed to use srestore here? I haven't quite figured out how to use it. Could you give me some tips?

EDIT: Okay, I think I've figured out what was wrong. AVISynth was using the wrong field order, which caused extremely jerky framerate. Putting in AssumeTFF() appears to have fixed it.
Reply
Thanks given by:
#5
I've just cleaned up the OP a bit.

Yes sometimes the input has the wrong field order set, I've found that a few times. Srestore should definitely be a last resort for anything with field-blending, but I have come across stuff that just can't be automated back to its frame rate any other way.
Reply
Thanks given by:


Forum Jump:


Users browsing this thread: 1 Guest(s)