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)

Boulder 01-10-2003 12:59 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by Boulder
Kwag,

which motion search precision have you been using in your latest tests?

If it's 'high quality', would you please test both 'high quality' and 'motion estimate search' and compare them against each other. I'd really like to know if it's worth switching to the much slower one.

Hi boulder,

I've been using "High quality". I'll make some tests today with this new stuff and "Fast" motion search :D

Edit: Test finished on a sample. "High quality" is FAR better than "Fast" motion estimation. At the same CQ value, the "Fast", produced a sample slightly larger than the "High quality" sample. And the quality is also slightly inferior. So if I lower the CQ value to match the size of the "High quality", the result will be even worse. So, no contest, "High quality" wins :D

-kwag

Thanks Kwag, looks like I'll be switching to HQ then :wink:

acidfire 01-10-2003 01:23 PM

@kwag
I'm sure everyone is waiting for your new kvcd template and have already fallen off their chairs waiting :grrr:. And the way it sounds your getting there. :lol: Keep up the great work.

black prince 01-10-2003 01:55 PM

@Boulder,

With Tmpgenc --> Settings --> Video Settings try setting
P_Picture Spoilage = 0 and B_Picture Spoilage = 0.
This I understand (as SansGrip says) improves file size. I
don't know why, but when I tried this and it worked. :)

-black prince

Boulder 01-10-2003 02:18 PM

Quote:

Originally Posted by black prince
@Boulder,

With Tmpgenc --> Settings --> Video Settings try setting
P_Picture Spoilage = 0 and B_Picture Spoilage = 0.
This I understand (as SansGrip says) improves file size. I
don't know why, but when I tried this and it worked. :)

-black prince

Thanks for the tip. I'm currently trying to figure out whether I should use CQ + the latest GOP + beta-1a matrix or simply CQ_VBR + 2-B-frame-GOP + beta-1 notch matrix for 1CD at 352x576. I encoded "Bend It Like Beckham" with CQ but didn't really like the results, there were ugly blocks nearly everywhere. It's a 2-CD DivX rip originally, but I've had very good results with similar sources earlier. Onto the testing it is then..

SansGrip 01-10-2003 04:21 PM

Quote:

Originally Posted by Boulder
didn't really like the results, there were ugly blocks nearly everywhere

Welcome to CQ mode ;). It's perfect for some movies -- for whatever reason the blocks just don't seem to show up. But on others, it's really not good at all. At the moment I do two sets of samples, one with CQ and one with CQ_VBR+Blockbuster, then use whichever is best.

kwag 01-11-2003 12:48 AM

Hello everybody,

Here's another short sample (extremely high contrast scene) from K-Pax, made with the new parameters: http://www.kvcd.net/kpax-newgop-newmat.mpg (no audio)

K-Pax is 2 hours and 40 seconds. That's what it looks like on one CD-R at 528x480 with audio at 112Kbps. CQ used was 71.3. :wink:

-kwag

SansGrip 01-11-2003 08:41 AM

Quote:

Originally Posted by kwag
Here's another short sample (extremely high contrast scene) from K-Pax, made with the new parameters

Looks really good, though I do notice a little blockiness on Kevin Spacey(tm)'s face, and a slight "pulsing" in the background and on his forehead.

I'm not sure we'll ever be able to get rid of that pulsing completely, since if you single-step through each frame of any MPEG-1 stream you'll see that the I-frames are much blockier than the P- and B- frames, which is why we get a pulse every time the I-frame comes around. You can see it even on completely standard VCDs. That's one area where MPEG-2 wins -- its I-frames are much less blocky.

I'd be really interested to see the same clip done with CQ_VBR and Blockbuster method="noise" (maybe variance=0.7 or so). Maybe that would get rid of the little bit of blockiness, but how much Gibbs would be introduced?

kwag 01-11-2003 11:20 AM

Quote:

Originally Posted by SansGrip
I'd be really interested to see the same clip done with CQ_VBR and Blockbuster method="noise" (maybe variance=0.7 or so). Maybe that would get rid of the little bit of blockiness, but how much Gibbs would be introduced?

Here's the CQ_VBR version: http://www.kvcd.net/kpax-newgop-newmat-cqvbr.mpg

Both clips were made with this script:

Code:

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

Mpeg2Source("K:\KPAX\VIDEO_TS\movie.d2v")
LegalClip()
BilinearResize(496,256,8,57,704,360)
FluxSmooth()
Blockbuster(method="noise", variance=.3, seed=1)
#AddBorders(16,112,16,112)
LegalClip()

#Sampler(length=24)
## MPEG size = ((Total frames/MovieTimeInMinutes)/24) * MPEG sample file size ##

To me, it looks like :stickouttongue: :D

-kwag

