Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

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 [email protected]

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

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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