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)

SansGrip 01-08-2003 10:59 AM

Quote:

Originally Posted by kwag
Where are the extra bits coming from :?: I agree with you. I don't know 8O

Of course it could simply be a case of better bit allocation. We won't know until we test more ;).

kwag 01-08-2003 11:04 AM

Quote:

Originally Posted by Boulder
Kwag, you've created another monster :twisted:

I did a quick-and-dirty test, and *drum roll*

CQ_VBR file size increased when B frames set to 1 (CQ_VBR value 17,3)

It went from 11,712 to 13219.

CQ file size decreased when B frames set to 1 (CQ value 60)

It went from 6,547 to 6,231.

Uh oh. Looks like this will be another chaotic TMPGEnc test session for you lads.

YEAH :!: , and there are also less DCT blocks shown and less artifacts (Gibbs) :jawdrop:

I'm running two more tests now without sampler to see what the end file size is. Maybe this was the ticket to optimize CQ mode :idea:

-kwag

kwag 01-08-2003 11:33 AM

I just finished two 5 minute encodes with both GOP's The visual difference, at least to me, is remarkable. 8O
The file size for GOP 1-12-2-1-24 was 24,338KB and for 1-12-1-1-24 was 24,339KB :mrgreen: 1KB difference :mrgreen:

Now I'm running the same test on another 5 minute section. The lobby scene 8)
I'll edit this post.

Running second test ...... Done!,

File size for 1-12-2-1-24 is 42,066KB
File size for 1-12-1-1-24 is 42,487KB

This was on the lobby scene which is a very active high action part. That's 421KB larger for the 1-12-1-1-24. Not that much, considering a 5 minute clip full of action, and the quality difference is just worth it 8O :D

Now, to encode the complete movie, again :x


-kwag

SansGrip 01-08-2003 11:50 AM

Quote:

Originally Posted by kwag
GOP 1-12-2-1-34

Please tell me you mean 1-12-2-1-24.... ;)

kwag 01-08-2003 11:52 AM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
GOP 1-12-2-1-34

Please tell me you mean 1-12-2-1-24.... ;)

Sorry :!: , I'm too excited :mrgreen:
Yes, it's 1-12-2-1-24

Edit: I just edited the post

-kwag

kwag 01-08-2003 01:03 PM

Quote:

Originally Posted by SansGrip
@kwag

I ran the artifact test and the problem I highlighted is indeed gone when I use 8 as a minimum. That said, now I see similar artifacts in the left-hand side of the frame.

Using a lot of 8s in a frame has never worked for me -- while theoretically it should give best quality, if you single-step through the frames you'll see serious degeneration in the P- and B- frames...

Hi SansGrip,

Could you run just one more test with the 1-12-1-1-24 and the BETA-1 matrix, and see if the artifacts are still there :?:
I just want to be sure that it's really the values below 8, or the GOP combination. Maybe with the IBP GOP the artifacts won't appear :!:

-kwag

SansGrip 01-08-2003 01:24 PM

Quote:

Originally Posted by kwag
Could you run just one more test with the 1-12-1-1-24 and the BETA-1 matrix, and see if the artifacts are still there :?:

Yep, I can do that in a minute. I'm running some tests on the new GOP at the moment :).

Boulder 01-08-2003 01:49 PM

I hope you guys get the new GOP and CQ optimizations done soon..I've got lots to encode - the Star Trek reruns began today :lol: I don't want to encode the series with lower quality if there's a new, great improvement coming just 'round the corner :wink:

kwag 01-08-2003 04:20 PM

SansGrip,

I look like this :teeth:, waiting on your result before the :sun: goes down :mrgreen:

SansGrip 01-08-2003 05:26 PM

Quote:

Originally Posted by kwag
I look like this :teeth:, waiting on your result before the :sun: goes down :mrgreen:

heheh I'm getting there -- had to fix a FluxSmooth bug (new release on my site) and various other things. I hope to redo the artifacts test with the new GOP either shortly or after supper.

I've been doing some tests with the new GOP, CQ and CQ_VBR. Here's my verdict:

CQ_VBR mode is better for shorter movies (say, 90mins at 528x480 or 120mins at 352x480, or whatever) where you can afford to use Blockbuster. It really does improve the picture quality significantly wrt blockiness. Personally, I would even drop the audio down a notch to get less blockiness, but that's just me :).

CQ mode is better when you have a borderline case for a particular resolution. Since it quantizes low frequencies much more aggressively, it can spend more bits on higher-frequency stuff and thus you see reduced Gibbs etc. and an overall nicer quality. Unfortunately, you do get blockiness. That seems to be unavoidable with this mode.

