PDA

View Full Version : rePal, my first plugin. Use: NTSC ->PAL IVTC


Bach
11th March 2003, 16:41
hi,

rePal is my first plugin, with almost 30% of the code stolen from neuron's decomb:). As the name already point to, it is usefull for a 30->25 IVTC conversion. It must be used in conjunction with a (smart)bob. It works deleting 7 frames from every group of 12 frames, in such way that only blended and/or repeated frames are decimated. It is very reliable when the source clip is known to be PAL telecined material (most of time this is known as 25fps->30fps conversion). Using this plugin you MAY achieve better results than telecide(guide=3).decimate(6), since the ghosting effect can be very decreased.

The usage is

#################################
LoadPlugin("rePal.dll")
AVISource("mixed.avi")
bob() ## it is much better to use a smartbob ;). If the result is not good, use complementparity() before. ##
repal()
#################################

(...) read more in the readme file.

ps: limitations: it was not tested in avisynth 2.5, and may not work with it and/or YUV12.

sh0dan
11th March 2003, 19:50
@Bach: Looks very good - I don't have any sources to test on myself - but they'll probably turn up. :)

Potential problems:
- Don't assume pitches are the same for all frames. Your findanchor loop assumes that pitch is the same for all the frames it recieves. This may however not be the case. So store the pitch along with the pointers to avoid any potential problems here.

Optimizations for your FindAnchor loop:
- Instead of /2 and /8, use bitshifting (>>1 and >>3 respectively). You cannot trust the compiler to do this as you work on signed ints. It is much faster - especially in inner loops. This can however only be used when the divisor is a power of 2. A clever compiler might however see that the entire line is a constant within the loop, and therefore calculate it before it enters the loop. However you should probably do this manually just to be sure.

- Instead of %8, use &7. Again much faster. Again only valid for divisors that are multiple of 2.

Boulder
14th March 2003, 13:15
Could you please port the filter to AVS2.5? It would be much appreciated, I've got some material I think this one will deal with extremely well.

sh0dan
14th March 2003, 18:16
Have you tried it? What happends if you do?

Boulder
14th March 2003, 19:39
@sh0dan: I just get an error message 'not an Avisynth 2.5 plugin' (if that's what you meant;) ) Maybe it's just not compiled properly?

Boulder
14th March 2003, 20:34
Originally posted by Bach
I said it in my first post. I have not used avs2.5 yet, simply because I am mainly a CCE user and, AFAIK, that mpeg encoder doesn´t take any advantage of those new features of avs2.5. I'm sorry.


Well, I think that there's no harm in using 2.5. It's very stable and I'd suppose you'll get a slight speedup even with CCE. Thanks for the plugin anyway, there are never too many conversion options available:)

mj0012
17th March 2003, 20:24
Bach,

Thanks for the filter; I've been looking for something like this for awhile now. I've got a large collection of DVDs from Hong Kong and a lot of them are telecined PAL -> NTSC conversions and they usually just look horrible on a computer monitor. So far it's worked great on everything I've tried it with; I'll let you know if I come across any clips that don't work so you can test them.

Chez_Wimpy
8th April 2003, 02:34
Fantastic job Bach! I was somewhat reluctant to try this due to my complete conversion over to 2.5, but seeing as I had some recent rare Hong Kong DVDs added to my collection (Ichi the Killer, Lily Chou-Chou), I gave it a shot. I found that using the smartbob option with the complementparity() function did the trick. The resulting framerate (24.975) can be slowed with AssumeFPS(24), making repal effectively refilm! Night and day.

I hope you are compelled to tune this plugin for 2.5, as I now consider it one of the essentials in my toolbox. From what I have seen, almost every music video shot in Europe is shot on film @ 25fps. The Cure video collection recently in stores in the US, is a good test disc for those who are curious.

Thanks again

-CTB

neuron2
8th April 2003, 03:38
I compiled it for Avisynth 2.5, but it does not support YV12. I haven't tested it so someone with an appropriate input clip please do so. :)

Chez_Wimpy
9th April 2003, 08:10
Works as before with the same input clip I was using. However, when I go to use the recomended "smartbob" script variety (which calls tomsmocomp, and smoothdeinterlace) it has some problems. Replacing those plugins with the 2.5 versions, it now seems something is being processed differently. The top of the final encoded image fluctuates in the first 2 or 3 lines, blinking in and out. I would suspect this is some weave-artifact. Also, somewhat curious, I notice now that clips that require the complementparity() line no longer need it, but for those that didn't, vice-versa: the repal encodes judder without the line. Something appears to have been flipped!

Like I said, the indicator seems to point to a difference in either the Smoothdeint or TomsMoComp 2.5 implementation.

neuron2
9th April 2003, 17:19
Thank you for the results, Chez_Wimpy. I don't have time to look into Smoothdeinterlacer or TomsMoComp in this regard. Perhaps the authors will comment.

encod3r
10th April 2003, 08:28
Excellent work, please keep up development. Best thing i've tried so far on this NTSC BBC mini-series i've been playing with!

gotaserena
19th April 2003, 23:04
I'd second that. This is the best thing for captures of sports events shot in Europe and broadcast in the U.S.

Hope that someone pick this up...

rcjc
22nd April 2003, 04:26
so how do you know when to complementparity() and when not to?
what kind of "bad" results are we looking for?

