Quantcast CQ vs. CQ_VBR ... Very Interesting... - Page 15 - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Avisynth Scripting

Reply
 
LinkBack Thread Tools
  #281  
12-31-2002, 02:50 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
My tests with beta-1 showed quite a serious impact on CQ level. With the old matrix I got 69.9, and with beta-1 I got 62.8. This will probably equate to more macroblocks. I also saw more Gibbs . Are my results really that out of whack with yours?
More tests have to be done. The screenshots above were done both with the same CQ value of 62.276. The file size for both samples is almost the same. I didn't use any noise filters. Just this:

Code:
LoadPlugin("C:\encoding\MPEG2DEC.dll")
LoadPlugin("C:\encoding\fluxsmooth.dll")
LoadPlugin("C:\encoding\legalclip.dll")
LoadPlugin("C:\encoding\sampler.dll")

Mpeg2Source("K:\K19\VIDEO_TS\k19.d2v")
LegalClip()
LanczosResize(496,336,8,0,704,480)
FluxSmooth()
AddBorders(16,72,16,72)
LegalClip()

#Sampler(length=24)
-kwag
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #282  
12-31-2002, 03:06 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
More tests have to be done. The screenshots above were done both with the same CQ value of 62.276. The file size for both samples is almost the same.
For my samples (528x480, no noise) the file size difference was about 2mb . Strange.
Reply With Quote
  #283  
12-31-2002, 03:35 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip

For my samples (528x480, no noise) the file size difference was about 2mb . Strange.
Maybe the material does make a difference
I'm currently encoding a sample of "The sum of all fears" with the BETA-1. I'll also encode the sample with the original matrix. I'll let you know how much difference there is.

-kwag
Reply With Quote
  #284  
12-31-2002, 03:44 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Maybe the material does make a difference
That's what I'm thinking. Resident Evil is very high-motion.
Reply With Quote
  #285  
12-31-2002, 04:16 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Here's what I'm doing to zero in on CQ value faster. The way I do it in CQ_VBR doesn't work correctly with CQ, and takes many many tries to hit the target. That is New_CQ_Value=(Wanted_Size/Sample_Size) * Current_CQ_Value
So this is what I do for CQ:
Run a sample session. Apply the formula above to correct CQ value. Note the new CQ value and run a second sample. Apply the formula again, and note the new CQ value correction . Then use New_CQ_Value (Last_CQ_Value + Current_CQ_Value ) / 2 ) and repeat.
This way I make less tries and hit the target faster

-kwag
Reply With Quote
  #286  
12-31-2002, 04:46 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
run a second sample
...with the new, corrected value?

Quote:
Apply the formula again, and note the new CQ value correction . Then use New_CQ_Value (Last_CQ_Value + Current_CQ_Value ) / 2 ) and repeat.
I'm not sure what you mean by "new", "last" and "current" here. Could you post an example?
Reply With Quote
  #287  
12-31-2002, 04:52 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Quote:
Originally Posted by kwag
run a second sample
...with the new, corrected value?

Quote:
Apply the formula again, and note the new CQ value correction . Then use New_CQ_Value (Last_CQ_Value + Current_CQ_Value ) / 2 ) and repeat.
I'm not sure what you mean by "new", "last" and "current" here. Could you post an example?
Just run a sample. Use the formula and get a CQ correction. Store that on left brain .
Run another sample, use formula to get new CQ value. Store that on right brain .
Now add both values and divide by 2. That's your new CQ value which is exactly between your last two CQ values. Next runs will be half of half of half, and you should get your target in 3 or 4 sample runs max.

-kwag
Reply With Quote
  #288  
12-31-2002, 05:16 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Just run a sample. Use the formula and get a CQ correction. Store that on left brain .
Run another sample, use formula to get new CQ value. Store that on right brain .
Now add both values and divide by 2.
Ahhhh... I was reading what you posted as "new CQ value multipled by ..." instead of "new CQ value equals ..." .
Reply With Quote
  #289  
12-31-2002, 05:22 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Ahhhh... I was reading what you posted as "new CQ value multipled by ..." instead of "new CQ value equals ..." .
*/+-
Reply With Quote
  #290  
12-31-2002, 11:24 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

I tried Crop using VirtualDub -->Video->Filters->Add->null transform
and then clicking the "Cropping button" to bring up the cropping screen.
This was even better than Tmpgenc. Then I used FitCD to resize,
get the TV-overscan and correct aspect ratio. It all worked GREAT!!!
Thanks for your help.

@Kwag,

Tried the file prediction formula for CQ and this time I achieved 0%
difference between test file and predicted file size in 4 passes.
This used to take 8 to 12 passes. Bless you Kwag I'm going
to wait until the Q-Matrix development is stable, so I used the
standard Q-Matrix for now. Seems you and SansGrip are still testing
and changing it.

