[Mp4-tech] Rate control model updating possible bugs?
Evan Tan
Evan.Tan nicta.com.au
Tue May 22 02:38:22 EDT 2007
Dear Thanasis,
I ran the changed code with the foreman sequence and compared it with the
original code. The rate control operation appears to be correct after the
change was applied, in fact, the selected QPs were exactly the same as the
original code. I suspect the change will be more obvious if
RC_MODEL_HISTORY is set to a smaller value.
I've attached the results and the encoder configuration file as
jm12.2_RC_MODEL_HISTORY_*
And while we are on the subject of problems with the original rate control
code:
It appears that the variable 'QPLastPFrame' is not set correctly for the
calculation of 'PAverageQp' in rc_init_GOP() when a frame-level rate
control is enabled (i.e. BasicUnit==FrameSizeInMbs) and rc_init_GOP() is
called more then once (i.e. RC_MODE_0 & RC_MODE_2).
I believe this can be resolved by adding a line in updatePparams():
void updatePparams( rc_quadratic *prc, int complexity )
{
...
prc->QPLastFrame=prc->m_Qc; <=added
}
I've also attached the results and the encoder configuration file for this
as jm12.2_QPLastPFrame_*
Regards,
Evan
> Dear Evan,
>
> Your proposed changes should in theory work fine. If you could provide us
> with feedback whether the rate control operation remains correct, this
> would be greatly appreciated.
>
> Note that when the rate control code was modified in the JM 12.x versions
> an effort was made to keep the core functionality close to the pre-12.x
> versions. If you could take a look at the source code of, say, the JM
> 10.2, you will see the following lines:
>
> for (i = 19; i > 0; i--)
> {// update the history
>
> RC_MODE_HISTORY-2 = 19
>
> for (i = 0; i < 20; i++)
> {
>
> RC_MODEL_HISTORY-1 = 20
>
> When we rewrote the rate control source code, we also fixed a large number
> of problems apart from reorganizing it (see JVT contribution JVT-W042),
> however we took care not to alter the base rate control algorithm. Indeed,
> it would be really helpful if we could have feedback on these parameters
> from the original contributors of this algorithm. Again thank you for
> pointing this out as it helps improve the H.264/AVC reference software.
>
> Best regards,
>
> Thanasis
>
>
> -----Original Message-----
> From: mp4-tech-bounces lists.mpegif.org
> [mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of Evan Tan
> Sent: Friday, May 18, 2024 9:29 PM
> To: mp4-tech lists.mpegif.org
> Subject: [Mp4-tech] Rate control model updating possible bugs?
>
> Dear Experts,
>
> In rc_quadratic.c - updateRCModel(), the update history loop:
> for (i = (RC_MODEL_HISTORY-2); i > 0; i--) {// update the history ...
> }
>
> shouldn't it be:
> for (i = (RC_MODEL_HISTORY-1); i > 0; i--) ?
>
> and also in the updateRCModel():
> for (i = 0; i < (RC_MODEL_HISTORY-1); i++) {
> m_rgRejected[i] = FALSE;
> }
>
> shouldn't it be:
>
> for (i = 0; i < RC_MODEL_HISTORY; i++) ?
>
>
> the same applies to updateMADModel()
>
> Thanks,
> Evan
>
> _______________________________________________
> NOTE: Please use clear subject lines for your posts. Include [audio,
> [video], [systems], [general] or another apppropriate identifier to
> indicate the type of question you have.
>
> Note: Conduct on the mailing list is subject to the Antitrust guidelines
> found at
> http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust.php
>
> -----------------------------------------
> This message (including any attachments) may contain confidential
> information intended for a specific individual and purpose. If you
> are not the intended recipient, delete this message. If you are
> not the intended recipient, disclosing, copying, distributing, or
> taking any action based on this message is strictly prohibited.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tests.zip
Type: application/x-zip-compressed
Size: 37179 bytes
Desc: not available
Url : /pipermail/mp4-tech/attachments/20070522/8bb92939/tests-0001.bin
More information about the Mp4-tech
mailing list