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 18th August 2008, 12:16   #21  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
I just updated Deblock_QED_MT2 on the wiki.
__________________
- 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 18th September 2008, 21:22   #22  |  Link
Avenger007
Bruce Wayne
 
Join Date: Dec 2007
Posts: 283
Quote:
Originally Posted by Didée View Post
The only correct way for interlaced sources is: (alas)

Code:
SeparateFields() .PointResize(width,height)
Deblock_qed() .AssumeFrameBased()
SeparateFields() .SelectEvery(4,0,3) .Weave()
Should it be
Code:
SeparateFields().PointResize(width,height)
Deblock_qed().AssumeFrameBased()
SeparateFields().SelectOdd().Weave()
The fields line-up perfectly for my source when doing it this way.
Avenger007 is offline   Reply With Quote
Old 18th September 2008, 22:35   #23  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Nope.

My code was wrong (or: incautious). In fact it works only for BFF interlaced sources, it fails for TFF.

Your code is wrong, too. It works only for TFF interlaced sources, it fails for BFF.


That post was made in a rush (I remember), and forgot about the fact that AssumeFrameBased() resets clip parity to BFF always, no matter the input.

The correct way is (of course)

Code:
i = last
i.SeparateFields() .PointResize(i.width,i.height)
AssumeFrameBased() .Deblock_qed()
GetParity(i) ? AssumeTFF() : AssumeBFF()
SeparateFields() .SelectEvery(4,0,3) .Weave()
__________________
- 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 19th September 2008, 09:32   #24  |  Link
Avenger007
Bruce Wayne
 
Join Date: Dec 2007
Posts: 283
All correct.
Avenger007 is offline   Reply With Quote
Old 19th September 2008, 10:15   #25  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Didée View Post
My code was wrong (or: incautious). In fact it works only for BFF interlaced sources, it fails for TFF.

Your code is wrong, too. It works only for TFF interlaced sources, it fails for BFF.
I think Avenger007's code works for BFF and fails for TFF just as yours did - because of the PointResize, aren't the two versions equivalent? I think in this context SelectOdd() and SelectEvery(4,0,3) happen to have the same result.
Gavino is offline   Reply With Quote
Old 19th September 2008, 10:19   #26  |  Link
Avenger007
Bruce Wayne
 
Join Date: Dec 2007
Posts: 283
No, my source is TFF.
In this case, SelectOdd() is equivalent to SelectEvery(4,1,3) (i.e. select frames 1 and 3 within every 4 frames, ).
Avenger007 is offline   Reply With Quote
Old 19th September 2008, 10:56   #27  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
I may be wrong, but my point was that because of the PointResize, you have pairs of identical lines. So my thinking was that after the second SeparateFields, in each group of 4, frames 0 and 1 would be identical, as would frames 2 and 3.
Gavino is offline   Reply With Quote
Old 21st September 2008, 19:47   #28  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Gavino View Post
I may be wrong, but my point was that because of the PointResize, you have pairs of identical lines. So my thinking was that after the second SeparateFields, in each group of 4, frames 0 and 1 would be identical, as would frames 2 and 3.
Correct at the entrance, but not at the exit.

Look at a block sniplet after pointresizing one field:

Code:
...
...
A4t
A4b
   B1t
   B1b
   B2t
   B2b
   B3t
   B3b
   B4t
   B4b
C1t
C1b
...
...
That's the "input" block, and surely, all "XXt" and "XXb" pixel pairs are identical.
The clue is that we're not only juggling fields around forth and then back again - funnily, we're doing some processing inbetween.

This block now gets processed by the deblocker. After that, we're SelectX()'ing-out the fields again. Now look at the pattern: at the top of block B, we want to get pixel B1t, because that pixel was processed with a pixel from block A as neighbor. We don't want pixel B1b, because this pixel was not in block A's direct neighborhood during processing.
At the bottom of block B it's the other way round: we want pixel B4b, since it was in C's neighborhood. We don't want B4t, because it wasn't.

Summary: we want B1t and B4b.

With SelectEven or SelectOdd, you get either B1t and B4t, or B1b and B4b. One is always wrong.


After deblocking, the formerly identical pairs can not be considered identical anymore, easy as that. Generally this would affect any deblocking filter when using SeperateFields.Pointresize as input, though it probably wouldn't be a major issue with most ones.

But for Deblock_QED in particular, it is extremely important to choose the 'correct' t/b lines, because of it's "borderline-vs-interiour of a block" distinction.
In effect, SelectEven/Odd() would lose almost half of the vertical deblocking work completely, because it would output "borderline" pixels that have been processed while they've been "interiour" pixels.
__________________
- 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!)

Last edited by Didée; 21st September 2008 at 19:49.
Didée is offline   Reply With Quote
Old 22nd September 2008, 00:19   #29  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Didée - Thanks for your (as usual) clear and informative explanation.
Quote:
Originally Posted by Didée View Post
With SelectEven or SelectOdd, you get either B1t and B4t, or B1b and B4b. One is always wrong.
Indeed. What had me confused was that Avenger007 said SelectOdd worked for him, and you appeared to agree that it worked (though only for TFF).
Gavino is offline   Reply With Quote
Old 22nd September 2008, 01:06   #30  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Both of the "wrong" versions would produce field-swapped output when fed with the non-fitting fieldorder. Field-swapped output is utterly wrong, and very obvious.
Agreeing that it "worked" for TFF was in respect to not produce faulty things like swapped fields (note that in #22, the issue reported to be "solved" was field alignment), not in respect to full deblocking efficiency.
(Didn't adress that in #23, since my hope was that just posting the always-correct version would let me get away without having to dive into all the bothersome little details.)
__________________
- 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 19th December 2012, 17:00   #31  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
I suppose this should be used to also deblock progressive content that is encoded as interlaced?
Gser is offline   Reply With Quote
Old 19th December 2012, 17:34   #32  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,340
Quote:
Originally Posted by Gser View Post
I suppose this should be used to also deblock progressive content that is encoded as interlaced?
You can treat progressive content as progressive (as long as the decoder treats it as progressive)
poisondeathray 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 05:17.


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