SansGrip 01-11-2003 01:22 PM

Quote:

Originally Posted by kwag
Here's the CQ_VBR version

A little more Gibbs, but slightly fewer blocks. :?

Quote:

To me, it looks like :stickouttongue: :D
What does :stickouttongue: mean? ;)

kwag 01-11-2003 01:57 PM

Quote:

Originally Posted by SansGrip
What does :stickouttongue: mean? ;)

:puke:

:mrgreen:

SansGrip 01-11-2003 02:35 PM

Quote:

Originally Posted by kwag
:puke:

Oh hehehe. You really think it looks that much worse?

kwag 01-11-2003 02:43 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
:puke:

Oh hehehe. You really think it looks that much worse?

No, just a little worse :)
I don't know how it will look at 352x240. I haven't tested that yet. But I saw K-19 on my HDTV and it looks by far better than every previous matrix or GOP :wink:
So for 528x480, New GOP + CQ + BETA-1a Notch Matrix wins by far :D

-kwag

SansGrip 01-11-2003 03:06 PM

Quote:

Originally Posted by kwag
So for 528x480, New GOP + CQ + BETA-1a Notch Matrix wins by far :D

Ok... I shall give it a quick test then make that my default TMPGEnc template :).

black prince 01-11-2003 03:20 PM

@Kwag,

Kwag wrote:
Quote:

I don't know how it will look at 352x240. I haven't tested that yet
Just finished testing LBR using GOP 1-12-1-1-24, Q-Matrix Beta-1a,
CQ_VBR=60. Here's my avs script:


mpeg2source("D:\Temp\movie.d2v")
LegalClip()
#
GripFit( source_anamorphic = true, dest_anamorphic=false, width=352, height=240, overscan=1)
#
opening=Trim(0,3093)
opening=opening.TemporalSoften(3,8,30)
#
movie=Trim(3094,145515)
movie=movie.Blockbuster(method="noise", variance=.5, seed=1).FluxSmooth()
#
credits=Trim(145516,0)
credits=credits.Greyscale().TemporalSoften(3,8,30)
#
last=opening+movie+credits
#
LegalClip()
#
#Sampler(length=24)


At 352x240 it's very hard to detect flashing unless I got right up
to my PC. At higher resolutions (e.g. 528x480) it more noticable.
There was hardly any noticable blockiness probably due to Blockbuster
noise. The picture was softer looking so that Gibbs noise wasn't noticable.
I wanted to sharpen the picture just a little without dramatically increas-
ing file size, anybody have suggestions. From 5+ feet the picture is
very good. I'd say there was an improvement from the older GOP and
standard Q-Matrix. File size with the new GOP and Q-Matrix has
decreased :D

-black prince

kwag 01-11-2003 03:24 PM

Quote:

Originally Posted by black prince
At 352x240 it's very hard to detect flashing unless I got right up to my PC.

I notice that viewed on a standalone player, this flashing is almost negligible.

-kwag

KingTuk 01-11-2003 03:27 PM

So is the template ready to release to the masses?

or

Does more testing need to be done?

jorel 01-11-2003 03:30 PM

Quote:

Originally Posted by KingTuk
So is the template ready to release to the masses?

or

Does more testing need to be done?

...to the masses? :lol:

yes,i want to know too! :)

black prince 01-11-2003 03:37 PM

@Kwag,

Kwag wrote:
Quote:

I notice that viewed on a standalone player, this flashing is almost negligible.
It looked the worst when I tested 704x480 with CQ. I could stand back
a few feet and still see flashing. SansGrip has a point about MPEG-2,
that there are really two compressions taking place for I, P, and B
frames. The blocks are compressed as well as the entire frame itself.
Your latest adjustments to GOP and Q-Matrix has made a noticable
decrease, which leads me to believe there still possibly a solution.
At high CQ or CQ_VBR, Gibbs noise seems to be almost gone.
If it weren't for flashing this would be equal to DVD quality. :wink:

-black prince

SansGrip 01-11-2003 03:47 PM

Quote:

Originally Posted by black prince
At high CQ or CQ_VBR, Gibbs noise seems to be almost gone.

Perhaps it's time I tried making a two-disc encode. I've only ever used one disc up to this point :mrgreen:.

kwag 01-11-2003 03:55 PM

Quote:

Originally Posted by black prince
It looked the worst when I tested 704x480 with CQ. I could stand back
a few feet and still see flashing.

From the computer, or from your TV playing on your standalone :?:

black prince 01-11-2003 03:57 PM

@SansGrip,

I tried 2 CD encodes with CQ and CQ_VBR. Flashing still remains a
problem, but Gibbs is much better :) I also, tried your method of
manual file prediction:

((CD size - Audio) / Total Frames) * test frames) = Target File Size