-black prince
Reply With Quote
  #291  
01-01-2003, 07:00 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by black prince
I tried Crop using VirtualDub -->Video->Filters->Add->null transform and then clicking the "Cropping button" to bring up the cropping screen. This was even better than Tmpgenc. Then I used FitCD to resize, get the TV-overscan and correct aspect ratio. It all worked GREAT!!!
You're now doing it exactly how I do it . It's pretty easy, but I still wish FitCD could determine the borders automatically .
Reply With Quote
  #292  
01-01-2003, 08:11 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
but I still wish FitCD could determine the borders automatically .
Yeah! If just FitCD had a crop dialog like Vdub... That would be nice.
I'll search if I can find a delphi plugin that can read a dv2 file (or just extract some frames snapshots).
Reply With Quote
  #293  
01-01-2003, 08:33 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Yeah! If just FitCD had a crop dialog like Vdub... That would be nice.
If Delphi can call external DLLs it wouldn't be hard to write a DLL to open an Avisynth script (or AVI) and display a frame for cropping. Reading from a d2v would be harder.
Reply With Quote
  #294  
01-01-2003, 08:44 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
If Delphi can call external DLLs it wouldn't be hard to write a DLL to open an Avisynth script (or AVI) and display a frame for cropping. Reading from a d2v would be harder.
I guess delphi do can call external dlls! I just have to confirm that.
But it would be better if we can also do it from a d2v, cause that's what we usually use as the source file in FitCD.
Reply With Quote
  #295  
01-01-2003, 08:46 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
But it would be better if we can also do it from a d2v, cause that's what we usually use as the source file in FitCD.
I believe mpeg2dec can be called as a regular DLL, not just an Avisynth filter. If it can, reading d2v shouldn't be too difficult.
Reply With Quote
  #296  
01-01-2003, 09:40 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
I guess delphi do can call external dlls! I just have to confirm that.
If it can, try this with it. Everything you need should be in the zip; it's just a question of translating the C header into something Delphi can work with.

In C, I would call it like this:

Code:
CROPINFO ci;
DisplayCropDialog("the_file.avi", 1, &ci);
It doesn't matter what filename you put at the moment: it doesn't actually open any files. It just displays a message box (to let you know it worked) and then fills in the CROPINFO structure with pretend values:

ci.left = ci.right = 8
ci.top = ci.bottom = 16
ci.width = 704
ci.height = 448

So to test the DLL work out how to call it from the FitCD source then, on return, check the values in the structure match the above.

If you can get FitCD calling this DLL when a button is pressed, I'll make it actually do something .
Reply With Quote
  #297  
01-01-2003, 10:41 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
any solution or resolution for matrix,cq or cq vbr......???


something?

Reply With Quote
  #298  
01-01-2003, 11:01 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jorel
any solution or resolution for matrix,cq or cq vbr......???
Here's what I use, right now:

Old matrix (I find the new ones increase the file size too much )
New GOP
For LBR, CQ_VBR without noise
For 352x240 and 352x480, CQ_VBR with noise
For 528x480 and above, CQ without noise
Reply With Quote
  #299  
01-01-2003, 11:11 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Quote:
Originally Posted by jorel
any solution or resolution for matrix,cq or cq vbr......???
Here's what I use, right now:

Old matrix (I find the new ones increase the file size too much )
New GOP
For LBR, CQ_VBR without noise
For 352x240 and 352x480, CQ_VBR with noise
For 528x480 and above, CQ without noise
"Old matrix (I find the new ones increase the file size too much )"
"For LBR, CQ_VBR without noise"
yes i get the same result in tests.


thank you!
Reply With Quote
  #300  
01-01-2003, 11:19 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip

Old matrix (I find the new ones increase the file size too much )
New GOP
Hi SansGrip,

Even though the new matrix ( BETA-1 ) increases the file size, did you compare the quality produced to the old matrix, by adjusting the CQ to match file sizes on both encodes
At least on the tests I've made, the quality produced was slightly better on low light levels with the BETA-1 matrix. Did you notice that, or were your results different

-kwag
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Interesting results with YlevelsS supermule Avisynth Scripting 2 08-06-2006 11:59 PM
Avisynth: Interesting ASharp phenomenon... audioslave Avisynth Scripting 12 10-23-2003 06:36 AM
Interesting info about the Luminance Level in CCE digitalize Video Encoding and Conversion 0 04-28-2003 12:29 PM
A couple of interesting links.. kwag Off-topic Lounge 0 12-31-2002 03:47 PM
KVCD: Interesting poll found kwag Video Encoding and Conversion 2 12-31-2002 02:44 AM




 
All times are GMT -5. The time now is 07:14 PM  —  vBulletin © Jelsoft Enterprises Ltd