PDA

View Full Version : Which way is better for B-frame Q tweaking?


Zep
12th December 2003, 04:58
Ok my encodes are coming in a little undersized and all my settings like rez and bit
rate etc... are good to go. I do not want to touch them. Pretty straight forward Maxed
out Q frames causing this and looking at the stats file confirms it.

I =2
P=2
B=4
B=4
P=2
B=4
B=4
etc... the whole file

Now I could go with 1 b-frame but then some p frames are Q=3 or Q=4 and since I really
need the b-frame size reduction I do not want to go that route. What I want is some or
all b-frames to hit Q = 3 and so i hit my file size. (350 meg )

Now the question. Which is the better way to do this


Tweak the Quantizer ratio from the default 1.50

or

Tweak the Quantizer offset from the default 1.00


What are the pros and cons of each? I want as many of the b-frames as possible
to hit Q=3 to hit my target file size. If half are Q=3 and half Q=4 great as the
output will be better that if all are Q=4.

Thoughts?


Thanks


Zep

sysKin
12th December 2003, 06:53
Quant 3 is quant 3, it doesn't matter what settings gave you that.

You might also try using b-frame sensitivity of -5, -10 and keep 2 bframes at quant 4, after all.

Radek

Zep
12th December 2003, 08:05
Originally posted by sysKin
Quant 3 is quant 3, it doesn't matter what settings gave you that.
You might also try using b-frame sensitivity of -5, -10 and keep 2 bframes at quant 4, after all.

Radek

wouldn't it better to change the Quantizer ratio
or Quantizer offset to hit Q=3 on those B-frames
instead of using b-frame sensitivity to make less b-frames
and having ALL b-frames still stuck at Q=4?

i was hoping to get all b-frames to Q=3 instead of less b-frames
since I need the size reduction and more P frames very quickly
eats up the bitrate. less b-frames is fine but then it means
the b-frames i have are still Q=4.

Going by your method i got this on my test clip

i=2
p=2
b=4
p=3

versus me messin' with Quantizer ratio and Quantizer offset

i=2
p=2
b=3
b=3

I like the second way better since no Q=4.
I need to try the tests on a full encode though and
see if those stats hold.


I still would like to know the pros and cons of Quantizer ratio
and Quantizer offset and which is better to use in this case :)


Thanks

Zep

Manao
12th December 2003, 08:15
In your case, as Radek stated, it amounts to the same thing. Since all your p-frames are quant 2, and since you want b-frames to be quant 3, you have the choice between QR 1.0 and Offset 1.0 or QR 1.5 and offset 0.0 ( or QR 1.25 and offset 0.5, and so on... ).

Now, this will probably make you have some p-frames at quant 3. In that case, you'll see a difference between the different possibilities : QR 1.5 and offset 0.0 will make b-frames quant higher than QR 1.0 and offset 1.0 if a b-frames is near a p-frame at quant 3. So in your case, where you seem to have a high bitrate, you should use QR 1.0 and offset 1.0.

Teegedeck
12th December 2003, 08:35
Originally posted by Zep
Ok my encodes are coming in a little undersized and all my settings like rez and bit
rate etc... are good to go. I do not want to touch them.
Well that's too bad because I doubt that you'll see any visual effect from tweaking the B-frame ratio.

Zep
12th December 2003, 23:56
Originally posted by Manao
In your case, as Radek stated, it amounts to the same thing. Since all your p-frames are quant 2, and since you want b-frames to be quant 3, you have the choice between QR 1.0 and Offset 1.0 or QR 1.5 and offset 0.0 ( or QR 1.25 and offset 0.5, and so on... ).

Now, this will probably make you have some p-frames at quant 3. In that case, you'll see a difference between the different possibilities : QR 1.5 and offset 0.0 will make b-frames quant higher than QR 1.0 and offset 1.0 if a b-frames is near a p-frame at quant 3. So in your case, where you seem to have a high bitrate, you should use QR 1.0 and offset 1.0.

ok that helps.

As for p frames going Q=3 we shall seee :)


Anyway, I would have thought normal encoding would give i and p frames max first then ALL left over bits to b-frames during a normal basic settings to hit the target file size and since the b-frames were Q=4 and file was under sized this would be good.

At least an OPTION should be included to let the encoder over ride QR and QO setings to hit the file size via increasing b-frame quailty dynamically and not pin it to Q=4 (in my case)