It's slightly more accurate, but I was wondering how you determined
for 1 CD the capacity is 813,019,155. For 2 CD's would it be correct
to multiply by 2. :?:

-black prince

black prince 01-11-2003 04:03 PM

@Kwag,

It looked bad on TV and PC. (flashing with 704x480 CQ). Also,
528x480 was a little better, but it's still noticalbe. Not until I used
352x240 did flashing disappear, but Gibbs seemed a little worst. :)
Seemed the higher the resolution flashing was more noticable :)

-black prince

kwag 01-11-2003 04:05 PM

Ok, you guys push me, so I'm going to look at this very closely :D
I'm going to go grab something to eat, and I'll be back in a couple of hours ( wife wants to go out :x ). I have something in my mind that might solve the problem.

Later :wink: ,

-kwag

SansGrip 01-11-2003 04:07 PM

Quote:

Originally Posted by black prince
It's slightly more accurate, but I was wondering how you determined for 1 CD the capacity is 813,019,155.

With a calculator ;). Basically:

Capacity of CD in bytes = minutes * 60 * 75 * 2324

For an 80-minute CD, that would be:

80 * 60 * 75 * 2324 = 836,640,000

A good guess for VCD/SVCD filesystem overhead is 11mb, or 11,534,336. This brings us down to:

836,640,000 - 11,534,336 = 825,105,664

We then need to compensate for the system stream, which is calculated using the following formula:

Total size = (video size + audio size) * (2048 / 2018)

Therefore we do:

825,105,664 * (2018 / 2048) = 813,019,155

That's the total number of bytes we have available for our video and audio. Once we subtract the size of our audio from that, we have the maximum size for video.

Quote:

For 2 CD's would it be correct to multiply by 2. :?:
160 * 60 * 75 * 2324 = 1,673,280,000
1,673,280,000 - 22 * 1024 * 1024 = 1,673,280,000 - 23,068,672 = 1,650,211,328
1,650,211,328 * (2018 / 2048) = 1,626,038,310

and

813,019,155 * 2 = 1,626,038,310

In other words, "yep" :mrgreen:.

black prince 01-11-2003 04:13 PM

@SansGrip,

SansGrip wrote:
Quote:

813,019,155 * 2 = 1,626,038,310

In other words, "yep" .
Thanks :D

-black prince

SansGrip 01-11-2003 04:17 PM

@black prince

By the way, that's the formula I'm going to be using in the next release of KVCDP... It does seem to be more accurate, as you say, but it's a bit of a pain doing it manually.

kwag 01-11-2003 07:03 PM

@black prince, jorel, SansGrip, and All@,

Download this, and tell me if the "flashing" effect is gone or not.
8O http://www.kvcd.net/kpax-1-12-4-1-16.mpg 8O
Is the quality retained :?: ( To me, it seems the same )
Is the flashing gone :?: ( To me, yes, gone for good! )
But I need more eyes to look at it 8)
If it is, I'll explain what it means, and why ( I assume you already see what ) :wink:
Compare it to the sample I posted yesterday

-kwag

jorel 01-11-2003 07:15 PM

Quote:

Originally Posted by kwag
@black prince, jorel, SansGrip, and All@,

Download this, and tell me if the "flashing" effect is gone or not.
8O http://www.kvcd.net/kpax-1-12-4-1-16.mpg 8O
Is the quality retained :?: ( To me, it seems the same )
Is the flashing gone :?: ( To me, yes, gone for good! )
But I need more eyes to look at it 8)
If it is, I'll explain what it means, and why ( I assume you already see what ) :wink:
Compare it to the sample I posted yesterday

-kwag

i see in powerdvd,seems......

amazing 8O
can't see any problem! 8) (perfect color cubs,skin faces..... :wink: )

see in zoomplayer too,a little dark and some blocks in dark! :?

kwag 01-11-2003 08:27 PM

Expect more changes tonight on the GOP. My goal is to find an optimal value to match the quality of the 1-12-1-1-24 at the same file size. This thread will be polluted by me with samples. 8O But when I put my mind on something, I "sock it to it" until I get what I want :D
So stay tunned, and compare the samples I'll start to post until we all agree that it matches the "Almost Gibbs free" kpax-newgop-newmat.mpg sample, but better stable background without flashes. This is the reference sample and size that I am focusing on right now.

-kwag

SansGrip 01-11-2003 08:31 PM

Quote:

Originally Posted by kwag
Compare it to the sample I posted yesterday

I see (in WMP) fairly strong quantization in low frequencies, yet an increase in Gibbs. No flashing though :).

kwag 01-11-2003 08:54 PM

Tunning, tunning..... 8)

-kwag

SansGrip 01-11-2003 09:04 PM

Quote:

Originally Posted by kwag
Tunning, tunning..... 8)

Making progress? :)

(I just realized... The more time you spend doing this, the less time you spend playing with GripFit 8O ;))

muaddib 01-11-2003 09:13 PM

Quote:

Originally Posted by kwag
Expect more changes tonight on the GOP. My goal is to find an optimal value to match the quality of the 1-12-1-1-24 at the same file size. This thread will be polluted by me with samples. 8O But when I put my mind on something, I "sock it to it" until I get what I want :D
So stay tunned, and compare the samples I'll start to post until we all agree that it matches the "Almost Gibbs free" kpax-newgop-newmat.mpg sample, but better stable background without flashes. This is the reference sample and size that I am focusing on right now.

-kwag

That’s why i LOVE this place! :lol: :flip: :lol:
Those flashes are (were) really annoying. :wink:

kwag 01-11-2003 09:59 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
Tunning, tunning..... 8)

Making progress? :)

Take a look, and tell me SERIOUSLY what you think. If you see any :puke:, tell me. If it's :tup: , say it too :D

Original reference:
http://www.kvcd.net/kpax-newgop-newmat.mpg
New test model:
http://www.kvcd.net/kpax-1-24-4-1.24.mpg
Quote:


(I just realized... The more time you spend doing this, the less time you spend playing with GripFit 8O ;))
Ahh, chucks :roll: :mrgreen:

-kwag

kwag 01-11-2003 10:07 PM

Need some testers here :wink:

Encode a sample ( 15 second or so ) with GOP 1-12-1-1-24 and another sample of the same 15 second clip with GOP 1-24-4-1-24.
Play with CQ of second sample until size matches size of first sample. Then make a visual comparison.
Use KVCD BETA-1a Notch Matrix for both.

-kwag

black prince 01-11-2003 10:21 PM

@Kwag,

I created two 30 second samples. One with the GOP 1-12-1-1-24 and
the other using 1-24-4-1-24. I used file predictor to create the second
file by setting the target file size to the size of the first test file.
I agree with SansGrip, that the flashing is much improved. It appeared
to be there but much less noticable. I viewed the samples up close on
my PC and TV. Up close, meaning, within one foot. From 5+ feet,
It's not noticable. There was some Gibbs, but maybe your CQ settings
were not very high. I realize that flashing can not be completely
eliminated, but if it reduced to a point where it's not noticable that'ss
just as good. :D

-black prince

kwag 01-11-2003 10:23 PM

Quote:

Originally Posted by muaddib
Those flashes are (were) really annoying. :wink:

I think I learned my lesson on GOP. "If you have a lot of "Pees", you also need some to fill in with some "Bees" :tongue2:

kwag 01-11-2003 10:32 PM

Quote:

Originally Posted by black prince
There was some Gibbs, but maybe your CQ settings
were not very high.

Yes, the CQ I used is not the CQ to fit the movie on one CD. It's lower, so I could enhance the visible blocks and artifacts.

I can't see flashing anymore on that scene 8O. At least on that last sample I posted. I'll encode something else. As far as Gibbs, they're actually there, but they're "smoothed" because of the additional B frames, so they don't show as sharp as with 1-12-1-1-24.

-kwag

black prince 01-11-2003 10:47 PM

@Kwag,

Without realizing it, you are using psychovisual techniques. Reducing
picture effects the are very noticable and enhancing those the vision
focuses on more often. It's like listening to music and realizing the
audio range of the ear will never notice certain imperfections and
others it will pick very quickly. Knownig which visual effects are
ignored and which are very accute to sight is useful to creating
high quality video with greater compression. I think it's really interesting
and fun tweaking this process towards that goal. :D

-black prince

kwag 01-11-2003 11:06 PM

Quote:

Originally Posted by black prince
Without realizing it, you are using psychovisual techniques.

Yes, and we all will become Psychos soon :mrgreen: ( Just kidding :D )
Quote:

Reducing picture effects the are very noticable and enhancing those the visionfocuses on more often.
You're right on target :D . The BETA-1a notch matrix has a strong effect on the low frequency domain of the material, causing a drop on visual DCT blocks and a blending effect on the blocks. Then on the high frequency end of the spectrum, the long GOP "blurrs" the artifacts for a more pleasing view.
Quote:

It's like listening to music and realizing the audio range of the ear will never notice certain imperfections and others it will pick very quickly.
That sounds very much like some of the principles used on MP3s, where very close frequencies that the human ear can't make the difference, the lower level signal is discarded. That's how we get compression :) .
Quote:

Knownig which visual effects are ignored and which are very accute to sight is useful to creating
high quality video with greater compression. I think it's really interesting
and fun tweaking this process towards that goal. :D
I think we're very close to that goal now :wink:

-kwag


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

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