digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   CQ vs. CQ_VBR ... VERY INTERESTING... (http://www.digitalfaq.com/archives/avisynth/1910-cq-vs-cqvbr.html)

black prince 12-29-2002 10:43 AM

Hey Kwag,

Sorry about Divx. :( Seems jorel was the one to malign Divx. :?

-black prince

kwag 12-29-2002 11:02 AM

Hey guys, I like DivX too :D. The compression techniques used on it are beyond MPEG-1 and MPEG-2. It's just that it's not as handy as MPEG-1 or MPEG-2, because not every (Only one!) DVD player can play them. Only the "KISS" DVD player supports MPEG-4, and they're probably having a hard time trying to keep up with firmware patches and upgrades to support every MPEG-4 combination out there and keep the users happy :roll:

-kwag

kwag 12-29-2002 11:09 AM

Quote:

Originally Posted by SansGrip
At the moment for me it's looking like CQ mode is better for high resolutions, provided by "better" you mean "less Gibbs" and not "fewer blocks". Perhaps the reason we're getting less Gibbs is because it's essentially ignoring that Blockbuster noise we're adding, and so can spend a lot more bits on the high-freq components?

Yes, you're right, and I have the same results too :D. That's why I mentioned earlier about TMPEG ignoring some low frequency components in CQ mode, and that's why the effect with Blockbuster is very effective with CQ_VBR but not on CQ.
Quote:


It is somewhat discouraging that I see great improvements in low-freq quantization using my matrices providing I use Blockbuster, but no improvement (or even a reduction in quality) when not using it. This seems to make CQ mode much more unpredictable than CQ_VBR.
So maybe CQ_VBR is the way to go, by dedicating more time and optimize the matrix, instead of going CQ :idea:
Maybe we can get the best result at every resolution with CQ_VBR after all of this is optimized :!:

-kwag

SansGrip 12-29-2002 11:45 AM

Quote:

Originally Posted by kwag
So maybe CQ_VBR is the way to go, by dedicating more time and optimize the matrix, instead of going CQ :idea:

I think the main problem is that it seems not possible to get no visible DCT blocks and no Gibbs. Here are my thoughts:

* DCT blocks are much less visible at 704x480, so no Blockbuster should be needed
* Below that resolution blockiness starts to become a distraction (at least to me)
* CQ mode cannot be used in conjunction with Blockbuster without a specially tuned Q matrix that isn't suitable for any other use
* CQ_VBR mode can be used with or without Blockbuster using the same Q matrix

My thinking, then, is that the 704x480 template should use CQ mode and no Blockbuster for the best quality. All lower resolutions should use CQ_VBR with Blockbuster variance 0-2 (depending on the movie).

This may mean a difference Q matrix for the 704x480 template than the others, but that's not such a big deal.

kwag 12-29-2002 12:14 PM

Quote:

Originally Posted by SansGrip
I think the main problem is that it seems not possible to get no visible DCT blocks and no Gibbs. Here are my thoughts:

* DCT blocks are much less visible at 704x480, so no Blockbuster should be needed
* Below that resolution blockiness starts to become a distraction (at least to me)
* CQ mode cannot be used in conjunction with Blockbuster without a specially tuned Q matrix that isn't suitable for any other use
* CQ_VBR mode can be used with or without Blockbuster using the same Q matrix

My thinking, then, is that the 704x480 template should use CQ mode and no Blockbuster for the best quality. All lower resolutions should use CQ_VBR with Blockbuster variance 0-2 (depending on the movie).

Maybe even 528x480 still can use CQ :?: How would you see that :?:
Quote:


This may mean a difference Q matrix for the 704x480 template than the others, but that's not such a big deal.
Hopefully we can consolidate to a single matrix. That would make things easier :o
I do see a clear improvement with the mods. on the low frequency area of the matrix. And as you say, DCT blocks will probably never be completely eliminated, but I see a smoother blend on DCT blocks even at 704x480, which help the overall visual experience on the picture. It would be nice to be able to have an "MPEG spectrum analyzer" to analyze a difficult dark scene full of DCT blocks, as this would give us an accurate picture of the exact problematic area, and we would have the exact frequency domain to work on that specific matrix area. That would be cool, instead of shooting in the dark :?

-kwag

jamesp 12-29-2002 12:19 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
So maybe CQ_VBR is the way to go, by dedicating more time and optimize the matrix, instead of going CQ :idea:

I think the main problem is that it seems not possible to get no visible DCT blocks and no Gibbs. Here are my thoughts:

* DCT blocks are much less visible at 704x480, so no Blockbuster should be needed
* Below that resolution blockiness starts to become a distraction (at least to me)
* CQ mode cannot be used in conjunction with Blockbuster without a specially tuned Q matrix that isn't suitable for any other use
* CQ_VBR mode can be used with or without Blockbuster using the same Q matrix

My thinking, then, is that the 704x480 template should use CQ mode and no Blockbuster for the best quality. All lower resolutions should use CQ_VBR with Blockbuster variance 0-2 (depending on the movie).

This may mean a difference Q matrix for the 704x480 template than the others, but that's not such a big deal.

Sansgrip,

Although i've got no evidence on me to prove it, I do feel that even at 544(528)x576 I get much better quality using CQ mode and using no blockbuster. To me blockbuster only becomes effective at 352x??? resolutions.

Jim

SansGrip 12-29-2002 12:52 PM

Quote:

Originally Posted by kwag
Maybe even 528x480 still can use CQ :?: How would you see that :?:

I'm going to have to encode the same clip at different resolutions without Blockbuster and watch them on the TV. That's the only way I can tell with any certainty if noise is necessary :).

Quote:

I do see a clear improvement with the mods. on the low frequency area of the matrix.
Yep, me too. What's the file size difference with your new matrix? Have you thought of applying similar changes to the non-intraframe matrix too?

Quote:

It would be nice to be able to have an "MPEG spectrum analyzer" to analyze a difficult dark scene full of DCT blocks, as this would give us an accurate picture of the exact problematic area, and we would have the exact frequency domain to work on that specific matrix area.
In theory what would be required is to do a DCT transform on each 8x8 block of the frame and output the DCT table before and after quantization. This way we could look at each block and (theoretically) determine which frequencies are being over-quantized.

This doesn't sound too difficult, but it would be a lot of output through which to wade unless one were testing with very small frame sizes (say, 32x32 in a known problem area).

SansGrip 12-29-2002 12:55 PM

Quote:

Originally Posted by jamesp
Although i've got no evidence on me to prove it, I do feel that even at 544(528)x576 I get much better quality using CQ mode and using no blockbuster. To me blockbuster only becomes effective at 352x??? resolutions.

I'll let you know if I agree after lunch and after I run some tests through the TV ;).

kwag 12-29-2002 02:18 PM

Quote:

Originally Posted by SansGrip
What's the file size difference with your new matrix? Have you thought of applying similar changes to the non-intraframe matrix too?

The file size difference is a little larger with the new matrix. But not much. Even when I correct the CQ value to target the same file size as the original matrix, the result is still less DCT blocks shown and actually less macro blocks and artifacts 8O . Maybe the intra with all 16's is better too, and does a better job on the high frequency end too :idea:
I haven't touched the Intra, because I like the results much better with the 16's 8)
BTW: Here's my "compare.avs" script I'm using to test:

