Xenoproctologist
24th October 2002, 04:12
Most raw anime source which leaves Japan is, unfortunately, blended telecined video. VirtualDub's "reconstruct from blurred fields - manual" works fairly well at restoring these to progressive source, so long as the telecining pattern holds steady and a scene change doesn't occur during a blurred frame.
Telecine pattern changes aren't much of a concern, as there are generally only one or two per episode, and I have no problem breaking an episode into two or three pieces to match the pattern. Scene changes are a bit more of a problem, as there is a 20-40% chance that any given scene change will occur on a blended frame. In the course of a 24 minute episode containing 100+ scenechanges, the number of single-frame splices gets more than a little tedious. These errors, however, do leave a rather distinctive signature: a single-frame-long drastic change in brightness.
In the end, I'm asking about the feasibility of this:
Notation:
[a|b|c|d|e] = Telecined NTSC
[A|B|C|D] = Progressive Film
a b c d e
AA AB BC CC DD
A = a
B = 2b-a = 2c-d = (2b+2c-a-d)/2
C = d
D = e
Really Clunky Pseudocode:
grab5frames(a,b,c,d,e);
bFirst = 2b-a;
bSecond = 2c-d;
if ( | bFirst-bSecond | > luma_threshold ) {
bFirst_luma_difference = | bFirst-A | + | bFirst-C |;
bSecond_luma_difference = | bSecond-A | + | bSecond-C |;
if (bFirst_luma_difference > bSecond_luma_difference) {
B = bSecond;
}
else {
B = bFirst;
}
}
else {
B = (bFirst+bSecond)/2;
}
return4frames(A,B,C,D);
I'd try to write it myself, if not for the fact that I really don't know C. I can modify some code if I spend four times as long looking at reference manuals as I do the actual code, but I can't write it from scratch.
So, at the risk of sounding utterly lame, anyone feel the inclination to take this anywhere? Is it worth taking anywhere?
Telecine pattern changes aren't much of a concern, as there are generally only one or two per episode, and I have no problem breaking an episode into two or three pieces to match the pattern. Scene changes are a bit more of a problem, as there is a 20-40% chance that any given scene change will occur on a blended frame. In the course of a 24 minute episode containing 100+ scenechanges, the number of single-frame splices gets more than a little tedious. These errors, however, do leave a rather distinctive signature: a single-frame-long drastic change in brightness.
In the end, I'm asking about the feasibility of this:
Notation:
[a|b|c|d|e] = Telecined NTSC
[A|B|C|D] = Progressive Film
a b c d e
AA AB BC CC DD
A = a
B = 2b-a = 2c-d = (2b+2c-a-d)/2
C = d
D = e
Really Clunky Pseudocode:
grab5frames(a,b,c,d,e);
bFirst = 2b-a;
bSecond = 2c-d;
if ( | bFirst-bSecond | > luma_threshold ) {
bFirst_luma_difference = | bFirst-A | + | bFirst-C |;
bSecond_luma_difference = | bSecond-A | + | bSecond-C |;
if (bFirst_luma_difference > bSecond_luma_difference) {
B = bSecond;
}
else {
B = bFirst;
}
}
else {
B = (bFirst+bSecond)/2;
}
return4frames(A,B,C,D);
I'd try to write it myself, if not for the fact that I really don't know C. I can modify some code if I spend four times as long looking at reference manuals as I do the actual code, but I can't write it from scratch.
So, at the risk of sounding utterly lame, anyone feel the inclination to take this anywhere? Is it worth taking anywhere?