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 1 commit
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
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Scalable Video Technology for HEVC Encoder (SVT-HEVC Encoder)

[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/intel/SVT-HEVC?branch=master&svg=true)](https://ci.appveyor.com/project/intel/SVT-HEVC)
[![Travis Build Status](https://travis-ci.com/intel/SVT-HEVC.svg?branch=master)](https://travis-ci.com/intel/SVT-HEVC)
[![Coverage Status](https://coveralls.io/repos/github/intel/SVT-HEVC/badge.svg?branch=master)](https://coveralls.io/github/intel/SVT-HEVC?branch=master)

[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/openvisualcloud/SVT-HEVC?branch=master&svg=true)](https://ci.appveyor.com/project/openvisualcloud/SVT-HEVC)
[![Travis Build Status](https://travis-ci.com/OpenVisualCloud/SVT-HEVC.svg?branch=master)](https://travis-ci.com/OpenVisualCloud/SVT-HEVC)
[![Coverage Status](https://coveralls.io/repos/github/openvisualcloud/SVT-HEVC/badge.svg?branch=master)](https://coveralls.io/github/openvisualcloud/SVT-HEVC?branch=master)

The Scalable Video Technology for HEVC Encoder (SVT-HEVC Encoder) is an HEVC-compliant encoder library core that achieves excellent density-quality tradeoffs, and is highly optimized for Intel® Xeon™ Scalable Processor and Xeon™ D processors.

Expand Down Expand Up @@ -45,10 +43,8 @@ Scalable Video Technology is licensed under the OSI-approved BSD+Patent license.
# Documentation

More details about the encoder usage can be found under:

- [SVT-HEVC Encoder User Guide](Docs/svt-hevc_encoder_user_guide.md)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove extra empty line.

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 empty line and pushed patch (Commit : 9db1593)


# System Requirements

## Operating System
Expand Down
23 changes: 15 additions & 8 deletions Source/API/EbApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,23 +511,31 @@ typedef struct EB_H265_ENC_CONFIGURATION

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

/* Sets the size of the VBV buffer in bits.
* Default is zero */
*
* 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 */
* 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.
*Default is disabled */
*
* 0 = disable.
* 1 = enable.
*
* Default is 0. */
uint32_t hrdFlag;


/* ID assigned to each channel when multiple instances are running within the
* same application. */
uint32_t channelId;
Expand All @@ -553,7 +561,6 @@ typedef struct EB_H265_ENC_CONFIGURATION
* Default is -1. */
int32_t targetSocket;


/* Flag to enable threads to real time priority. Running with sudo privilege
* utilizes full resource. Only applicable to Linux.
*
Expand Down
13 changes: 5 additions & 8 deletions Source/App/EbAppConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +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 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 @@ -329,12 +329,9 @@ 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, 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 },
Expand Down
23 changes: 10 additions & 13 deletions Source/Lib/Codec/EbEncHandle.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,9 +2224,8 @@ void CopyApiFromApp(
}

//Set required flags to signal vbv status when hrd is enabled
if (sequenceControlSetPtr->staticConfig.hrdFlag == 1)
{
sequenceControlSetPtr->staticConfig.videoUsabilityInfo = 1;
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;
Expand Down Expand Up @@ -2521,13 +2520,13 @@ static EB_ERRORTYPE VerifySettings(\

if (config->hrdFlag > 1)
{
printf("Error Instance %u: hrdFlag must be [0 - 1]\n", channelNumber + 1);
printf("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)))
{
printf("Error instance %u: hrd requires vbv max rate and vbv bufsize to be greater than 0 ", channelNumber + 1);
printf("SVT [Error]: Instance %u: hrd requires vbv max rate and vbv bufsize to be greater than 0 ", channelNumber + 1);
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 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)

return_error = EB_ErrorBadParameter;
}

Expand All @@ -2546,13 +2545,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 @@ -2724,27 +2721,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 Down Expand Up @@ -2807,7 +2804,7 @@ static EB_ERRORTYPE VerifySettings(\
}

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

Expand Down
8 changes: 1 addition & 7 deletions Source/Lib/Codec/EbEntropyCoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -4094,7 +4094,6 @@ static EB_ERRORTYPE EncodeCoeff(
coeffBuffer = (EB_S16*)&coeffPtr->bufferY[coeffLocation * sizeof(EB_S16)];

if (tuPtr->lumaCbf) {

EncodeQuantizedCoefficientsFuncArray[!!(ASM_TYPES & PREAVX2_MASK)](
cabacEncodeCtxPtr,
tuSize,
Expand Down Expand Up @@ -4132,7 +4131,6 @@ static EB_ERRORTYPE EncodeCoeff(
if (cabacEncodeCtxPtr->colorFormat == EB_YUV422 && tuPtr->cbCbf2) {
coeffLocation = (tuOriginX >> 1) + ((tuOriginY+tuChromaSize) * coeffPtr->strideCb);
coeffBuffer = (EB_S16*)&coeffPtr->bufferCb[coeffLocation * sizeof(EB_S16)];

EncodeQuantizedCoefficientsFuncArray[!!(ASM_TYPES & PREAVX2_MASK)](
cabacEncodeCtxPtr,
tuChromaSize,
Expand Down Expand Up @@ -4182,7 +4180,6 @@ static EB_ERRORTYPE EncodeCoeff(
if (cabacEncodeCtxPtr->colorFormat == EB_YUV422 && tuPtr->crCbf2) {
coeffLocation = (tuOriginX >> 1) + ((tuOriginY+tuChromaSize) * coeffPtr->strideCr);
coeffBuffer = (EB_S16*)&coeffPtr->bufferCr[coeffLocation * sizeof(EB_S16)];

EncodeQuantizedCoefficientsFuncArray[!!(ASM_TYPES & PREAVX2_MASK)](
cabacEncodeCtxPtr,
tuChromaSize,
Expand Down Expand Up @@ -5449,8 +5446,7 @@ static void CodeVPS(
WriteFlagCavlc(
bitstreamPtr,
scsPtr->staticConfig.fpsInVps == 1 ? EB_TRUE : EB_FALSE);
if (scsPtr->staticConfig.fpsInVps == 1)
{
if (scsPtr->staticConfig.fpsInVps == 1) {

if (scsPtr->staticConfig.frameRateDenominator != 0 && scsPtr->staticConfig.frameRateNumerator != 0) {

Expand Down Expand Up @@ -7072,7 +7068,6 @@ static EB_ERRORTYPE Intra4x4EncodeChromaCoeff(
MIN_PU_SIZE,
&countNonZeroCoeffs);


EncodeQuantizedCoefficientsFuncArray[!!(ASM_TYPES & PREAVX2_MASK)](
cabacEncodeCtxPtr,
MIN_PU_SIZE,
Expand Down Expand Up @@ -7101,7 +7096,6 @@ static EB_ERRORTYPE Intra4x4EncodeChromaCoeff(
MIN_PU_SIZE,
&countNonZeroCoeffs);


EncodeQuantizedCoefficientsFuncArray[!!(ASM_TYPES & PREAVX2_MASK)](
cabacEncodeCtxPtr,
MIN_PU_SIZE,
Expand Down
Loading