As far as the new GOP goes, it definitely reduces CQ mode blocks noticibly. Perhaps it's stealing some bits back into low-freq areas from high-freq areas, because I see no detrimental effects from the change. Hence I give it a thumbs up for CQ :). It doesn't have much effect on CQ_VBR mode, though, other than a significant increase in file size (2 CQ_VBR levels). It gets a thumbs down for CQ_VBR mode ;).

And that... is my final answer :mrgreen:.

SansGrip 01-08-2003 06:01 PM

@kwag

Those artifacts are still visible with the new GOP and beta-1 :(.

kwag 01-08-2003 07:51 PM

Quote:

Originally Posted by SansGrip
@kwag

Those artifacts are still visible with the new GOP and beta-1 :(.

I can't duplicate what you see 8O . I don't see those artifacts on my encodes. Could it possibly be that the .m1v when it's converted with Huffy CODEC, that you see that effect :?: . As you already know the frame you saw that little red artifact, could you load the .m1v directly with Vdub and check that frame and see if it's still there :?: It seems to me that if the matrix was doing mathematical errors on values below 8, we would see many many artifacts on almost every low lit scene. Not just a single random artifact in a frame :idea: . That's just the way I see it. So on a very very dark screen, we would have spots all over the screen on every matrix "hit" division on error, etc.

Side note: I finished my encode of "The Matrix" with the new GOP, and 8O 8O 8O that's what it looks like :D Final size 666,669KB ( :spook: ) which I had estimated 687. But my Sampler() size was ~11.3MB and the required sample was 11.45MB, so the prediction is right on the ball with this GOP too :)

Edit: I'm using TMPGEnc 2.59 PLUS

-kwag

SansGrip 01-08-2003 08:04 PM

Quote:

Originally Posted by kwag
Could it possibly be that the .m1v when it's converted with Huffy CODEC, that you see that effect :?:

Nope - Huffy is lossless, so it preserves the clip exactly. Besides, I see it in the m1v too :).

Quote:

It seems to me that if the matrix was doing mathematical errors on values below 8, we would see many many artifacts on almost every low lit scene.
Not necessarily, and not only low-lit. It'll happen in very low-frequency areas, and only occasionally (mostly at the top of the active frame, I've found). Think of it this way: the DCT process churns out numbers between 0 and 2040 (or thereabouts). Most of those numbers (0-1530), when divided by 6, produce a value within the valid range of 0-255. It's only when you get numbers larger than 1530 that you'll see overflow.

Not only that, but it could be happening in areas where it's unlikely you'll see it. I have a theory that it requires several of these in the same area to be really visible on casual inspection, perhaps caused by strong vertical or horizontal edges around a very low-frequency area. Or something like that ;).

Quote:

I finished my encode of "The Matrix" with the new GOP, and 8O 8O 8O that's what it looks like :D
Yep, the new GOP is definitely better :).

Just out of interest, take a look through the final encode using VirtualDub (use the brightness/contrast filter to increase the brightness quite a bit) and I think you'll find one of those artifacts with enough looking. I've seen them several times with various sources using the notch matrix.

kwag 01-08-2003 08:22 PM

OK SansGrip, that will be my assignment for the rest of the night. Matrix cleanup and de-artifacting :D

BTW, here's a piece of the full encode on "The Matrix" with the new GOP. It's only about 11 seconds: http://www.kvcd.net/test-newmat-cq-.mpg (No audio) just renamed the .m1v to .mpg so people can play it on WinDVD, etc :wink:

-kwag

SansGrip 01-08-2003 09:05 PM

Quote:

Originally Posted by kwag
BTW, here's a piece of the full encode on "The Matrix" with the new GOP.

Looks really good -- almost as good as the encode I did way back when, on 3 discs :D.

Is that LBR or 352x240-PLUS?

kwag 01-08-2003 09:09 PM

Quote:

Originally Posted by SansGrip
Is that LBR or 352x240-PLUS?

:punch: 528x480 :mrgreen:

SansGrip 01-08-2003 09:21 PM

Quote:

Originally Posted by kwag
:punch: 528x480 :mrgreen:

Stupid ATI File Player shows it at 352x240 :roll:. Let me try again with a proper player ;).

syk2c11 01-08-2003 11:28 PM

Kwag,
In your latest "Matrix" sample, did you use NEW GOP (1-12-1-1-24) with original KVCD matrix or Notch beta-1 matrix? With NEW GOP, do we need blockbuster (noise or dither) at all?

Gaudi 01-08-2003 11:31 PM

Quote:

Originally Posted by SansGrip
Stupid ATI File Player shows it at 352x240 . Let me try again with a proper player .

Give BSPlayer a try. It rocks.
Gaudi

kwag 01-08-2003 11:37 PM

Quote:

Originally Posted by syk2c11
Kwag,
In your latest "Matrix" sample, did you use NEW GOP (1-12-1-1-24) with original KVCD matrix or Notch beta-1 matrix? With NEW GOP, do we need blockbuster (noise or dither) at all?

I used 1-12-1-1-24 ( the new test GOP ) with BETA-1 "notch" matrix and 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("F:\THE_MATRIX_16X9LB_N_AMERICA\VIDEO_TS\test.d2v")
LegalClip()
BilinearResize(496,256,12,62,696,356)
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 ##

I have mixed feelings about "dither". Today, I got a call from a friend who has a 48" Panasonic HDTV rear screen projection system, and he told me that a movie he did with "dither" set to .4, looks like if you were watching the movie through a "screen". So I guess I have to make more tests with that. Maybe "noise" does indeed look more natural. :roll:

-kwag

muaddib 01-08-2003 11:56 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by black prince
On STD 27" TV, Kwag's movie would look somewhat flat,
because of the heavy letterbox. :)

But that's the original aspect for that movie :D. If I resize to something else taller, people will look streched 8)

-kwag

Hi kwag!
I must agree with black prince when he says that.
I think that with heavy letterbox movies, like matrix and lotr, we should not use TV overscan. Well, not the way FitCD does. FitCD resizes to a smaller size and then insert the borders. Doing that it reduces the height of the film. IMHO, with movies like that I think we should overlap the frame with black borders (using the letterbox filter) and not resize to a smaller size.

Some times I even cut some of left and right columns to be able to increase the height a bit and keep the aspect ratio intact.

Jellygoose 01-09-2003 04:07 PM

I agree too... I'm currently trying to encode LOTR... It's hard to find correct resize values for this one... What would you recommend muaddib and others?

kwag 01-09-2003 05:17 PM

KVCD BETA-1a Matrix
 
@SansGrip and All:

Please test these matrix changes. It's the closest I have been able to get to the BETA-1 "notch" without causing division errors.

Make the following changes to the current BETA-1 matrix (left top):

Code:

8  9  12
9  10  14
12 14  18

Please try it out and see if you get the artifacts. There shouldn't be any, and the softening on low frequency blocks should be about the same as with the original BETA-1 "notch". So compare this to the original "KVCD" matrix.

Please let me know as soon as you have some results :D

-kwag

kwag 01-09-2003 05:51 PM

KVCD BETA-1a notch Matrix test
 
Here is a comparison with the original "KVCD" matrix and the new "BETA-1a notch" matrix.

http://www.digitalfaq.com/archives/i.../2003/01/2.png

:wink:

kwag 01-09-2003 11:59 PM

I just played the first 9 minutes of "The Matrix" on my HDTV, and all I can say is :jawdrop: :jawdrop: :jawdrop:
The same results with "K-19", compared to the previous encodes. Take a look at this, encoded with 1-12-1-1-24 GOP and KVCD BETA-1a notch matrix: http://www.kvcd.net/k-19-newgop-newmat.mpg (no audio)
That's what the complete 138 minute film looks like on one CD-R :mrgreen:

I think I'm going to go drink a (couple of ) beer(s) :flip: :bugeyes:

-kwag

black prince 01-10-2003 12:52 AM

@Kwag,

Quote:

encoded with 1-12-1-1-24
Is this correct. :roll: I've been using 1-12-2-1-24. :(

-black prince

kwag 01-10-2003 12:56 AM

Quote:

Originally Posted by black prince
@Kwag,

Quote:

encoded with 1-12-1-1-24
Is this correct. :roll: I've been using 1-12-2-1-24. :(

-black prince

The new GOP is 1-12-1-1-24. Yes, that is correct, and the sample above was done with than GOP :D
Also, make the matrix changes too, and encode a small sample. Let me know what you think 8)

-kwag

black prince 01-10-2003 01:06 AM

@Kwag,

Quote:

Let me know what you think
Flashing in the static background areas (e.g. walls) has stopped.
Gibbs noise is hardly there. Picture quality is even better than
before. To sum it up, this is an excellent test clip. Now the big
questions are what template did you use. What setting did you
use for CQ or CQ_VBR? I will try a clip of my own to see if I
can get the same results. :D

-black prince

kwag 01-10-2003 01:14 AM

Quote:

Originally Posted by black prince
Flashing in the static background areas (e.g. walls) has stopped.

