Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vbv bitrate and buffersize if set when checking level #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tianjunwork
Copy link
Contributor

Signed-off-by: Jun Tian tianjun1.0@gmail.com

Description

Use vbv bitrate and buffersize if set when checking level. If not, still use the existing logic.

Issue

closes #569

Author(s)

@tianjunwork

Performance impact

  • quality
  • memory
  • speed
  • 8 bit
  • 10 bit
  • N/A

Merge method

  • Allow the maintainer to squash and merge when PR is ready to create a 1-commit to the master branch. The maintainer will be able to fix typos / combine commit messages to create a more readable 1-commit message or use whatever is stated in the 'Description' section
  • I will clean up my commits and the maintainer shall use 'rebase and merge' to the master branch

Signed-off-by: Jun Tian <tianjun1.0@gmail.com>
@tianjunwork tianjunwork added the bug Something isn't working label Aug 11, 2020
@@ -2355,7 +2355,8 @@ void* RateControlKernel(void *inputPtr)
contextPtr->framesInInterval[5] ++;
totalFrameInInterval--;
}
contextPtr->virtualBufferSize = (((EB_U64)sequenceControlSetPtr->staticConfig.targetBitRate*3) << RC_PRECISION) / (contextPtr->frameRate);
EB_U64 bufferSize = sequenceControlSetPtr->staticConfig.vbvBufsize ? sequenceControlSetPtr->staticConfig.vbvBufsize : (EB_U64)sequenceControlSetPtr->staticConfig.targetBitRate * 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hassount , not sure if this change is needed.

@@ -2399,19 +2399,22 @@ static EB_ERRORTYPE VerifySettings(\
return_error = EB_ErrorBadParameter;
}

if ((config->level != 0) && (config->rateControlMode) && (config->tier == 0) && ((config->targetBitRate*2) > mainTierMaxBitRate[levelIdx])){
uint32_t maxBitrate = config->vbvMaxrate ? config->vbvMaxrate : config->targetBitRate * 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hate seeing magic numbers here. Can 2 and 3 be constants with an appropriate name, or perhaps a comment why double or triple the target bitrate is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max rate limit error in encoding
2 participants