or to override and use LESS b-frames to hit file size.
This would save me from having to encode and go OOPS undersized
and go back and change b-frame settings and encode again.
(The rez is decent too. 624 x 352 HDTV at 350 megs. video get 310)

It should be be an option thought since some people like the undersized file and would rather have that.

Zep
13th December 2003, 00:09
Originally posted by Teegedeck
Well that's too bad because I doubt that you'll see any visual effect from tweaking the B-frame ratio.

actually I did see improvement. Because of so many B-frames
at Q=4 the drop to Q=3 made the test clip less blurry.

2 2 4 4 2 2 4 4

does look worse than

2 2 3 3 2 2 3 3


I can see the improvement but I have encoded hundreds of shows in HDTV so... and I do tend to be anal :D


.

Teegedeck
13th December 2003, 11:18
Originally posted by Zep
actually I did see improvement.

Now that's good

Originally posted by Zep
(The rez is decent too. 624 x 352 HDTV at 350 megs. video get 310)
You could find going for a higher resolution pleasing, I believe. (HDTV resolutions (horizontal) are 720p (progressive) and 1080i (interlaced res. of 1920x1080).) 352 doesn't sound much for vertical when you're used to anamorphic resolutions.

Heini011
13th December 2003, 17:51
Hi Zep,

i have noticed the same problem.

i'm only interested in high-quality encodes with at least 720 x ... pixel. so the relevant (p-frame) quantisizers are 2 and 3. when i look at q2-scenes all b-frames are a little blured, but p-frames looks good. at q3-scenes on the other hand the quality remains more constant.

so i had decreased the b-frame quantizer offset from 1.0 to 0.5 and leave the quantiszer ratio at 1.5
the resulting b-frame quantizer:
old -> new
q2: 4 -> 3
q3: 5 -> 5

so quantizer ratio = 1.5 and offset = 0.5 seems to be a better choice !

greetings, heini011.

Zep
13th December 2003, 22:22
Originally posted by Teegedeck
Now that's good


You could find going for a higher resolution pleasing, I believe. (HDTV resolutions (horizontal) are 720p (progressive) and 1080i (interlaced res. of 1920x1080).) 352 doesn't sound much for vertical when you're used to anamorphic resolutions.

The 624 x 352 is due to certain rules I must follow :).

I have been pushing for 768 x 432 but they do not listen :) My own personal encodes on 1280 x 720p streams i go 1024 x 576 and on the 1920 x 1080i I use trbarry's ruduce by 2 filter and go 960 x 544.

I have found that 768 x 432 at 350 megs always gets me

i=2
p=2
b=4
b=4

and only very high motion shows like enterprise need less
resolution (sometimes)to maintain that Quality.

fun fun fun :D

Zep
13th December 2003, 23:01
Originally posted by Heini011
Hi Zep,

i have noticed the same problem.

i'm only interested in high-quality encodes with at least 720 x ... pixel. so the relevant (p-frame) quantisizers are 2 and 3. when i look at q2-scenes all b-frames are a little blured, but p-frames looks good. at q3-scenes on the other hand the quality remains more constant.

exactly what i see. and in my case i use 2 b-frames to get the
huge data size saving so i can get 624 x 352 to hit the 310 to 320
size range. (rest for dolby 5.1 down mix to stereo via LAME VBR)


Originally posted by Heini011

so i had decreased the b-frame quantizer offset from 1.0 to 0.5 and leave the quantiszer ratio at 1.5
the resulting b-frame quantizer:
old -> new
q2: 4 -> 3
q3: 5 -> 5

so quantizer ratio = 1.5 and offset = 0.5 seems to be a better choice !

greetings, heini011.


very interesting! I will try that next. I have a 1280 x 720p .ts of The Practice show sitting here and will test it on that. :)

Zep
13th December 2003, 23:07
ok here are two clips where i increased the resolution to hit the file since

i=2
p=2
b=4
b=4


was way undersized

the first is a clip from the show the pratice I had to
jump up to 1024 x 576 because the show compresses so well.
(low motion, mostly close up face shots)

The Pratcie Clip. 9 megs (http://home.comcast.net/~groovyr/810.1024x576.hdtv.clip.avi)


This next one is a clip i did of enterprise and increased
to 768 x 432 because it was undersized same as above

Enterprise Clip at 13 megs (http://home.comcast.net/~groovyr/enterprise.302.768x432.avi)

now with Q=3 on b-frames no need to increase resolution. Though I have to admit
higher rez at Q=4 may be better since more pixels = more detail. Need to find that
balance. :)

later

Zep