pr0nandy
2nd May 2003, 22:26
I've tried the plugin on a PAL -> NTSC converted vob. the results are great! Good work!

trbarry
3rd May 2003, 16:37
However, when I go to use the recomended "smartbob" script variety (which calls tomsmocomp, and smoothdeinterlace) it has some problems.

Sorry, I don't know what this is.

- Tom

pr0nandy
4th May 2003, 22:10
What about NTSC converted to PAL, will there be a plugin to covert it back to NTSC or get it progressive in some way?

scharfis_brain
4th May 2003, 22:30
IMO true interlaced(30i)/progressive(30p) NTSC will not be recoverable, because the field are mixed too much.
30 fields are mixed into 25 fields.

But I hope that someone can make a Filter, that can recover the progressive frames of this kind of conversion, which is very common (but not whished :( ) in Europe:
24p -> 30i (telecine) -> 50i (fieldblending)

Would this be possible?

dar1us
11th July 2003, 16:24
Where can I get the filter?


harrison

(dejavu?:))

Wilbert
11th July 2003, 16:35
www.geocities.com/wilbertdijkhof/repal.zip

dunno if it is the latest ...

dar1us
11th July 2003, 16:39
Cheers for both fast replies - were they originally attatched?!


harrison

dar1us
11th July 2003, 16:41
Hmm, it is only a 2.0x build. I cant built it to AVISynth 2.5. Grr:(.

Come one bach, there must be a storage of good versions somewhere?!


harrison

Wilbert
11th July 2003, 16:45
were they originally attatched?!
Probably a link. Does someone have a v2.5 version?

dar1us
11th July 2003, 16:52
neuron2 said that he built one without YV12 support - I am peskering him for a copy of such genious:)


harrison

Wilbert
13th July 2003, 14:22
Does someone have a v2.5 version?
Nobody?

mj0012
14th July 2003, 16:25
Here's the last version that Bach released:

repal.rar (http://briefcase.wt.net/bc/l/e/levitica/public/repal.rar)

It's compiled for AviSynth 2.5 and it has YV12 support. Enjoy.

M_Micky
18th August 2003, 07:05
Hello,

I tried last address for download of RePal for YV12 and I see only page with message "Message briefing". Can anybody serve the correct link for this tool?

Thank you

Wilbert
18th August 2003, 09:54
The link in one of the stickies:

http://www.avisynth.org/users/warpenterprises/

canuckerfan
18th April 2007, 00:16
is the one on warpent. the latest?

plugh
27th January 2008, 07:20
I'm a bit hesitant to post this, but what the hey...

The 'official' release was designed for 30Hz->25Hz

Here is a quick and dirty mod for 29.97Hz->25Hz

It satisfied my need; Your Mileage May Vary ;)

scharfis_brain
27th January 2008, 20:02
WOW! That is very interesting.
There always was the problem, that rePAL only was able to put out 24.975fps instead of 25fps.

Which are the changes you made to compensate for the 1000/1001 deviation?
How stable is it to still lock to the pattern?

plugh
27th January 2008, 20:54
After several versions / iterations the mod devolved into a very minor tweak. The extra frame is emitted 'outside' his state machine. If anything I'd say it helped the pattern lock, but then I've only tested with my one oddball DVD. Give it a whirl - turn on 'show' and watch behaviour at N*1001 vicinities.

FYI & FWIW - This mod is indirectly related to my 'numerical oddity' post in the other forum; tracking a cadence feature (repal's "anchor") is what led me to this mod.

scharfis_brain
27th January 2008, 21:04
so your mod equals to this script with the old version:

mpeg2source("NTSC.d2v") #29.97 fps
bob() #59.94 fps
changefps(60) #60.00 fps
repal() #25.00 fps

plugh
27th January 2008, 21:32
Don't know, as I don't know what cadence changefps would use - ie when / where does it insert the dup(s). The 'wrong' place could even cause his state machine anchor to shift.

I emit it at a time that is both procedurally convenient AND seems to 'mate' with his state machine ( useframe%2400==0 ). This is where the cadence error has accumulated to a significant amount, the cadence group size has increased to 13 (from 12), and his state machine always seems to end up choosing a frame 2 or 3 away from this point on BOTH sides (smooth motion) with it being emitted at that point. And this frame is never a blend, at all the points I've checked on my DVD (probably about a hundred or so). Like I said:

It satisfied my need; Your Mileage May Vary

enjoy :)

cheer
14th October 2008, 18:25
I presume it's still necessary to use a bob first, right? So:
MPEG2Source("blah.d2v") #29.97 fps
bob() #59.94 fps
repal() #25.00 fps

Is it still advisable to use a smart bobber instead of a dumb bob?

--c

45tripp
16th October 2008, 08:20
yes and yes

pmsf
14th May 2009, 23:09
I am trying to restore a 29.97 bluray back to 23.976, how can I setup repal? It seems repal only works for 30(29.97)-25 transfer?

~Revolution~
21st September 2009, 05:50
I am trying to restore a 29.97 bluray back to 23.976, how can I setup repal? It seems repal only works for 30(29.97)-25 transfer?

Umm just use IVTC. That's exactly what IVTC is supposed to do anyways :)

~Revolution~
21st September 2009, 05:53
RePAL works very well and a big thanks to plugh for doing the required modifications to go from 29.97 fps (telecine) -> 25 fps. Works flawlessly. Great work to everyone that added to this :) Thanks. :D