View Single Post
Old 1st June 2008, 09:25   #1  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
AnimeIVTC() - All-in-one solution for interlacing and blending - v2.00 [2010-01-07]

Guide and v2 here. http://www.sendspace.com/file/jb3c3k Requirements package prepared by Overdrive80 - http://www.mediafire.com/?nydyyqqyqhq.

This function can also work with any other hard telecined, hybrid or field-blended source.

The thread was originally created after encountering multiple interlacing and blending related issues that were documented here and there, or simply too rare to be documented, but never all in the same place. Its purpose was to gather as many samples as possible and to converge discussions about them to eventually create a function that could deal with all the issues in an optimal and easy to use fashion. Pretentious? Maybe. Useful? Yes imo.

It is not as versatile as doing everything externally, as the goal is to make the ivtc/deinterlacing/deblending/decimation process as simple as possible, while still aiming at the best possible quality. Filter choices and available parameters are therefore arbitrary, but feel free to object and mention what you think is missing or wrong.

So, have fun, filter and post!

I'll leave the following for now, but it's meant to be replaced by a guide I've been promising to write for many many months...
# Particularities of anime:
- While a film is shot at 24 frames per second (fps), anime is animated at 24fps so there is not necessarily motion on every frame.
- When there is not a lot of movement, it can be displayed at lower framerates like 8 or 12 fps with duplicate(s) of every frame to maintain a constant framerate of 24fps.
- To create the illusion of faster movement, different parts of the image can move at different framerates. In this situation, the image is divided into 2 parts and there are many possible combinations of "intra-frame variable framerate". This is not constant throughout the episode/movie since it changes depending on the amount of motion to be displayed.
- CG animation at 30 fps is sometimes used in anime, so you can also have sequences with movement on every frame without any interlacing nor blends.
- The credits can be truly interlaced to make them run faster without being juddery and unreadable, thus leaving more room for the show.
- The credits can also be at the full progressive framerate on top of the telecined background.

# Basic concepts:
Soft telecine - the stream is encoded at 24 fps and the pulldown is applied during playback.
Hard telecine - your source was telecined before being encoded on the DVD (or before airing).
Double hard telecine - your source has at least one of the "intra-frame variable framerate" situations and the telecining was applied separately on each part of the frame, so the pattern is not constant and many frames are interlaced.
Field blended norm-conversion - Instead of going back to 24fps (film rate), the video streams are directly converted from NTSC (29.97fps) to PAL (25fps) or vice versa, creating ugly fieldblending (looks like DHT when inspecting a frame).
Hybrid - mix of 24t (24 fps displayed at 30 through telecining) and 30p (progressive movement on every frame)
Truly interlaced - each frame contains half the information of two frames, which means that you can bob it to 60p and see movement on every single frame, without any interlacing or blending.
Progressive - No interlacing whatsoever at the full framerate.
3:2 pattern - This pattern repeats itself from the very beginning to the very end of your clip: 3 progressive frames followed by 2 interlaced ones.
VFR - Variable Frame Rate - The sections of the clip run at different framerates, thus allowing to have less frames for the same movement. The duplicates are removed and played during the same amount of time as if there was the original amount of frames.
Lossless rendering pass - Save the file as uncompressed YV12 or Lagarith to apply the script only once and make subsequent filtering/encoding faster. It takes a lot of disk space: around 5GB for a 22 minutes clip @ 23.976fps with Lagarith and 20GB with uncompressed YV12.

# Examples:
Double Hard Telecine - At first, your source may look like a typical Hard Telecined one, but after a more thorough inspection, you'll see that it's actually a DHT one: same source, different high motion scene.
Interlaced on top of telecined (can be hard or double hard) - In this case, it was a hard telecined source. Image
Obviously, since there's no pattern in DHT and interlacing on every frame with pure interlaced material, regular IVTC will output blends and jerkiness.

- What it does:
- High quality adaptative field matching for hard telecine
- Bob, remove the blends and decimate back to the desired framerate for DHT/field-blended
- Creating a VFR clip for hybrid sources
- Bob the interlaced credits, blend-deinterlacing the background while doing minimal damage on the progressive credits, convert their framerate to match the episode's and splice them with it OR leave them @ 30p to create a VFR clip
- Very good combing removal and anti-aliasing functions (can be called externally as eediaa() daa() maa() or sharpaamcmod())
No AA // AA
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)

Last edited by thetoof; 14th January 2010 at 17:47. Reason: v2
thetoof is offline   Reply With Quote