Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th March 2003, 13:43   #1  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
PFR - Progressive Frame Restorer

I've finally ported my Progressive Framer Restorer to Avisynth.

It's useful (well I use it anyway ) for trying to restore film originated material thats had special effects added, converted to 30 fps NTSC, sent across the water, converted to PAL 25fps, broadcast and then captured.

[EDIT]Revised V1.0a (corrects silly NPThresh default value )[/EDIT] available here

regards
Simon

Last edited by Si; 30th March 2003 at 18:04.
Si is offline   Reply With Quote
Old 11th April 2003, 23:21   #2  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
V1.1 available

[EDIT]V1.1a[/EDIT] available here

Its now been fully converted to properly use the Avisynth enviroment.

regards

Simon

Last edited by Si; 13th April 2003 at 01:09.
Si is offline   Reply With Quote
Old 12th April 2003, 03:51   #3  |  Link
^^-+I4004+-^^
Banned
 
^^-+I4004+-^^'s Avatar
 
Join Date: Aug 2002
Location: Croatia [local name:Hrvatska]
Posts: 551
is this an exampe of that concept of yours to
restore progr. if possible (or better,to put fields
where and when they belong),and to make video
TFF for tv-out (matrox..hehe) if impossible?

hmmm,wouldn't work for me,as tv-tool
didn't make my bt869 to output interlaced
stuff as it should
(i get random field order problems_jerks back forth
from time to time....no,it's not the source...)

i think 2%(or less) people use tv-out to display
interlaced,but your concept is good in teh way
it tries to preserve both progr. and interlaced...
(you didn't put some deinterlacer behind it,right?)
^^-+I4004+-^^ is offline   Reply With Quote
Old 12th April 2003, 08:48   #4  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
Quote:
i think 2%(or less) people use tv-out to display
interlaced,but your concept is good in the way
it tries to preserve both progr. and interlaced
You're probably right but I use it nowadays to make SVCDs and it would work equally well for producing DVDs as well.

It might actually give acceptable results for those watching (not single stepping) a programme on a progressive display using Xvid/DivX but YMMV

Quote:
(you didn't put some deinterlacer behind it,right?)
Sort of - no deinterlacing done except when changing from one processing mode to the other one.

regards
Simon
Si is offline   Reply With Quote
Old 12th April 2003, 18:58   #5  |  Link
sapient
Unbeliever
 
Join Date: Sep 2002
Location: Greece
Posts: 111
Hi,

Do i have to use "Convert to YUY2" before using this filter? Or will it do it itself?
sapient is offline   Reply With Quote
Old 12th April 2003, 22:25   #6  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
Yes -I'm afraid so if your source isn't YUY2.

Are you looking for it to handle YV12 or RGB?

regards
Simon
Si is offline   Reply With Quote
Old 13th April 2003, 20:44   #7  |  Link
sapient
Unbeliever
 
Join Date: Sep 2002
Location: Greece
Posts: 111
YV12. Standard DVD. It seems it might do a good job on all those PAL Star Trek and X-Files DVDs
sapient is offline   Reply With Quote
Old 13th April 2003, 22:01   #8  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
I'll get on with it then

regards
Simon
Si is offline   Reply With Quote
Old 24th April 2003, 23:57   #9  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
V1.2 available here

Now works with YV12 as well as YUY2 colourspace

I consider the YV12 code as alpha at the moment as I simply keep the U and V information from the current frame regardless of whether the filter decides to use the Y info from the bottom field of the current or previous frame.

This might be good/right or it might be bad/wrong - time will tell

Any comments/bug reports welcomed.

regards

Simon
Si is offline   Reply With Quote
Old 25th April 2003, 00:20   #10  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Quote:
Originally posted by siwalters

This might be good/right or it might be bad/wrong - time will tell
It's bad and wrong.

Why would you do that? May I point you to Telecide.cpp to see how to do it good and right?

Last edited by Guest; 25th April 2003 at 00:23.
Guest is offline   Reply With Quote
Old 25th April 2003, 00:52   #11  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
Quote:
Why would you do that?
Because it was the easiest solution and I wanted to actually get a YV12 version out to see how it performs with people using it on proper YV12 sources (not just me testing it with a ConvertToYV12 before it.)

AFAICT there are a number of issues such as was the source treated as interlaced or progressive when it was MPEGed and therefore does the 1st U/V plane line contain info about Y plane lines 1 or 2 or 1 and 3 etc

So my brain was hurting and it looked OK on my setup so I decided to publish and be dammed (which you've so kindly done

regards

Simon
Si is offline   Reply With Quote
Old 25th April 2003, 04:40   #12  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
You'll be mixing chroma from one picture with the luma of a different picture in some cases, won't you?

It seems to me that it doesn't matter which chroma sampling scheme was used. Putting matching fields back together fixes up the frame either way.

Interestingly, examination of the MPEG syntax for DVD VOB rips shows almost invariably that they are encoded with chroma_420_type set to 0, which means interlaced sampling. This is true even for 3:2 material. I don't have any PAL DVDs to look at. It makes sense because DVD players did interlaced upsampling (prior to more intelligent upsampling approaches based on the flags).

I agree that YV12 can get very confusing. I mean just think what happens when you SeparateFields() on a YV12 progressive sampled clip. The chroma assignments get mangled. But if you Weave() things get OK again. I think that may be the key to your dilemma.

OK, where did I go wrong?

Last edited by Guest; 25th April 2003 at 04:43.
Guest is offline   Reply With Quote
Old 27th April 2003, 19:40   #13  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
V1.3 available here

Now swaps the UV data from bottom field as well as Y (as per Obiwan Graft's request/suggestion/demand -I'm not going to own up to design errors next time )

I also changed/corrected the logo exclusion region co-ords to make them refer to pixel positions and not bytes along a line

If anyone (apart from me) actually uses the filter - please feel free to send me any comments here, PM or email me direct.

regards

Simon
Si is offline   Reply With Quote
Old 3rd August 2003, 23:47   #14  |  Link
sapient
Unbeliever
 
Join Date: Sep 2002
Location: Greece
Posts: 111
I finally found some time to try it out properly. It seems to me that pfr() does not simply rearrange fields to recover progressive frames.

I tried it with a short test sequence, taken from a pal clip, transformed from a mixed film&video NTSC source in the usual way that produces blended fields.
Any obviously blended fields seem to have magically disappeared...

What does pfr() do exactly anyway?

sapient
sapient is offline   Reply With Quote
Old 4th August 2003, 10:52   #15  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
PFR (like other De-combers) trys to restore original progressive material thats ended up being split over 2 frames.

It decides whether to pass a frame through untouched or whether the top field of the current frame should be matched instead with the bottom field of the previous frame.

The filter works on TFF material.

BUT on a transition from from processing state to the other, it does a simple interpolation of the bottom field from the top field so that any errors in making descisions are hopefully masked.

These interpolated frames only last for a few frames and are less visually disturbing than getting fields in the wrong temporal order when watching the output on a TV via an SVCD or DVD encoded disc.

So if your blended fields are bottom ones - then the blends will dissapear occasionally.

I recommend trying the filter with the diagnostic settings enabled to see what is happening.

I'd recommend PFR(ShowShift=16) and a quick read of the filters web page on what the colours all mean.

Let me know if any of this is confusing - its a very simple filter really.

Then - name the polish required (inside joke from another place)

regards

Simon
Si is offline   Reply With Quote
Old 4th August 2003, 12:31   #16  |  Link
sapient
Unbeliever
 
Join Date: Sep 2002
Location: Greece
Posts: 111
The problem is that this "interpolation" effectively cuts vertical resolution to half. And in bad PAL material from mixed NTSC, pfr keeps switching form one mode to the other, resulting in LOTS of... orange (i.e. interpolation).

So I would be looking for a polish color that would tone down all that orange

Also some damn post deinterlacing for the rest of us who like to watch on their monitors would be welcome.
You might have noticed my frustration in the matter in another thread.

sapient
sapient is offline   Reply With Quote
Old 4th August 2003, 17:25   #17  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
Just so you know - I'm more into DS9 and Voyager which don't have anywhere near as much mixed 30fps video in them but change field order every other scene change.

But back to your problem, the interpolation isn't complusory

Try using NPPIF=0 to switch off interpolation when my filter thinks the video is progresssive. This is completely non-destructive and maybe should be the default.

And then try using PNPIF=0 if you want to completely switch off any interpolation.

Setting PNPIF to 0 has the most adverse effect if my filter picks the wrong pair of fields and you are watching on an TV. You end up with the wrong field order being output which is very very bad

I'm pretty certain that Telecide is the filter of choice to use if you are watching on a progressive display.

I'm thinking of implementing Telecide type hints so that KernelDeint can be used as a post processor but I've not come up with a good strategy on when to drop a hint

Anyway - try the 0 interpolation settings or maybe try using 1 instead of 0 and see what you think.

regards
Simon
Si is offline   Reply With Quote
Old 4th August 2003, 18:04   #18  |  Link
sapient
Unbeliever
 
Join Date: Sep 2002
Location: Greece
Posts: 111
He waves his wand and ...ta-da... the blended fields re-appear...
Thanks for the hint.

As you SHOULD have read in another post of mine int that "other place" telecide is not an option for these clips, it always gets the field order horribly wrong.

As for star trek, I am actually testing this with something different for the momment (the making of animatrix). The point is though that the problems with both this one and TNG DVDs are not so much in the video part as in the film part! Since there is so much video, the "brilliant" guys at paramount used the famous blending technique of reducing the framerate throughout the movie/episode, WITHOUT first aplying some IVTC on the film parts!
The results as you can imagine or probably see for yourself are horrible, where they could have been almost perfect.
The same goes for most making-of featurettes, like the one I am using.
sapient is offline   Reply With Quote
Old 5th August 2003, 09:37   #19  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
...

And the best part is, those guys expect us to pay (a lot of) money for that technical crap!!

Actually, if you live in PAL country, and want to have a near-clean, localized version of any Star Trek stuff, you have to
- get the NTSC version
- get your very localized PAL version
- build everything together by your own hands!

I fear my English skills leave me here, to describe my disappointment, frustration and anger about this topic.

Grrr!

- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 13th August 2003, 01:32   #20  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
PFR 1.4 with postprocessing available

PFR 1.4 with postprocessing is now available here using neuron2's inter-filter hinting system.

I've added a parameter called EnablePP (true/false - default false).

This enables you to use KernelDeint instead of the internal field interpolation.

regards
Simon
Si is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.