Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
808457f
Add CLI support for vbv
bhavnahariMCW Dec 11, 2018
de97249
Enable vbv for abr mode
bhavnahariMCW Dec 18, 2018
488721b
Added VBV frame level support
dinesh0603 Jan 8, 2019
8f74ea2
1. Fixed Index comparision to compare with current Index + lookAheadD…
dinesh0603 Jan 22, 2019
8f3b2a4
Enforce vbv buffer update to happen in decode order
kirithika7 Jan 23, 2019
f1e1a17
Add new cli -hrd (default 0) + enable flags to signal hrd
kirithika7 Jan 23, 2019
8c2f324
Add support for HRD SEI signalling
kirithika7 Jan 24, 2019
bfd35f2
Add support for Active Parameter Set SEI
kirithika7 Jan 30, 2019
38b744d
Control VBV bufferFill access using mutex
arunaMathes Jan 25, 2019
853a45e
Add cli -vbv-init and remove hard-coded vbv buffer initialization
arunaMathes Jan 31, 2019
87f7729
If rate control is ON, base layer picture will not be processed until…
anaghdin Jan 27, 2019
708bd26
VBV Code clean up and made VBV as function call
dinesh0603 Feb 18, 2019
32dc411
Fix for the deadlock encoding frames fewer than 48
anaghdin Feb 18, 2019
88d1bef
Move vbv algorithm before using picture Qp for other RC context updates
kirithika7 Feb 22, 2019
f4d19b8
Fix Warning: When NAL Unit is non-VCL NAL, TemporalId shall be greate…
kirithika7 Feb 22, 2019
cddec5a
Fix bug:The value of rbsp_stop_one_bit shall be equal to 1 in vps
kirithika7 Feb 25, 2019
96524c4
Fix cbr signalling
kirithika7 Feb 26, 2019
a199b68
Fix Hrd Issue
kirithika7 Feb 27, 2019
e692a04
Fix uninitialized BPnumber value error when hrd is disabled
kirithika7 Feb 28, 2019
c8a7166
Fix Hrd signalling for fixed GOP length
kirithika7 Feb 28, 2019
54eceb4
-Fix 1. encoded bitrate will be within target Bitrate limit 2. previo…
dinesh0603 Mar 5, 2019
429edb5
Add code to copy the pcs context into the Packetization Reorder Queue…
kirithika7 Mar 12, 2019
d857190
Add code to splice the bitstream and insert pic timing SEI
kirithika7 Mar 12, 2019
0d74be5
Fix bugs and cleanup
kirithika7 Mar 12, 2019
22f80ea
Refactor byte shifting code with memcpy+cleanup
kirithika7 Mar 13, 2019
5f52a2f
Add support for strict cbr to prevent hrd buffer overflow
kirithika7 Mar 13, 2019
dd24050
Add code to consider filler bits for RC
kirithika7 Mar 13, 2019
713643e
Merged Master to VBV-DEV branch
dinesh0603 Mar 19, 2019
6311c66
Merge branch 'master' tip into vbv_dev
dinesh0603 Mar 20, 2019
f268574
Update the filler bit error in the packetization feedback to rate con…
kirithika7 Mar 21, 2019
f1cd4c5
Added feedback from packetization to picturemanager to address a dead…
anaghdin Mar 26, 2019
0b1103a
Fix the demux port
anaghdin Mar 27, 2019
494cb24
update the pictureDemuxResultsProducerFifoPtrArray ports
anaghdin Mar 27, 2019
7b70491
Revert the feedback of filler bits error to GOP's virtual Buffer level
kirithika7 Mar 27, 2019
ac9484a
Remove the macro PACK_FEEDBACK
anaghdin Mar 27, 2019
07c3947
Fix for deadlock when vbv is not enabled
kirithika7 Mar 29, 2019
3df55f3
Fix compiler warnings
kirithika7 Mar 29, 2019
707e8fd
Merge branch 'vbv_dev' of https://bitbucket.org/multicoreware/svt-hev…
dinesh0603 Apr 1, 2019
e3b304d
Fix for Final Bitrate is greater than TBR in Strict CBR
dinesh0603 Apr 4, 2019
c009338
Merge branch 'vbv_dev' of https://bitbucket.org/multicoreware/svt-hev…
dinesh0603 Apr 4, 2019
28ae9ae
1.Removed Duplicte code
dinesh0603 Apr 22, 2019
3854916
Merge branch 'master' (Till commit : 2bdfb22) into vbv_dev
dinesh0603 Apr 23, 2019
9db1593
- Updated Sample.cfg for added cli's and Readme
dinesh0603 Apr 24, 2019
0caa1cc
-Modified code as per review comments & coding guidelines
dinesh0603 Apr 25, 2019
5f6db73
Merge branch 'master' into vbv_dev
tianjunwork Apr 30, 2019
5d0af0f
-Modified code as per coding Guidelines
dinesh0603 May 8, 2019
3ad1f46
Merge branch 'master' into vbv_dev
dinesh0603 May 9, 2019
f6482fd
Fix for Deadlock
May 9, 2019
67f68d8
-Modified code as per review comments and coding guidelines
dinesh0603 May 13, 2019
742f9ca
-Removed Duplicate code (encMode) in EbAppConfig.c and Modified code …
dinesh0603 May 13, 2019
a0bceeb
Fixed hrd 1 crash issues caused by writeUvlc long bits, memmove and
Jun 11, 2019
575a4b8
Merge pull request #1 from kelvin412/vbv_dev_crash
dinesh0603 Jun 11, 2019
0acc25b
Fix HRD initialization in packetization
kavithasampath Jun 26, 2019
3b9a0fc
Fix encoder crash with intra period 0
snehaa8 Jun 26, 2019
40bbea8
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC …
kirithika7 Jul 19, 2019
2f9c396
Cleanup
kirithika7 Jul 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Config/Sample.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ ConstrainedIntra : 0 # Enable the use of Cons
# ====================== Rate Control ===============================
RateControlMode : 0 # Rate control mode (0: OFF(CQP), 1: VBR)
TargetBitRate : 7000000 # Target Bit Rate (in bits per second)
vbvMaxrate : 0 # VBV MaxRate (in bits per second)
vbvBufsize : 0 # VBV Bufsize (in bits per second)
vbvBufInit : 90 # Sets how full the VBV buffer to be - [0 - 100]
hrdFlag : 0 # hrdflag (When hrdFlag is set to 1 it requires vbvMaxrate and vbvBufsize to be greater than 0)(0: disable , 1: enable)
MaxQpAllowed : 48 # maximum allowed QP when rate control is on - [0-51]
MinQpAllowed : 10 # minimum allowed QP when rate control is on - [0-51]
LookAheadDistance : 17 # Enable Look Ahead [0-250]
Expand Down
4 changes: 4 additions & 0 deletions Docs/svt-hevc_encoder_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ The encoder parameters present in the Sample.cfg file are listed in this table b
| **ConstrainedIntra** | -constrd-intra | [0,1] | 0 | Allow the use of Constrained Intra, when enabled, this features yields to sending two PPSs in the HEVC Elementary streams <br>0 = OFF, 1 = ON |
| **RateControlMode** | -rc | [0,1] | 0 | 0 : CQP , 1 : VBR |
| **TargetBitRate** | -tbr | Any Number | 7000000 | Target bitrate in bits / second. Only used when RateControlMode is set to 1 |
| **vbvMaxrate** | -vbv-maxrate | Any Number | 0 | VBVMaxrate in bits / second. Only used when RateControlMode is set to 1 |
| **vbvBufsize** | -vbv-bufsize | Any Number | 0 | VBV BufferSize in bits / second. Only used when RateControlMode is set to 1 |
| **vbvBufInit** | -vbv-init | [0 - 100] | 90 | Sets how full the VBV buffer to be|
| **hrdFlag** | -hrd | [0,1] | 0 | HRD Flag, 0 = OFF, 1 = ON |When hrdFlag is set to 1 it requires vbvMaxrate and vbvBufsize to be greater than 0 |
| **MaxQpAllowed** | -max-qp | [0 - 51] | 48 | Maximum QP value allowed for rate control use. Only used when RateControlMode is set to 1. Has to be >= MinQpAllowed |
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also update sample.cfg? Thx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated and pushed (Commit : 9db1593)

