View Full Version : ***Formula to guess the Decimate cycle***
bilu
20th January 2004, 19:50
Have a look:
http://forum.doom9.org/showthread.php?s=&postid=431541#post431541
This could be very neat for weird patterns like silent movies :)
c= combed frame number
fc = former combed frame number
bfc = before former frame number
if (fc=c-1 OR fc=bfc+1) then cycle=c-bfc
Example 1: Telecine (cycle=5)
=============================
ABBCDEFFGH
ABCDDEFGHH
ppccpppccp (p=progressive c=combed)
frames before combed:
ccppp fc=bfc+1
cpppc fc=c-1
cycle=c-bfc=5
Example 2: PAL2NTSC (cycle=6)
=============================
aka 2:2:3:2:3 pulldown
ABCCDEFGHHIJ
ABCDEEFGHIJJ
pppccppppccp (p=progressive c=combed)
frames before combed:
ccpppp fc=bfc+1
cppppc fc=c-1
cycle=c-bfc=6
New version: IF (fc=c-1 OR fc=bfc+1) THEN cycle=c-bfc ELSE cycle=c-fc (version able to deal with cycle=3)
Bilu
bilu
21st January 2004, 00:36
Last version doesn't work on patterns like this:
3000130001
AABCDE -> ABCDEE
ABCDEE ABCDEE
AABCDEFFGHIJ
ABCDEEFGHIJJ
pccccppccccp
c ppccc fc=c-1 AND fc=bfc+1 -> cycle=2
c cppcc fc=c-1 AND fc=bfc+1 -> cycle=2
c ccppc fc=c-1 -> cycle=4
c cccpp -> cycle=3
Working on a new one...
Bilu
bilu
21st January 2004, 01:21
Consider these patterns:
23012301 -> cycle 5
ABBCDEFFGH
ABCDDEFGHH
ppccpppccp
30013001 -> cycle 5
AABCDEEFGH
ABCDDEFGHH
pcccppcccp
3131 -> cycle 3
AABCCD
ABBCDD
pcppcp
p=progressive
c=combed
Safest way to define a pattern cycle? The longest distance between progressive or interlaced frames + 1 (if cycle>3) or +0 (cycle=3).
Assuming:
p=progressive
fp=former progressive
c=combed
fc=former combed
pat=(c-fc > p-fp) 1:0
off_c=((pat==1) && (c-fc==3))? 0:1
off_p=((pat==0) && (p-fp==3))? 0:1
cycle=(pat=1)? (c-fc)+off_c:(p-fp)+off_p
Now every pattern, no matter how weird it is, gets detected :)
Bilu
bilu
21st January 2004, 15:22
Small correction:
p=progressive
fp=former progressive
c=combed
fc=former combed
pat=(c-fc > p-fp) 1:0
off_c=((pat==1) && (c-fc<4))? 0:1
off_p=((pat==0) && (p-fp<4))? 0:1
cycle=(pat=1)? (c-fc)+off_c:(p-fp)+off_p
Now able to deal with cycle=2 and cycle=1 (duh!).
Pretty nice for stuff like a Neo Genesis clip I have:
A B C
A AC C
AC is a blended field from A and C, B is an orphan field. So its combed at every 2 frames.
The purpose of this stuff is statistical, to help you make decisions over what you can do with weird streams.
Bilu
Mug Funky
22nd January 2004, 08:41
nice work... i'd like to bump this because i don't have any sources that choke with simple telecide default (good telecine must be a PAL thing :P)
bilu
22nd January 2004, 18:31
This is mostly useful to:
1) Identify Video and Film parts on hybrid streams;
2) Identify PAL to NTSC conversions made with the 2:2:3:2:3 process;
3) Identify large patterns with silent movies;
As you can see in http://www.doom9.org/ivtc-tut.htm "SILENT FILMS", you have streams with multiple Telecine patterns one over another, and you have to Decimate more than one time. Maybe this can help too in those cases, at least the composed pattern shall repeat itself :rolleyes:
Bilu
scharfis_brain
22nd January 2004, 19:45
decimate(6) will restore PAL from 2:2:3:2:3 Pulldown, but the resulting
framerate is 24.975 fps instead of 25fps, due to the 30.00 <-> 29.97 issue. This means every 1000th frame of the PAL-Video will be dropped.
a decimate cycle of 2997/497 (6.03018108651) is needed. Unfortunately decimate doesn't support float-cycles...
is there any way to get true 25fps without using change/assumefps afterwards?
bilu
23rd January 2004, 14:31
I don't know anything else related to 2:2:3:2:3 pulldown beyond Telecide(guide=3).Decimate(6) :confused:
And since you are deconstructing a specific method, you'd be safer this way IMHO.
Bilu
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.