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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 17th March 2005, 13:28   #21  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Didée
BTW, in case you want to get the average out of 8*8 blocks, the simplest way is to use Tom's DCTFilter() with
DCFilter(1,0,0,0,0,0,0,0)
And for U,V colors it makes only 4x4 pixel average (as there is half resolution)?

IDEA: how about for 2x2 average(separately for each color - e.g. Y)?
Code:
clip
FitY2U
UtoY
or it has same problem as just resize?

Last edited by redfordxx; 18th March 2005 at 00:02.
redfordxx is offline   Reply With Quote
Old 17th March 2005, 13:31   #22  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Didée
use Tom's DCTFilter() with
DCFilter(1,0,0,0,0,0,0,0)
Can you write the formula which is used here?
Can't remember what is (I)DC Transformation...
redfordxx is offline   Reply With Quote
Old 17th March 2005, 22:05   #23  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Didée
DCFilter(1,0,0,0,0,0,0,0)
Well, almost works...

almost means that some blocks look like:
Code:
22222222
22222222
22222222
11111111
11111111
22222222
22222222
22222222
1 or 2 represent different colors, 1 always little darker than 2.
redfordxx is offline   Reply With Quote
Old 17th March 2005, 23:55   #24  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,407
Aaaah ... yes, of course. DCTFilter(1,0,...) keeps the topmost line and leftmost row /*slaps forehead*/.

DCTFilterD(14) should do the job.
__________________
- 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 March 2005, 23:06   #25  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
So, if using YV12 colourspace then each 4 pixel block shares the same U and V data -yes?

So all thats needed is a 2x2 block averager of the Y plane - yes?

regards
Simon
Si is offline   Reply With Quote
Old 22nd March 2005, 00:09   #26  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Didée
Aaaah ... yes, of course. DCTFilter(1,0,...) keeps the topmost line and leftmost row /*slaps forehead*/.
DCTFilterD(14) should do the job.
Does not. Same result as that before --- 8x8 blocks with stripe in the middle as I described.
But, what is interesting:
Consequently I was experimenting with idct algo's using following script:
Code:
LoadPlugin("C:\PROGRA~1\MULTIM~1\GORDIA~1\AviSynthPlugins\MaskTools.dll")
LoadPlugin("C:\PROGRA~1\MULTIM~1\GORDIA~1\AviSynthPlugins\dgdecode121.dll")

r=mpeg2source("D:\record\rip\lotr tt\1\tt1new.d2v", CPU=0, iDCT=4) # iDCT=4 is "Reference", right?!
r=r.trim(0,5000).crop(4,76,712,424)
d1=mpeg2source("D:\record\rip\lotr tt\1\tt1new.d2v", CPU=0, iDCT=1)
d1=d1.trim(0,5000).crop(4,76,712,424)
d2=mpeg2source("D:\record\rip\lotr tt\1\tt1new.d2v", CPU=0, iDCT=2)
d2=d2.trim(0,5000).crop(4,76,712,424)
d3=mpeg2source("D:\record\rip\lotr tt\1\tt1new.d2v", CPU=0, iDCT=3)
d3=d3.trim(0,5000).crop(4,76,712,424)
d7=mpeg2source("D:\record\rip\lotr tt\1\tt1new.d2v", CPU=0, iDCT=7)
d7=d7.trim(0,5000).crop(4,76,712,424)
s1=YV12Subtract(r,d1,Y=3,U=3,V=3)
s2=YV12Subtract(r,d2,Y=3,U=3,V=3)
s3=YV12Subtract(r,d3,Y=3,U=3,V=3)
s7=YV12Subtract(r,d7,Y=3,U=3,V=3)
StackHorizontal(Stackvertical(s1,s3),Stackvertical(s2,s7)).ColorYUV(cont_y=2048,cont_u=2048,cont_v=2048)
The number 1 and 2 differed from 4=reference mostly in the shape I described. On the other hand, when 3 or 7 differed, it was always nice full blocks.

BTW: Although 4=reference, I tend to like 3 more...

Last edited by redfordxx; 22nd March 2005 at 00:14.
redfordxx is offline   Reply With Quote
Old 22nd March 2005, 00:12   #27  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Si
So, if using YV12 colourspace then each 4 pixel block shares the same U and V data -yes?

So all thats needed is a 2x2 block averager of the Y plane - yes?
Well I don't understand, whether this is inteded to be question or answer...
redfordxx is offline   Reply With Quote
Old 22nd March 2005, 19:13   #28  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
Its a question

I think what you want can be simply acheived by a simple average of the 4 bytes that make up the [EDIT] 2x2 [/EDIT] pixel block of a Y plane in a YV12 image.

But I didn't want to code it up if it wasn't that easy.

I'm not called Simple Si for nothing

regards
Simon

Last edited by Si; 27th March 2005 at 21:51.
Si is offline   Reply With Quote
Old 22nd March 2005, 19:25   #29  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Si
I think what you want can be simply acheived by a simple average of the 4 bytes that make up the 4x4 pixel block of a Y plane in a YV12 image.
Well, whatever plane you are speaking about...

... for this "simple average" I got many answers --- all wrong but the one by Didée: DEdgeMask
redfordxx is offline   Reply With Quote
Old 27th March 2005, 21:47   #30  |  Link
Si
Simply me
 
Si's Avatar
 
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
I finally knocked up a simple filter (BlockAverage) to see if this does what you originally expecting/wanted.



regards
Simon
Si is offline   Reply With Quote
Old 28th March 2005, 20:29   #31  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally posted by Si
I finally knocked up a simple filter
Well, I havent understood that you're gonna make a filter. Thanks and sorry for making you have effort... because I am already done with the method from Didée and I am averaging all planes 8x8 blocks.
redfordxx is offline   Reply With Quote
Reply


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 18:19.


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