I know 8) , you guys pushed me to fix that crap :lol:
Quote:

Gibbs noise is hardly there. Picture quality is even better than
before.
You're 100% right, by about twice :mrgreen:
Quote:

To sum it up, this is an excellent test clip. Now the big
questions are what template did you use. What setting did you
use for CQ or CQ_VBR? I will try a clip of my own to see if I
can get the same results. :D

-black prince
This is not template related at all. Just use GOP 1-12-1-1-24 and the matrix modification posted above. The samples were encoded using CQ.
That's basically it :D
This should apply to all templates above 352x240(288) resolution. Maybe CQ will work now at lower resolutions :idea: . I haven't tried that yet 8)
Let me know you findings :)

-kwag

black prince 01-10-2003 01:37 AM

@Kwag,

I used GOP 1-12-1-1-24, Notch Beta-1a and CQ for my own test and
the results were just as good as your test clip. I guess I'll switch
back to CQ with this result :wink: I know we push you, but look
what you have accomplished :D

-black prince

kwag 01-10-2003 01:58 AM

Quote:

Originally Posted by black prince
@Kwag,

I used GOP 1-12-1-1-24, Notch Beta-1a and CQ for my own test and
the results were just as good as your test clip. I guess I'll switch
back to CQ with this result :wink: I know we push you, but look
what you have accomplished :D

-black prince

No, look what WE have accomplished :D
And you know what, I was just reading some old KVCD related posts at "another" site, and I'm LMAO right now :mrgreen:

Here are some old quotes, with poster names not shown:

the video quality of that will be AWFULL... you don't need to be an expert to know that...

Needless to say, the quality will be sub-VCD if you actually did put 130 min on one disc.

130 minutes on a CDR? Oh gawd. I don't care what anyone ways, that just can't look too great.

Depends what you see as quality. Something around 2000kbps, 2 pass VBR Divx 5 is what i define as ok, I fit all my rips on 2 CDR's

but fitting that much on a disc won't give you DVD-like quality. No way

I doesn't matter what XVCD template you use, putting 130 min on one CD will have the video quality at SUB-VCD quality. That is "less than standard VCD".

And that's just some of them! :D
The thing is, we're actually fitting over 2 hours on one CD, but at 528x480. And that is FAR above VCD quality. Actually, I think that we're very close to DVD quality. We're not that far off 8)

-kwag

Boulder 01-10-2003 04:52 AM

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.

GetUp 01-10-2003 05:50 AM

Re: KVCD BETA-1a notch Matrix test
 
Quote:

Originally Posted by kwag
Here is a comparison with the original "KVCD" matrix and the new "BETA-1a notch" matrix.

http://www.digitalfaq.com/archives/i.../2003/01/2.png

:wink:

Hmm, but look at Trinity's (is it she?) face. It looks much "blockiest"?

GFR 01-10-2003 06:09 AM

Quote:

No, look what WE have accomplished
And you know what, I was just reading some old KVCD related posts at "another" site, and I'm LMAO right now

Here are some old quotes, with poster names not shown:

Testimonial:

When I first got into this hobby all I wanted to do was transfer some VHS-C tapes to CD-R.