Code:

LoadPlugin("C:\encoding\MPEG2DEC.dll")
clip1 = DirectShowsource("k:\test_1.m1v").Subtitle("Default KVCD Matrix")
clip2 = DirectShowsource("k:\test_2.m1v").Subtitle("KVCD test(2) matrix with 'Notch' filter.")
StackVertical(clip1, clip2 )
Levels(0, 1.5, 255, 16, 255)
ConvertToRGB()

You'll notice that this way you don't have to save your .m1v files to AVI, as you can see them in Vdub right after your encode. Makes the test cycle much faster 8)

-kwag

jorel 12-29-2002 02:27 PM

Quote:

Originally Posted by black prince
Hey Kwag,

Sorry about Divx. :( Seems jorel was the one to malign Divx. :?

-black prince


you write:

"I’m just teasing Don’t malign Divx too much. File prediction is now an important
part of the KVCD process, but remember when the idea started with Ozzie’s very long
avs script using Trim, then he cames up with SelectRangeEvery(). You’ll be interested
to know he got it from Divx’s compression test. I believe you are raising the bar for
picture quality for all methods of video backup to reach and that’s what’s important to
me. I used Gknot for some time and created a lot of Divx’s only to be played on my
PC. I wanted more portability in playing movies with the best picture quality possible.
KVCD has not disappointed me and others. You are reaching for picture quality
that could very well become the standard for others to reach, not just Divx. I wish I had skills
like you, SansGrip, and other technical developers, but I know enough to realize what’s
happening at KVCD is very promising."

yes,i'm with you.......

--------------

and i write (with this part quote from Kwag):

You all encourage us to push all this stuff to the limits. And the "NAH" sayers at other sites encourage us to go beyond the standards and over the limits ( which then pushes them to oblivion)

really,really,really!
Kwag,we are with you!

------------

and you again: (:-@

"Seems jorel was the one to malign Divx. :?"

are you blame me?

where i write something like this? are you :x and :? ?

what you talking about????????

SansGrip 12-29-2002 03:17 PM

Quote:

Originally Posted by kwag
The file size difference is a little larger with the new matrix. But not much. Even when I correct the CQ value to target the same file size as the original matrix, the result is still less DCT blocks shown and actually less macro blocks and artifacts 8O .

Sounds very promising :).

Quote:

Maybe the intra with all 16's is better too, and does a better job on the high frequency end too :idea:

Theoretically, a Q factor of 16 for all frequencies of the P and B frames should cause a significant increase in quality, since it quantizes less than the current KVCD Q matrix. My main concern would be the drop in the compression ratio, but if you say it's not significant then that's fine.

Of course, it is the "standard MPEG" non-intra-frame matrix... but we shouldn't be biased against it just because of that :mrgreen:.

Quote:

clip1 = DirectShowsource("k:\test_1.m1v").Subtitle("Defaul t KVCD Matrix")
Good idea! I never even thought of DirectShowSource :).

