In this section of the guide, we will examine our footage to see if its interlaced, and discuss some specific types of interlacing and other problems that you might encounter.
For ease of reference, this page covers the following topics:
Just like the end of the last page, you should have an avisynth script loaded into VirtualDubMod and you should be able to see your dvd footage. Let's have a closer look at it...
If you have completely progressive footage (as seen in DGIndex) that after using Force FILM shows no interlacing at all (see the picture below for an example of interlacing) then you can be happy. If you have interlacing of any kind you will need to read through this page carefully so you can work out what to do with it.
Also, be aware that some openings and closings can have different results, so try using F6 from a point in the middle of an episode to find out the frame type in the middle of an episode.
When it comes to mpeg2 footage the Frame Type in DGIndex tells you whether the frame has been stored one frame at a time (Progressive encoding) or one field at a time (Interlaced encoding). However, that's just how the frame is being stored - when you look at it what you see may differ from the Frame Type.
You always need to check the Frame Type(s) reported by DGIndex when you did your F5 preview against what you can see by looking at the footage and seeing if it is actually interlaced or not. To check for interlacing in VirtualDubMod, scan through a part of the footage with movement and if you see any frames that look like two different frames weaved together with lots of horizontal lines then you have interlacing. It will probably look something like this:
This is interlacing, datchu. Note that only the moving parts appear interlaced.
Of course this sometimes confirms what the frame type was in DGIndex but some times does not, so let's compare the frame type and what you can see. There are 5 possible situations:
1) Definitely Progressive FILM. It says it's FILM (or at least 96% FILM) and when decoded with Force FILM you can't see any interlacing. Great, you have progressive 23.976fps footage. (It's possible with some movies that the main feature is progressive but studio bumpers are not - provided you don't need the studio bumpers this shouldn't be a problem).
2) Definitely interlaced. DGIndex tells you it has entirely interlace-encoded frames and sure enough they do contain interlacing and contain those tell-tale 'horizontal lines' in motion areas (see image above). You should use interlaced=true when doing colorspace conversions such as ConvertToRGB32(interlaced=true).
3) Progressive footage encoded as 'interlaced'. This is where you have footage which doesn't look like it has any interlacing at all but DGIndex has told you that every frame was encoded using Interlaced encoding. This means that the footage was encoded one field at a time even though both fields are part of the same frame. This isn't a problem, really - you can still encode and edit it progressively. This often happens with PAL encodes of movies, and its also common on OVAs (anime that was released straight to video rather than airing on tv). The only thing you need to be careful about is whether the chroma channel is sampled correctly when doing any colorspace conversions. Thankfully, it's rare for this to be necessary.
If you have situation 3 where the footage looks progressive in VirtualDubMod (no interlacing) but DGIndex said it was all interlaced then it is probably encoded one field at a time even though the fields are both from the same image. This isn't much of a problem but if you change the colorspace such as ConvertToRGB32() you might get something called bad chroma upsampling, which looks like this: (look closely at the edges)
It probably wont happen (it's a rare case) but it's good to know about it just in case as it can make things look much uglier than they should be. You can also try and fix this problem with the avisynth command FixBrokenChromaUpsampling()
The bad chroma (blockiness) has occurred because the frame was thought to be progressive when it was actually encoded as interlaced frames (or vice versa) and so the color samples are decoded incorrectly. Some DVD players suffer from this problem too. If you do see this problem it is most common when you do a colorspace change you will want to put "interlaced=true" inside the parenthesis such as:
[Note that SuperGals does not have this, I purposefully upsampled the chroma incorrectly to demonstrate - SuperGALS is an example of situation 5]
4) Interlaced footage encoded as progressive! This is where DGIndex tells you that the footage is entirely progressive but the footage isn't FILM at all - it's interlaced... you try using Force FILM but there's interlacing everywhere and the original FILM frames are not restored. This is bad as it probably means that whoever encoded the footage messed up their encoder settings. As you may know, DVD footage is stored in YV12 which takes one chroma (color) sample in a square of 4 pixels. If you have interlaced footage you need to encode one field at a time to avoid having a chroma channel which is the average of two different images because of the interlacing. When someone encodes an interlaced source with progressive encoding it really messes up the chroma of a frame as it is averaged between two different images and is a really bad thing. Unfortunately there's not much you can do to fix this - examples of this include the Manga Video release of Wings of Honneamise which is one of the worst anime dvd encodes ever. Thankfully examples of this are rare these days.
5) Switching between interlaced and progressive! If in DGIndex a source is switching between interlaced and progressive but is also being reported as completely FILM then don't worry - it's progressively encoded and Force FILM will restore the original frames. However, if it is switching and it's being reported as mostly NTSC then you have a hybrid dvd (just like the SuperGALS disc I'm using below) and this will need to be handled in a different way, as I will describe later. Hybrid sources have two forms, one is where you have mostly FILM and only some parts interlaced and the other where only some parts will be FILM. These will be discussed in more detail later. Remember that some sources that only have a very small about of interlaced footage (such as FILM 98%) can often have Force FILM used. Often but not always - so make sure you double check for interlaced frames in virtualdub when using this option. I have yet to see a hybrid PAL dvd but I suppose it could happen.
If you have situation 5, it is an interesting situation that will probably also affect any deinterlacing or IVTC you do later too. Essentially what you will get when decoding this is a scenario where some frames are interlaced (and encoded one field at a time) and some are progressive (encoded one frame at a time). If you are deinterlacing or using IVTC then this will not be a problem as all the footage will become progressive in the end.
If you keep your footage interlaced, however, this can cause problems because once you've passed the footage to avisynth it no longer knows if a frame is encoded as interlaced or as progressive. This means that if you then convert the footage to YUY2 or RGB, some of the frames will have bad chroma just like the image above. The way to avoid this is to ask dgdecode to give you correctly upsampled YUY2 footage by using the upconv=1 parameter in your MPEG2Source command as follows:
MPEG2Source("C:\yourfolder\yourprojectfile.d2v",upconv=1)This is the way you should decode footage if you intend to edit it interlaced.
Now you might be thinking "How the heck do I do that?" - well luckily I've included a little helper function in the AMVapp to help you - add this command to the end of your avisynth script in VirtualDubMod and press F5:
CheckFieldOrder()It won't show up in green as it's a custom function. It should work, though, and you should see something like this:
When you get this image, you may want to use the right arrow cursor key to scroll through the footage frame by frame. One of the images will have ordinary looking motion and the other one will jerk back and forth in a really obvious manner (note that both will have a little vertical jitter, but that's natural). The smooth one is the correct field order - Top Field First or Bottom Field First (some editing programs refer to this as Upper first or Lower first but it's the same idea).
This is important to know this because:
1) If you IVTC or deinterlace and you arent using DVDs with DGIndex, you will probably need to specify a field order.If for any reason you need to swap the Field Order of a source, you can by using the ADSwapFieldOrder() command. This is a very simple command that removes the top line and makes a duplicate of the bottom line in order to shift everything up one. There are also avisynth plugins that can do this too.
Remember that progressive footage does not have a field order - or rather it can be displayed as either top first or bottom first and it will never matter. Thankfully, because of this property of progressive footage, it is easy to mix progressive footage into a video containing interlaced footage with a field order. However, when editing only progressive footage you should disable field processing in your editing application (in Premiere and similar programs, set rendering to "no fields") otherwise you may find your effects and fades will be processed interlaced.
We aren't going to talk about how to remove the interlacing yet - this is just a description of the different types so you can know what kind of deinterlacing to do later. Read through them all and see which description best fits the interlacing in the source you have.
Pure interlacing can occur in both PAL and NTSC sources. This process involves taking full advantage of the 50 or 60 individual fields a second that are used in PAL and NTSC video to get the smoothest looking video possible when shown on a TV. If an anime is produced in pure NTSC then it is likely to be really difficult to cleanly remove the interlacing as there are fewer full frames to restore as there are lots of fields which have a unique image.
Many modern shows are completely digitally animated and so they sometimes take advantage of this feature. PAL also uses this feature a lot as the NTSC fields are sometimes decimated to PAL numbers and reweaved into a pure interlaced PAL stream. This makes original frames much harder to find. When faced with a pure interlaced source it is sometimes not worth looking for the original frames (which is what you do with Inverse Telecine filters) sometimes it's better to just completely deinterlace them.
Telecine and Pulldown Material
If you have footage that was cell animated (the old fashioned way, not computer aided) or you have a source that was made for the cinema then there's a good chance that the footage was produced at 24fps and has gone through a simple Telecine (3:2 Pulldown) process like the one described earlier in the theory guides. If you are really lucky, this process was clean and has no pure interlaced footage at all. This is a common process used to convert FILM to 29.97fps NTSC.
PAL footage can also use pulldown (2:2 pulldown) where either both fields will be from the same image to make one regular frame or there will be an offset so that the fields go ab bc cd de where a b c and d are different images, but frankly this method is pretty rare on PAL anime dvds (unfortunately)
Removing Telecine interlacing is called Inverse Telecine (IVTC) and is pretty easy to do in AviSynth. This will be explained in detail later.
Remember, this process will only work perfectly if you have a neat Telecined source. This is actually pretty rare these days as most sources are Hybrids.
These are sources that have a mixture of interlacing patterns. Some anime have a digitally edited opening sequence which is pure interlaced and then use a regular Telecine pattern during the episode itself. X TV and Azumanga Daioh both use this particular method. Some shows just use pure interlacing on scenes where they have added something digitally, like some CG or a title etc.. These are Hybrid sources and are the most common type for anime TV shows these days. You see, although they could make completely fluid animation at 60 fields per second it's a lot of effort. Even with computer animation the animators are too lazy to go into that much effort. Pans and other parts of animation that can be automatically created with computers are more likely to use all the fields for ultimate smoothness but there are many sections that will still be only 24, 12 or even 8 frames a second. Those parts can generally have their original frames restored.
Success in cleanly removing the interlacing in hybrid shows will depend largely on the amount of pure interlacing you have. If you don't have much, and most of the footage is a regular old-fashioned telecine then you can IVTC and your footage will be mostly pretty smooth. If you have mostly pure interlaced material you can either try full deinterlacing (smoother motion, not always as good picture quality) or you can try using IVTC in avisynth but smoothness of motion may be a problem in parts where pure interlacing has been used to make the motion smooth (digital pans etc.).
Full Field Blended Sources
These are the scourge of PAL anime DVDs. Admittedly it is difficult, in many cases, to return to the original progressive FILM source of a show to produce a PAL version like they do with regular movies. With movies, the original 24fps FILM is found, sped up, the audio processed to match and a progressive 25fps source produced. However, many anime shows were never designed for FILM (see Hybrid and Pure Interlaced) and others just don't have FILM prints around anymore. Unfortunately when converting to PAL they have to make a 25fps output and they have to do this without making the footage all jerky.
This generaly means they don't go around removing frames to make it 25fps. Instead, many production companies take the NTSC source and blend fields together in a pattern so that the effective fps is reduced from 29.97 to 25. This is very quick and convenient for the production studios but intensely irritating for an amv creator wanting a nice clean source to deal with. This is especially annoying when there is a perfectly good progressive master around and they have just not used it. You can look at the individual fields of your source in Avisynth by using the command SeparateFields() - if you have a full field blended source it will look something like this field from the Dutch rental version of Spirited Away, which is a blended field decimation of the Japanese release:
This is just one of the fields, not the whole frame. The whole frame together looks even worse, especially when you have two fields that are blended in succession from three or four different source fields. What irritates me most about this image is that I have the Japanese release and know that it is progressive and can use Force FILM on it. This means that I could have easily converted 24fps to 25fps, processed the audio to match and made a better PAL dvd than this Dutch production company... and these people get paid to do this. Cheapskates :P
This blending decimation causes many problems for interlace removal. If you deinterlace this footage, you will end up with blended frames which both look ugly and are hard to compress--but thats probably the best option you have. This can be very annoying for an editor using PAL sources as the majority of them use this technique. This is one of the reasons that despite living in the UK I only ever purchase NTSC anime sources from the USA, Japan, Hong Kong and Korea. NTSC sources have their problems too, but at least *most* of the problems of NTSC can be solved.
Restoring the original frames when you have a blended source is very difficult and although attempts have been made to try and correct this kind of source, nobody has yet come up with a completely successful way of doing so. There are two functions you might want to try, but don't expect fantastic results from them.
The first is Mrestore(). This function is designed to take 25 fps PAL field-blended footage, and convert it back to 23.976 fps. Before you use this script, you must first Bob the footage (converting each field into a seperate frame)
It is sometimes possible for NTSC footage to have full-field blended footage too, Sometimes this is produced when making a Telecine - being used as padding between regular frames. Luckily IVTC is pretty good at eliminating these provided all the original frames are there and the blends are just duplicates of frames that are also shown unblended. However, if there is an image which only exists as part of a blended frame then, like the PAL source, a deblending method would need to be used to try and restore the footage. You can try IVTC on this sort of footage but you may either have blended frames or jerky motion depending on the Decimation process you choose.
Partial Field Blended Source
Just when you thought that full field blended sources were the worst you could get, along comes something that takes it to the extreme. You see, when converting FILM sources to NTSC a studio would have to use a Telecine process and some Telecine processes are good and some are bad. The good ones are clean, tidy and can be IVTCed - the original frames can be constructed by sticking fields back together and everyone is happy. However, there are nasty ways of doing Telecine. One is the full field blending technique described at the end of the last section, which is bad enough but then there are two which are even worse than full field blending:
One Field, Two Halves of Two Images: The FILM footage is projected onto a screen and then sampled (a process which captures the scanlines in order) by another camera at 59.94 fields per second. This Telecines the material to the full 29.97 frames per second. This is ok except that sometimes when a field is being sampled the original projected frame changs from one image to the next halfway through sampling the field.! THe camera sampling this then ends up with a field where the top half of is from one image and the bottom half is from the next! The Avisynth filter PeculiarBlend() was written to remove this but to be honest it's not very common in anime sources... a more prevalent method is this...
Temporal Scanline Blending: The FILM is converted to NTSC using a telecine device that samples each new field by scanning down the image (if you imagine the light of a photocopier moving across a piece of paper you get an approximate idea of what happens even though I am simplifying). However, as the image being sampled changes, this causes the field being sampled to blend into the next image - this grows more and more as the sampling continues until finally the image has completely changed to the next one. This is the nastiest of the nasty Telecine methods and can be seen in every Gainax production from Otaku no Video to Kare Kano and in many more late 80s to late 90s anime. It's the reason Eva Renewal had to be made. What you get is fields that looks like this:
U-G-L-Y. If you look at field 1 you will notice that the blending of the two images only begins in the bottom half of the field and by the time you get to the bottom you are more in the second image than the first (see the guys foot on the right). This is the telecine device blending the scanlines more and more with time until they are in the next image and through to the next image then the next as the image is scanned.
This stuff is nigh impossible to recover at the moment. There are no tools available at our level which can deal with field blending like this, the best you can do is try IVTC and hope to god you don't get too many blends and that the motion smoothness isn't totally ruined. When making my Gunbuster video I had two IVTC patterns, one without blends that was jerky in panning shots and one with blends that was smooth in panning shots and I had to use the different sources for different parts of the video depending on the scene. It's nasty stuff - especially in pans where you can end up with an IVTC process giving you a scene with horizontal motion with the top half moving in one frame and the bottom half catching it up in the next frame. Evil.
There's only one thing worse than this kind of blended field Telecine - PAL anime which has converted this blended field Telecine to PAL by blending the fields even more! I haven't seen the PAL Evangelion print but from what I've heard it sounds like a mess.
OK, hopefully from these descriptions you will have a decent idea of the different interlacing methods and which is more likely to be used on your source. When I describe the different settings for interlacing removal you should keep these types in mind.