After trying every encoder and every guide on "the other forum", on doom9, on digital-digest, etc. I gave up. There was nothing even barely acceptable. (VHS-C camvorder shooting is a difficult source: noisy, unstable colours, bad ilumination most of the time, the video is shaky, sudden pans, the auto-focus goes in and out, and you've got the "mom-i've-got-a-zoom" effect :))

So I sticked to convert DVD rips and analog tuner captures, that are much easier to encode, and gave good results with 2 CD SVCDs.

After the amazing results I got with KVCDs, this week I decided to try again the VHS-C sources. Captured at 352x480 Huffyuv, converted to SKVCD (my player doesn't like hi-res mpeg1).

It's GREAT! You can't tell it from the original tape.

Many, many thanks.

Some comments about the posts on the other forum. I think they don't get how complex the human perception is. They have a closed mind: "if I have a lower bitrate, I'll have more artifacts, and if I have more artifacts it's worse". Another example, if I have a 352x240 encode and a 544x480 encode, both at the same min, max and average bitrates, the 544x480 encode should look worse, because you have less bits per pixel, that's simple math. I think if you calculated PSNR for the encodes, KVCDs, specially KVCDx3 would have awful figures (maybe I'm wrong, because bitrate viewer shows nice Q figures). But it's not as simple as that. I'm only guessing, but I think KVCDs can actually have more artifacts (noise, distortion) than higher bitrate encodes, but it looks better, because it creates more artifacts that you can't see or that aren't annoying, and less artifacts that are annoying.

A typical example is a very fast high action scene. The "normal" approach is bump up the bitrate so that it has few blocks. If you pause a KVCD at such a scene you'll see many blocks. But if the scene is in normal playing rate, you just can't see the blocks because they move too fast. Why expend bits where you can't see their effect? And you can use those extra bits where they are really needed.

And, of course, we have the labourious fine tuning of GOP and Q matrix, the noise-dithering filter, etc that help squeezing the ultimate efficience from the encoder :)

Boulder 01-10-2003 06:30 AM

Quote:

Originally Posted by GFR
A typical example is a very fast high action scene. The "normal" approach is bump up the bitrate so that it has few blocks. If you pause a KVCD at such a scene you'll see many blocks. But if the scene is in normal playing rate, you just can't see the blocks because they move too fast. Why expend bits where you can't see their effect? And you can use those extra bits where they are really needed.

I've often wondered if the people in "the other forum" watch their movies at slow motion, perhaps at 1/8 x normal frame rate :roll: They mostly offer theoretical conclusions without any visual comparison and experimenting.

black prince 01-10-2003 09:32 AM

@Kwag,

I browse other forums occasionally for KVCD and really focus on posts where
members who have not tried KVCD process have generally the same
comments. They get to the sight and there's no guides to get them
started correctly. They usually encode with other methods, e.g. standard
VCD, and just use your templates. They get frustrated having to wade
throught so many forums and days of asking for help until they
conclude that KVCD wouldn't work anyway. I realize at this time KVCD
is under going a lot of great changes (e.g. sampler, Blockbuster, GOP,
Q-Matrix, RoboCrop, and the list goes on) but as boring as guides are
they get new comers and experienced started on the right track with
KVCD. Also, other sites, mainly DivX one's have guide sections and
some are use to looking for them. If i had just come to KVCD today
and tried to figure out how to get started, I probably would give up,
and have the same conclusions you are getting. :)

@Boulder,

When I used GKnot and Divx 5.0.2 the concept of pyschovisual fasinated
me and the read about encoding what vision is able to perceive and
eliminate the parts it can't. This whole topic alot of sense and produced
encodes that in still frames looked bad, e.g. atrifacts, blockiness, but
were in areas where our vision normally does'nt see. This not only saved
file size, but actually enhanced picture quality. Divx 5.0.2 has some
very good descriptions of how it's use and achieved. True it has
to be done differently for KVCD, but I believe right now it happening by
accident and not by design. Just like TV-Overscan is used to crop parts
of the frame that won't be displayed anyway, psychovisual could be used
to tune frames for detail that our vision won't detect. There's more that
can be done to improve KVCD.

@All,

KVCD, when I joined, used to be improved templates, but now it's a
process. e.g. FitCD, avisynth scripts, Tmpgenc setups, etc. It's grown
into a excellent way to make backups. :D

-black prince

Boulder 01-10-2003 10:14 AM

Quote:

Originally Posted by black prince
If i had just come to KVCD today
and tried to figure out how to get started, I probably would give up,
and have the same conclusions you are getting. :)

I remember when I first tried KVCDs. I did a test encode with a chapter from "The Lawnmower Man". The results were horrible - but this was not the templates' fault. They were horrible because of the colors got all dithered and because I'd never used TMPGEnc before, I was quite unsure how to fix it. I went back to SVCDs and for some reason came back here some months after this first test. I read lots of threads and realised that the color thing was only because of the damn msyuv.dll that is broken. I removed it, tried the once-again-improved templates and have been lurking around here ever since. And damn I'm glad I didn't get scared off completely.

So, I think that a simple, one-path guide would be appreciated by novices. The problem just is that things can evolve really fast around here. It wasn't that long ago when KVCDx3 meant 60 minutes per 80min CD 8O

kwag 01-10-2003 11:12 AM

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

Yoda 01-10-2003 01:36 PM

I think the home page needs to be revamped a little, like maybe a link to the guides as the first thing to see. There also needs to be a tools section to make it easier to find everything you need in one spot. I think it might make it easier for newbees to follow.

-Yoda

kwag 01-10-2003 01:42 PM

Quote:

Originally Posted by Yoda
I think the home page needs to be revamped a little, like maybe a link to the guides as the first thing to see.

Yes, I'll work on that, as soon as things stabilize a little. But right now, there are already functional guides in the main page 8O, so people can use them as starting point. Like Red-M's KVCDx2 guide.

-kwag


All times are GMT -5. The time now is 02:29 AM  —  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.