Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Sep 2013
Posts: 38
|
What is the exactly CBR in x264?
Today I read some material from Internet about rate control of x264 and I learned what is the ABR mode. When only the param --bitrate is set, ABR mode is used. But I am confused about the CBR mode.
At first I think when the params --vbv-maxrate and --vbv-bufsize are set together with --bitrate , the CBR mode is used. Then I see these codes from x264: Code:
s += sprintf( s, " rc=%s mbtree=%d", p->rc.i_rc_method == X264_RC_ABR ? ( p->rc.b_stat_read ? "2pass" : p->rc.i_vbv_max_bitrate == p->rc.i_bitrate ? "cbr" : "abr" ) : p->rc.i_rc_method == X264_RC_CRF ? "crf" : "cqp", p->rc.b_mb_tree ); |
![]() |
![]() |
![]() |
#2 | Link |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,960
|
If you just set --bitrate then the encoder will operate in unconstrained VBR.
If you set --vbv-maxrate and --vbv-bufsize to something basic like the H.264 High Profile @ Level 4.1 limitations, the encoder will still operate in ABR mode, but will constrain itself to not go outside these specifications. If you set --vbv-maxrate to the same value as --bitrate, then the encoder will operate in CBR mode. Note, this is not hard CBR where every picture is the same size. That's a terrible idea, and is basically never necessary. --vbv-bufsize controls the size of the buffer - which allows for bitrate variance while still staying inside the CBR limitations. Also note, this is how every other encoder does CBR, so don't be frightened ![]()
__________________
These are all my personal statements, not those of my employer :) |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Sep 2013
Posts: 38
|
@Blue_MiSfit
In my experience, if --bitrate is set , the ABR mode is on. And the final real bitrate will be towards the target, which is the value set by --bitrate. However, when --vbv-maxrate and --vbv-bufsize are included, the value of --bitrate is no longer the target. The final real bitrate will exceeds the --bitrate a lot and will not greateer than --vbv-maxrate. |
![]() |
![]() |
![]() |
#4 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,642
|
Quote:
|
|
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,642
|
Quote:
If you really need to get closer to the target with ABR, you could use a lower --ratetol, such as 0.1. This will reduce quality though. |
|
![]() |
![]() |
![]() |
#7 | Link |
Registered User
Join Date: Sep 2013
Posts: 38
|
@nm
I have tried about 25 sequences. Also 300 frames are used. For some sequences, the difference is about 1~3%,but for several sequences it is about 10%, even 15%. About --ratetol, I have tried too. Indeed, it will improve the accuracy, leading to bad quality. About the accuracy, owing to the low delay of my application, it is unacceptable to converge after about 3000 frames(60s @fps=50). The current ABR in x264 only used on Frame level, and when MB level is considered, the vbv-related params should be set. So I want to adjust the QP of each MB based on the QP decided by ABR in Frame level. However I have not find some useful methods. So it is appreciated if you could give me some suggestions. Thanks in advance. |
![]() |
![]() |
![]() |
#8 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,642
|
Quote:
Sorry, I'm not quite following you here. How exactly do you want to change the way macroblock QPs are decided? Why wouldn't you use VBV parameters? Last edited by nm; 18th November 2013 at 13:23. |
|
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Sep 2013
Posts: 38
|
@nm
I have tried one method, in which the SAD of the macroblock is used as the complexity and if the SAD is greater than the average, I increase the QP, and vice versa. My idea is to adjust the QP of each MB according to its complexity. And the principle is to move bits of some MBs to others. I hope this can reduce the bitrate or improve the quality of the frame. I think it is an obvious method which is easy to think about. But the tests results are not too good. As you have mentioned before, the VBV-compliant CBR will reduce the quality and I don't want too much input params. |
![]() |
![]() |
![]() |
Tags |
rate control, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|