Quote:

You'll notice that this way you don't have to save your .m1v files to AVI, as you can see them in Vdub right after your encode. Makes the test cycle much faster 8)
Yep, that did slow it down a lot :).

Now testing with 16s...

black prince 12-29-2002 04:39 PM

Hey Kwag,

I liked your compare.avs script. Have you or SansGrip tried this
utility "avscompare" to compare the effects of different filters. Here's the link:

http://forum.doom9.org/showthread.ph...ght=avscompare

I'm using it to compare a script with CQ Blockbuster and one without :)
See what you think.

-black prince

SansGrip 12-29-2002 04:47 PM

Quote:

Originally Posted by black prince
Have you or SansGrip tried this
utility "avscompare" to compare the effects of different filters.

I've not tried it yet but it looks interesting. I'll add it to my ever-growing todo list ;).

BTW, new version of Blockbuster at my site...

black prince 12-29-2002 04:48 PM

Hi jorel,

jorel wrote:
Quote:

Hopefully we'll keep optimizing MPEG-1 to a point where we drive DivX nuts
I just figured out what you meant and I owe you an appology :(
I think you are saying if the picture quality keeps getting better
using KVCD CQ we won't be limited to using Divx on the PC. :)
I believe we are both in agreement. :)

-black prince

jorel 12-29-2002 04:58 PM

Quote:

Originally Posted by black prince
Hi jorel,

jorel wrote:
Quote:

Hopefully we'll keep optimizing MPEG-1 to a point where we drive DivX nuts
I just figured out what you meant and I owe you an appology :(
I think you are saying if the picture quality keeps getting better
using KVCD CQ we won't be limited to using Divx on the PC. :)
I believe we are both in agreement. :)

-black prince

i quote this part:
"You all encourage us to push all this stuff to the limits. And the "NAH" sayers at other sites encourage us to go beyond the standards and over the limits ( which then pushes them to oblivion )"

Kwag wrote this after me:
"Hopefully we'll keep optimizing MPEG-1 to a point where we drive DivX nuts"

but no problems! :)
Yes dear friend,"we are both in agreement." :)

don't need appology,but you "scare me"
8O

black prince 12-29-2002 08:06 PM

Hey Kwag and SansGrip,

You've got to try "avsCompare" :D It allows you to load up to 4
avs scripts and allows you to switch between. You can enlarge
the frame and save it as bitmap file. You can play each script to
preview. There future enhancements to add subtitles to a bitmap
image, but it can be done in the script now. I compared Temporal
Smoother to FluxSmooth to TemporalSoften in 3 different scripts.
Then I compared different Blockbuster noise variance settings with 4
different scripts. Then I compared BilinearResize to LanczosResize
to BicubicResize. :) LanczosResize was sharper than BilinearResize
which I already knew, but it was very clear when I enlarge them
both. This is a great tool :D

-black prince

gonzopdx 12-29-2002 08:33 PM

@black prince

where can you get it? i wanty i wanty! :)

black prince 12-29-2002 08:40 PM

@SansGrip,

"avscompare" showed that LanczosResize not only sharpened the
picture, but also enhanced colors. Colors were richer and image
detail was clearer. My question... would this be suitable for CQ
encodes. :?: I realize file size will increase, but since I'm not using
Blockbuster noise and this would really enhance picture quality.
BilinearResize appears to have a more softer look, but probably
increases less. I plan to use 704x480 with CQ for 2 CD's.


-black prince

black prince 12-29-2002 08:44 PM

@gonzopdpx,

http://forum.doom9.org/showthread.ph...ght=avscompare

Enjoy :D

-black prince

SansGrip 12-29-2002 08:50 PM

Quote:

Originally Posted by black prince
LanczosResize not only sharpened the
picture, but also enhanced colors. Colors were richer and image
detail was clearer.

Yep, that is indeed the case. If you're interested in reading more about it, or want objective proof, check out this post I made last month on Doom9.

In that post I suggested that one should always use Lanczos for its most accurate colour fidelity, and then soften if necessary with a filter designed to do this.

Quote:

My question... would this be suitable for CQ encodes. :?: I realize file size will increase, but since I'm not using Blockbuster noise and this would really enhance picture quality.
The only thing you can do is try it :). Burn a CD-RW with the same clip encoded with the same settings using bilinear, bicubic and Lanczos. Watch on a TV and see which you prefer :).


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

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.