| **MinQpAllowed** | -min-qp | [0 - 50] | 10 | Minimum QP value allowed for rate control use. Only used when RateControlMode is set to 1. Has to be < MaxQpAllowed |
| **LookAheadDistance** | -lad | [0 - 250] | Depending on BRC mode | When RateControlMode is set to 1 it&#39;s best to set this parameter to be equal to the Intra period value (such is the default set by the encoder), When CQP is chosen, then a (2 \* minigopsize +1) look ahead is recommended. |
Expand Down
27 changes: 26 additions & 1 deletion Source/API/EbApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,32 @@ typedef struct EB_H265_ENC_CONFIGURATION
uint8_t fpsInVps;


// Application Specific parameters
// VBV Parameters
/* Sets the maximum rate the VBV buffer should be assumed to refill at
*
* Default is 0. */
uint32_t vbvMaxrate;

/* Sets the size of the VBV buffer in bits.
*
* Default is 0. */
uint32_t vbvBufsize;

/* Sets how full the VBV buffer must be before playback starts. If picture
* number is 0, then the initial fill is vbv-init * vbvBufferSize.
* Otherwise, it is interpreted as the initial fill in bits.
*
* Default is 90. */
uint64_t vbvBufInit;

/* Enables the buffering period SEI and picture timing SEI to signal the HRD
* parameters.
*
* 0 = disable.
* 1 = enable.
*
* Default is 0. */
uint32_t hrdFlag;

/* ID assigned to each channel when multiple instances are running within the
* same application. */
Expand Down
23 changes: 23 additions & 0 deletions Source/App/EbAppConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
#define NALU_FILE_TOKEN "-nalu-file"
#define RATE_CONTROL_ENABLE_TOKEN "-rc"
#define TARGET_BIT_RATE_TOKEN "-tbr"
#define VBV_MAX_RATE_TOKEN "-vbv-maxrate"
#define VBV_BUFFER_SIZE_TOKEN "-vbv-bufsize"
#define VBV_BUFFER_INIT_TOKEN "-vbv-init"
#define HRD_TOKEN "-hrd"
#define MAX_QP_TOKEN "-max-qp"
#define MIN_QP_TOKEN "-min-qp"
#define TEMPORAL_ID "-temporal-id" // no Eval
Expand Down Expand Up @@ -204,6 +208,10 @@ static void SetEnableConstrainedIntra (const char *value, EbConfig_t *
static void SetCfgTune (const char *value, EbConfig_t *cfg) {cfg->tune = (uint8_t)strtoul(value, NULL, 0); };
static void SetBitRateReduction (const char *value, EbConfig_t *cfg) {cfg->bitRateReduction = (EB_BOOL)strtol(value, NULL, 0); };
static void SetImproveSharpness (const char *value, EbConfig_t *cfg) {cfg->improveSharpness = (EB_BOOL)strtol(value, NULL, 0);};
static void SetVbvMaxrate (const char *value, EbConfig_t *cfg) { cfg->vbvMaxRate = strtoul(value, NULL, 0);};
static void SetVbvBufsize (const char *value, EbConfig_t *cfg) { cfg->vbvBufsize = strtoul(value, NULL, 0);};
static void SetVbvBufInit (const char *value, EbConfig_t *cfg) { cfg->vbvBufInit = strtoul(value, NULL, 0);};
static void SetHrdFlag (const char *value, EbConfig_t *cfg) { cfg->hrdFlag = strtoul(value, NULL, 0);};
static void SetVideoUsabilityInfo (const char *value, EbConfig_t *cfg) {cfg->videoUsabilityInfo = strtol(value, NULL, 0);};
static void SetHighDynamicRangeInput (const char *value, EbConfig_t *cfg) {cfg->highDynamicRangeInput = strtol(value, NULL, 0);};
static void SetAccessUnitDelimiter (const char *value, EbConfig_t *cfg) {cfg->accessUnitDelimiter = strtol(value, NULL, 0);};
Expand Down Expand Up @@ -321,7 +329,18 @@ config_entry_t config_entry[] = {

// Quantization
{ SINGLE_INPUT, QP_TOKEN, "QP", SetCfgQp },
{ SINGLE_INPUT, USE_QP_FILE_TOKEN, "UseQpFile", SetCfgUseQpFile },
Copy link
Contributor

Choose a reason for hiding this comment

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

UseQpFile is duplicated. Pls clean up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed duplicate code and pushed code (commit:67f68d8)

{ SINGLE_INPUT, RATE_CONTROL_ENABLE_TOKEN, "RateControlMode", SetRateControlMode },
{ SINGLE_INPUT, LOOK_AHEAD_DIST_TOKEN, "LookAheadDistance", SetLookAheadDistance},
{ SINGLE_INPUT, TARGET_BIT_RATE_TOKEN, "TargetBitRate", SetTargetBitRate },
Copy link
Contributor

@tianjunwork tianjunwork Apr 30, 2019

Choose a reason for hiding this comment

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

Please remove duplicated code here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Duplicate code, Commit : 5d0af0f

{ SINGLE_INPUT, MAX_QP_TOKEN, "MaxQpAllowed", SetMaxQpAllowed },
{ SINGLE_INPUT, MIN_QP_TOKEN, "MinQpAllowed", SetMinQpAllowed },
{ SINGLE_INPUT, VBV_MAX_RATE_TOKEN, "vbvMaxRate", SetVbvMaxrate },
{ SINGLE_INPUT, VBV_BUFFER_SIZE_TOKEN, "vbvBufsize", SetVbvBufsize },
{ SINGLE_INPUT, HRD_TOKEN, "hrd", SetHrdFlag },
{ SINGLE_INPUT, VBV_BUFFER_INIT_TOKEN, "vbvBufInit", SetVbvBufInit},


// Deblock Filter
{ SINGLE_INPUT, LOOP_FILTER_DISABLE_TOKEN, "LoopFilterDisable", SetDisableDlfFlag },

Expand Down Expand Up @@ -424,6 +443,10 @@ void EbConfigCtor(EbConfig_t *configPtr)
configPtr->minQpAllowed = 10;
configPtr->baseLayerSwitchMode = 0;
configPtr->encMode = 9;
configPtr->vbvMaxRate = 0;
configPtr->vbvBufsize = 0;
configPtr->vbvBufInit = 90;
configPtr->hrdFlag = 0;
configPtr->intraPeriod = -2;
configPtr->intraRefreshType = 1;
configPtr->hierarchicalLevels = 3;
Expand Down
4 changes: 4 additions & 0 deletions Source/App/EbAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ typedef struct EbConfig_s
uint32_t targetBitRate;
uint32_t maxQpAllowed;
uint32_t minQpAllowed;
uint32_t vbvMaxRate;
uint32_t vbvBufsize;
uint64_t vbvBufInit;

/****************************************
* TUNE
Expand All @@ -345,6 +348,7 @@ typedef struct EbConfig_s
uint32_t enableTemporalId;
EB_BOOL switchThreadsToRtPriority;
EB_BOOL fpsInVps;
uint32_t hrdFlag;
EB_BOOL unrestrictedMotionVector;

/****************************************
Expand Down
4 changes: 4 additions & 0 deletions Source/App/EbAppContext.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ EB_ERRORTYPE CopyConfigurationParameters(
callbackData->ebEncParameters.maxQpAllowed = config->maxQpAllowed;
callbackData->ebEncParameters.minQpAllowed = config->minQpAllowed;
callbackData->ebEncParameters.qp = config->qp;
callbackData->ebEncParameters.vbvMaxrate = config->vbvMaxRate;
callbackData->ebEncParameters.vbvBufsize = config->vbvBufsize;
callbackData->ebEncParameters.vbvBufInit = config->vbvBufInit;
callbackData->ebEncParameters.useQpFile = (EB_BOOL)config->useQpFile;
#if 1//TILES
callbackData->ebEncParameters.tileColumnCount = (EB_BOOL)config->tileColumnCount;
callbackData->ebEncParameters.tileRowCount = (EB_BOOL)config->tileRowCount;
#endif
callbackData->ebEncParameters.disableDlfFlag = (EB_BOOL)config->disableDlfFlag;
callbackData->ebEncParameters.enableSaoFlag = (EB_BOOL)config->enableSaoFlag;
callbackData->ebEncParameters.hrdFlag = (EB_BOOL)config->hrdFlag;
callbackData->ebEncParameters.useDefaultMeHme = (EB_BOOL)config->useDefaultMeHme;
callbackData->ebEncParameters.enableHmeFlag = (EB_BOOL)config->enableHmeFlag;
callbackData->ebEncParameters.searchAreaWidth = config->searchAreaWidth;
Expand Down
6 changes: 5 additions & 1 deletion Source/Lib/Codec/EbDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifdef __cplusplus
extern "C" {
#endif

// Internal Marcos
#define NON_AVX512_SUPPORT

Expand Down Expand Up @@ -927,6 +926,8 @@ typedef enum EB_SEI {
#define MAX_PICTURE_WIDTH_SIZE 9344u
#define MAX_PICTURE_HEIGHT_SIZE 5120u

#define FILLER_DATA_OVERHEAD 6

#define INTERNAL_BIT_DEPTH 8 // to be modified
#define MAX_SAMPLE_VALUE ((1 << INTERNAL_BIT_DEPTH) - 1)
#define MAX_SAMPLE_VALUE_10BIT 0x3FF
Expand Down Expand Up @@ -1081,6 +1082,9 @@ typedef enum EB_SEI {
#define LOW_LCU_VARIANCE 10
#define MEDIUM_LCU_VARIANCE 50

//HRD constants
#define BR_SHIFT 6
#define CPB_SHIFT 4

// INTRA restriction for global motion
#define INTRA_GLOBAL_MOTION_NON_MOVING_INDEX_TH 2
Expand Down
55 changes: 39 additions & 16 deletions Source/Lib/Codec/EbEncHandle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ EB_API EB_ERRORTYPE EbInitEncoder(EB_COMPONENTTYPE *h265EncComponent)
return_error = EbSystemResourceCtor(
&encHandlePtr->pictureDemuxResultsResourcePtr,
encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->pictureDemuxFifoInitCount,
encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->sourceBasedOperationsProcessInitCount + encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->encDecProcessInitCount,
encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->sourceBasedOperationsProcessInitCount + encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->encDecProcessInitCount + 1, // 1 for packetization
EB_PictureManagerProcessInitCount,
&encHandlePtr->pictureDemuxResultsProducerFifoPtrArray,
&encHandlePtr->pictureDemuxResultsConsumerFifoPtrArray,
Expand Down Expand Up @@ -1412,7 +1412,7 @@ EB_API EB_ERRORTYPE EbInitEncoder(EB_COMPONENTTYPE *h265EncComponent)
encHandlePtr->encDecTasksConsumerFifoPtrArray[processIndex],
encHandlePtr->encDecResultsProducerFifoPtrArray[processIndex],
encHandlePtr->encDecTasksProducerFifoPtrArray[EncDecPortLookup(ENCDEC_INPUT_PORT_ENCDEC, processIndex)],
encHandlePtr->pictureDemuxResultsProducerFifoPtrArray[1 + processIndex], // Add port lookup logic here JMJ
encHandlePtr->pictureDemuxResultsProducerFifoPtrArray[encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->sourceBasedOperationsProcessInitCount + processIndex], // Add port lookup logic here JMJ
is16bit,
(EB_COLOR_FORMAT)encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->chromaFormatIdc);
if (return_error == EB_ErrorInsufficientResources){
Expand All @@ -1439,7 +1439,9 @@ EB_API EB_ERRORTYPE EbInitEncoder(EB_COMPONENTTYPE *h265EncComponent)
return_error = PacketizationContextCtor(
(PacketizationContext_t**) &encHandlePtr->packetizationContextPtr,
encHandlePtr->entropyCodingResultsConsumerFifoPtrArray[0],
encHandlePtr->rateControlTasksProducerFifoPtrArray[RateControlPortLookup(RATE_CONTROL_INPUT_PORT_PACKETIZATION, 0)]);
encHandlePtr->rateControlTasksProducerFifoPtrArray[RateControlPortLookup(RATE_CONTROL_INPUT_PORT_PACKETIZATION, 0)],
encHandlePtr->pictureDemuxResultsProducerFifoPtrArray[encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->sourceBasedOperationsProcessInitCount + encHandlePtr->sequenceControlSetInstanceArray[0]->sequenceControlSetPtr->encDecProcessInitCount] // Add port lookup logic here JMJ
);

if (return_error == EB_ErrorInsufficientResources){
return EB_ErrorInsufficientResources;
Expand Down Expand Up @@ -2107,6 +2109,9 @@ void CopyApiFromApp(
// Rate Control
sequenceControlSetPtr->staticConfig.sceneChangeDetection = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->sceneChangeDetection;
sequenceControlSetPtr->staticConfig.rateControlMode = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->rateControlMode;
sequenceControlSetPtr->staticConfig.vbvMaxrate = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->vbvMaxrate;
sequenceControlSetPtr->staticConfig.vbvBufsize = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->vbvBufsize;
sequenceControlSetPtr->staticConfig.vbvBufInit = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->vbvBufInit;
sequenceControlSetPtr->staticConfig.lookAheadDistance = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->lookAheadDistance;
sequenceControlSetPtr->staticConfig.framesToBeEncoded = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->framesToBeEncoded;

Expand Down Expand Up @@ -2161,9 +2166,9 @@ void CopyApiFromApp(
sequenceControlSetPtr->staticConfig.frameRateDenominator = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->frameRateDenominator;
sequenceControlSetPtr->staticConfig.frameRateNumerator = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->frameRateNumerator;
sequenceControlSetPtr->staticConfig.reconEnabled = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->reconEnabled;
sequenceControlSetPtr->staticConfig.hrdFlag = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->hrdFlag;
sequenceControlSetPtr->staticConfig.unrestrictedMotionVector = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->unrestrictedMotionVector;
sequenceControlSetPtr->enableTmvpSps = sequenceControlSetPtr->staticConfig.unrestrictedMotionVector;

sequenceControlSetPtr->staticConfig.maxCLL = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->maxCLL;
sequenceControlSetPtr->staticConfig.maxFALL = ((EB_H265_ENC_CONFIGURATION*)pComponentParameterStructure)->maxFALL;

Expand Down Expand Up @@ -2218,9 +2223,15 @@ void CopyApiFromApp(
sequenceControlSetPtr->staticConfig.lookAheadDistance = ComputeDefaultLookAhead(&sequenceControlSetPtr->staticConfig);
}




//Set required flags to signal vbv status when hrd is enabled
if (sequenceControlSetPtr->staticConfig.hrdFlag == 1) {
sequenceControlSetPtr->staticConfig.videoUsabilityInfo = 1;
Copy link
Contributor

@tianjunwork tianjunwork Apr 30, 2019

Choose a reason for hiding this comment

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

Please fix the indent of your code changes in this file. Use space instead of tab.
Please review carefully the diff here, and fix all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified code , Used space in place of tab, reviewed full EbEncHandle.c file, Commit : 5d0af0f

sequenceControlSetPtr->videoUsabilityInfoPtr->vuiHrdParametersPresentFlag = 1;
sequenceControlSetPtr->staticConfig.bufferingPeriodSEI = 1;
sequenceControlSetPtr->staticConfig.pictureTimingSEI = 1;
sequenceControlSetPtr->videoUsabilityInfoPtr->hrdParametersPtr->nalHrdParametersPresentFlag = 1;
sequenceControlSetPtr->videoUsabilityInfoPtr->hrdParametersPtr->cpbDpbDelaysPresentFlag = 1;
}
return;
}

Expand Down Expand Up @@ -2507,6 +2518,16 @@ static EB_ERRORTYPE VerifySettings(\
return_error = EB_ErrorBadParameter;
}

if (config->hrdFlag > 1) {
SVT_LOG("SVT [Error]: Instance %u: hrdFlag must be [0 - 1]\n", channelNumber + 1);
return_error = EB_ErrorBadParameter;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use "SVT_LOG("SVT [Error]:"

Copy link
Contributor

Choose a reason for hiding this comment

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

Please follow the coding style here.
if () {
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified and pushed (Commit: 9db1593)

}

if (config->hrdFlag == 1 && ((config->vbvBufsize <= 0) || (config->vbvMaxrate <= 0))) {
SVT_LOG("SVT [Error]: Instance %u: hrd requires vbv max rate and vbv bufsize to be greater than 0 ", channelNumber + 1);
return_error = EB_ErrorBadParameter;
}

if ( config->enableSaoFlag > 1) {
SVT_LOG("SVT [Error]: Instance %u: Invalid SAO. SAO range must be [0 - 1]\n",channelNumber+1);
return_error = EB_ErrorBadParameter;
Expand All @@ -2522,13 +2543,11 @@ static EB_ERRORTYPE VerifySettings(\
if ((config->searchAreaWidth > 256) || (config->searchAreaWidth == 0)){
SVT_LOG("SVT [Error]: Instance %u: Invalid SearchAreaWidth. SearchAreaWidth must be [1 - 256]\n",channelNumber+1);
return_error = EB_ErrorBadParameter;

}

if((config->searchAreaHeight > 256) || (config->searchAreaHeight == 0)) {
SVT_LOG("SVT [Error]: Instance %u: Invalid SearchAreaHeight. SearchAreaHeight must be [1 - 256]\n",channelNumber+1);
return_error = EB_ErrorBadParameter;

}

if (levelIdx < 13) {
Expand Down Expand Up @@ -2700,27 +2719,27 @@ static EB_ERRORTYPE VerifySettings(\
}

if ((config->maxCLL && !config->highDynamicRangeInput) || (config->maxFALL && !config->highDynamicRangeInput)) {
SVT_LOG("Error Instance %u: maxCLL or maxFALL should be used only with high dynamic range input; set highDynamicRangeInput to 1\n", channelNumber);
SVT_LOG("SVT [Error]: Instance %u: maxCLL or maxFALL should be used only with high dynamic range input; set highDynamicRangeInput to 1\n", channelNumber);
return_error = EB_ErrorBadParameter;
}

if (config->useMasteringDisplayColorVolume && !config->highDynamicRangeInput) {
SVT_LOG("Error Instance %u: MasterDisplay should be used only with high dynamic range input; set highDynamicRangeInput to 1\n", channelNumber);
SVT_LOG("SVT [Error]: Instance %u: MasterDisplay should be used only with high dynamic range input; set highDynamicRangeInput to 1\n", channelNumber);
return_error = EB_ErrorBadParameter;
}

if (config->dolbyVisionProfile != 0 && config->dolbyVisionProfile != 81) {
SVT_LOG("Error Instance %u: Only Dolby Vision Profile 8.1 is supported \n", channelNumber);
SVT_LOG("SVT [Error]: Instance %u: Only Dolby Vision Profile 8.1 is supported \n", channelNumber);
return_error = EB_ErrorBadParameter;
}

if (config->dolbyVisionProfile == 81 && config->encoderBitDepth != 10) {
SVT_LOG("Error Instance %u: Dolby Vision Profile 8.1 work only with main10 input \n", channelNumber);
SVT_LOG("SVT [Error]: Instance %u: Dolby Vision Profile 8.1 work only with main10 input \n", channelNumber);
return_error = EB_ErrorBadParameter;
}

if (config->dolbyVisionProfile == 81 && !config->useMasteringDisplayColorVolume) {
SVT_LOG("Error Instance %u: Dolby Vision Profile 8.1 requires mastering display color volume information \n", channelNumber);
SVT_LOG("SVT [Error]: Instance %u: Dolby Vision Profile 8.1 requires mastering display color volume information \n", channelNumber);
return_error = EB_ErrorBadParameter;
}

Expand All @@ -2746,8 +2765,7 @@ static EB_ERRORTYPE VerifySettings(\
return_error = EB_ErrorBadParameter;
}

if (config->compressedTenBitFormat > 1)
{
if (config->compressedTenBitFormat > 1) {
SVT_LOG("SVT [Error]: Instance %u: Invalid Compressed Ten Bit Format shall be only [0 - 1] \n", channelNumber + 1);
return_error = EB_ErrorBadParameter;
}
Expand Down Expand Up @@ -2782,6 +2800,11 @@ static EB_ERRORTYPE VerifySettings(\
return_error = EB_ErrorBadParameter;
}

if (config->vbvBufInit > 100) {
SVT_LOG("SVT [Error]: Instance %u: Invalid vbvBufInit [0 - 100]\n", channelNumber + 1);
return_error = EB_ErrorBadParameter;
}

if (config->tileColumnCount < 1) {
SVT_LOG("SVT [Error]: Instance %u : Invalid tile column count\n", channelNumber + 1);
return_error = EB_ErrorBadParameter;
Expand Down
Loading