Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
e2e977b
Add crf ratecontrol support
kirithika7 Jan 9, 2019
ac871ee
Merge branch 'master' into master
kirithika7 Jan 17, 2019
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
07c3947
Fix for deadlock when vbv is not enabled
kirithika7 Mar 29, 2019
3df55f3
Fix compiler warnings
kirithika7 Mar 29, 2019
e3b304d
Fix for Final Bitrate is greater than TBR in Strict CBR
dinesh0603 Apr 4, 2019
603afa8
Fix:Remove the duplicated use of current frame bits for lookahead bas…
kirithika7 Apr 15, 2019
aa3d3f6
Add support for vbv-end and vbv-end-fr-adj
kirithika7 Apr 5, 2019
c82520c
Add proxy entropy coding call into Encdec process to support block le…
kirithika7 Feb 6, 2019
1397357
Create and initialize row stats structure
kirithika7 Feb 11, 2019
742a38e
Add code to assign baseqp for each LCU
kirithika7 Feb 12, 2019
6926341
Update rowstats based on the CU history
kirithika7 Feb 12, 2019
1d6bce7
Add code for Low level RC
kirithika7 Feb 26, 2019
c977220
Add code to estimate frame size at vbv checkpoints
kirithika7 Feb 13, 2019
9234146
Code clean up & removed warnings
dinesh0603 Mar 1, 2019
0560e9c
Add code to predict bits for each LCU
kirithika7 Mar 11, 2019
9703118
Fix Buffer Fill based on the lookahead buffer Fill for the current frame
kirithika7 Apr 22, 2019
01d52a4
Fix exception due to null frame rate
kirithika7 Apr 22, 2019
501e5a4
Move the low-level QP calculation after MD Fix the confromant part fo…
anaghdin Mar 12, 2019
037d7c2
Add cli support to enable/disable low level vbv
kirithika7 Mar 19, 2019
d1b7dea
Add additional checks for -low-level-vbv introduced
kirithika7 Mar 19, 2019
5a8dc53
Fix the run time error "No RC interval found" when
kirithika7 Apr 29, 2019
d55a18b
Fix: Reset encodedBitsSoFar to 0 before recomputing frame size
kirithika7 Apr 29, 2019
e337b62
Merge branch with Master (Commit:97eafda)
dinesh0603 May 30, 2019
f7ebfc3
-Modified code as per review comments and coding guidelines
dinesh0603 May 30, 2019
c5cdcfe
Fix for Deadlock
dinesh0603 May 31, 2019
beda1ec
Remove the macro PACK_FEEDBACK
anaghdin Mar 27, 2019
d1386a6
Implement 16x16 SATD C and AVX2 functions.
LuanZhanKuangGe Jun 6, 2019
2442880
Fix compiler errors on Linux.
LuanZhanKuangGe Jun 6, 2019
c8e2fcd
Fixed hrd 1 crash issues caused by writeUvlc long bits, memmove and S…
Jun 11, 2019
20e2bf9
Merge CRF branch with master
dinesh0603 Jun 13, 2019
6431e5c
Merge CRF with Master Tip(commit:054b1bf)
dinesh0603 Jun 13, 2019
80d1d8a
Modifed code as per coding guidelines
dinesh0603 Jun 14, 2019
8997bc3
Merge branch VBV Code with CRF
dinesh0603 Jun 20, 2019
8570171
Merge branch 'master' into master
tianjunwork Jun 25, 2019
ceb6347
Fix linux build errors
kavithasampath Jun 27, 2019
5bb446b
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC
kirithika7 Jul 10, 2019
c9ce68b
Cleanup unused variables
kirithika7 Jul 10, 2019
5f95710
Update CMakeLists.txt
kirithika7 Jul 10, 2019
015a2bc
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC
kirithika7 Jul 10, 2019
1165741
Revert "Update CMakeLists.txt "
kirithika7 Jul 10, 2019
5e6e924
Fix make error caught while linking math library
kirithika7 Jul 15, 2019
d3d530c
Fix SVT-HEVC ffmpeg integration error
kirithika7 Jul 15, 2019
85a36e2
Fix license header in newly added files
kirithika7 Jul 30, 2019
c5bd916
Fix initialization of Neighbor arrays in EstimateLcu()
kirithika7 Aug 1, 2019
e393fd0
Update Estimatelcu() to that of master
kirithika7 Aug 8, 2019
d499b4f
Fix the Encoder crash when Frames exceeds the CircularQueue length
kirithika7 Aug 9, 2019
c710fc5
Remove reassignment of lcu qp by Entropy process
kirithika7 Aug 9, 2019
84979ba
Fix reset of Row stats once per picture
kirithika7 Aug 9, 2019
b6ae721
Use Sad Interval Index updated by Motion Estimation Process for LCU b…
kirithika7 Aug 9, 2019
ce88bc4
Clean up
kirithika7 Aug 9, 2019
b07731f
Revert vbv-end and vbv end frame adjust option
kirithika7 Aug 10, 2019
1e85639
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC
kirithika7 Aug 10, 2019
ef9c29a
Cleanup unneccesary file changes
kirithika7 Aug 10, 2019
c849c55
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC
kirithika7 Aug 12, 2019
72a99e9
Cleanup the usage of a udeclared variable
kirithika7 Aug 12, 2019
c16092c
Enable Low level VBV only if frame level VBV is enabled and remove re…
kirithika7 Aug 12, 2019
c0b0ece
Fix inconsistent line endings in EbEncDecProcess.c
kirithika7 Aug 12, 2019
1335e73
Remove the SATD asm implementation
kirithika7 Aug 12, 2019
40a5f97
Move PredictBits() to a new file to remove redundant copy of it as Pr…
kirithika7 Aug 12, 2019
ce4672c
Remove unused variable rowIndex+Move tempCoeffPtr assignment after
kirithika7 Aug 13, 2019
3ee527f
Add Macro for Rc Tolerance and Step size values + Add VBV control to…
kirithika7 Aug 14, 2019
a5d6a00
Add code for planning VBV Buffer Fullness after lookahead VBV to use …
kirithika7 Aug 14, 2019
a984744
Restrict low level vbv when lookahead predictions are not done + enab…
kirithika7 Aug 14, 2019
8c2612f
Merge branch 'master' of https://github.com/OpenVisualCloud/SVT-HEVC
kirithika7 Aug 14, 2019
2e231e2
Fix build error + update BKC for frame level VBV
kirithika7 Aug 14, 2019
a218fa7
Remove -DPIC as it is not needed for SATD C implementation
kirithika7 Aug 15, 2019
93f6794
Merge branch 'master' into master
tianjunwork Oct 17, 2019
e93b4e9
Fixed the compiling errors/warnings for rebasing PR #70.
Austin-Hu Oct 17, 2019
b7effc8
Refined the CRF usage.
Austin-Hu Oct 17, 2019
8ba809c
Update EbEncHandle.c
Austin-Hu Oct 18, 2019
7135294
Fixed some rebasing errors in EbEncDecProcess.c
Austin-Hu Oct 24, 2019
79f187c
Merge branch 'master' into master
Austin-Hu Nov 4, 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
Prev Previous commit
Next Next commit
Add support for strict cbr to prevent hrd buffer overflow
  • Loading branch information
kirithika7 authored and dinesh0603 committed Mar 19, 2019
commit 5f52a2f4b8dd61bf2f92e5d2171baefe7b9b69b5
2 changes: 2 additions & 0 deletions Source/Lib/Codec/EbDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,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
17 changes: 17 additions & 0 deletions Source/Lib/Codec/EbEntropyCoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -8402,6 +8402,23 @@ EB_ERRORTYPE EncodeActiveParameterSetsSEI(
return return_error;
}

EB_ERRORTYPE EncodeFillerData(
Bitstream_t *bitstreamPtr,
EB_U32 fillerBytes,
EB_U8 temporalId)
{
EB_ERRORTYPE return_error = EB_ErrorNone;
unsigned payloadType = FILLER_PAYLOAD;

OutputBitstreamUnit_t *outputBitstreamPtr = (OutputBitstreamUnit_t*)bitstreamPtr->outputBitstreamPtr;

CodeNALUnitHeader(
outputBitstreamPtr,
NAL_UNIT_FILLER_DATA,
temporalId);
return return_error;
}

EB_ERRORTYPE EncodeRegUserDataSEI(
Bitstream_t *bitstreamPtr,
RegistedUserData_t *regUserDataSeiPtr)
Expand Down
4 changes: 4 additions & 0 deletions Source/Lib/Codec/EbEntropyCoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ extern EB_ERRORTYPE EncodeActiveParameterSetsSEI(
Bitstream_t *bitstreamPtr,
AppActiveparameterSetSei_t *activeParameterSet);

extern EB_ERRORTYPE EncodeFillerData(
Bitstream_t *bitstreamPtr,
EB_U32 fillerBytes,
EB_U8 temporalId);

extern EB_ERRORTYPE EncodeRegUserDataSEI(
Bitstream_t *bitstreamPtr,
Expand Down
79 changes: 74 additions & 5 deletions Source/Lib/Codec/EbPacketizationProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ void* PacketizationKernel(void *inputPtr)

EB_PICTURE sliceType;
EB_U64 refDecOrder = 0;
EB_U64 filler;
EB_U32 fillerBytes;
for(;;) {

// Get EntropyCoding Results
Expand Down Expand Up @@ -657,6 +659,8 @@ void* PacketizationKernel(void *inputPtr)
EB_U32 bufferWrittenBytesCount = 0;
EB_U32 startinBytes = 0;
EB_U32 totalBytes = 0;
EB_U64 buffer=0;
EB_U64 bufferRate = 0;
EbFinishTime((uint64_t*)&finishTimeSeconds, (uint64_t*)&finishTimeuSeconds);

EbComputeOverallElapsedTimeMs(
Expand Down Expand Up @@ -712,7 +716,6 @@ void* PacketizationKernel(void *inputPtr)
{
refDecOrder = queueEntryPtr->pictureNumber;
}
EbPostFullObject(outputStreamWrapperPtr);
/* update VBV plan */
EbBlockOnMutex(encodeContextPtr->bufferFillMutex);
if (encodeContextPtr->vbvMaxrate && encodeContextPtr->vbvBufsize)
Expand All @@ -721,13 +724,79 @@ void* PacketizationKernel(void *inputPtr)

bufferfill_temp -= queueEntryPtr->actualBits;
bufferfill_temp = MAX(bufferfill_temp, 0);
bufferfill_temp = (EB_S64)(bufferfill_temp + (encodeContextPtr->vbvMaxrate * (1.0 / (sequenceControlSetPtr->frameRate >> RC_PRECISION))));
buffer=bufferfill_temp = (EB_S64)(bufferfill_temp + (encodeContextPtr->vbvMaxrate * (1.0 / (sequenceControlSetPtr->frameRate >> RC_PRECISION))));
bufferfill_temp = MIN(bufferfill_temp, encodeContextPtr->vbvBufsize);
encodeContextPtr->bufferFill = (EB_U64)(bufferfill_temp);

EbReleaseMutex(encodeContextPtr->bufferFillMutex);
bufferRate = encodeContextPtr->vbvMaxrate / (sequenceControlSetPtr->staticConfig.frameRate >> 16);
//Block to write filler data to prevent cpb overflow
if ((sequenceControlSetPtr->staticConfig.vbvMaxrate == sequenceControlSetPtr->staticConfig.targetBitRate)&& !(outputStreamPtr->nFlags & EB_BUFFERFLAG_EOS))
{
if (buffer > encodeContextPtr->vbvBufsize)
{
filler = buffer - encodeContextPtr->vbvBufsize;
fillerBytes = ((EB_U32)(filler >> 3)) - FILLER_DATA_OVERHEAD;
// Reset the bitstream
ResetBitstream(queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);

EncodeFillerData(queueEntryPtr->bitStreamPtr2, fillerBytes, queueEntryPtr->picTimingEntry->temporalId);

// Flush the Bitstream
FlushBitstream(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);

// Copy filler bits to the Output Bitstream
CopyRbspBitstreamToPayload(
queueEntryPtr->bitStreamPtr2,
outputStreamPtr->pBuffer,
(EB_U32*) &(outputStreamPtr->nFilledLen),
(EB_U32*) &(outputStreamPtr->nAllocLen),
encodeContextPtr);

for (EB_U32 i = 0; i < fillerBytes; i++)
{
ResetBitstream(queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
// Flush the Bitstream
OutputBitstreamWrite(queueEntryPtr->bitStreamPtr2->outputBitstreamPtr, 0xff, 8);
FlushBitstream(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
CopyRbspBitstreamToPayload(
queueEntryPtr->bitStreamPtr2,
outputStreamPtr->pBuffer,
(EB_U32*) &(outputStreamPtr->nFilledLen),
(EB_U32*) &(outputStreamPtr->nAllocLen),
encodeContextPtr);
}
ResetBitstream(queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
// Byte Align the Bitstream: rbsp_trailing_bits
OutputBitstreamWrite(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr,
1,
1);
FlushBitstream(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
CopyRbspBitstreamToPayload(
queueEntryPtr->bitStreamPtr2,
outputStreamPtr->pBuffer,
(EB_U32*) &(outputStreamPtr->nFilledLen),
(EB_U32*) &(outputStreamPtr->nAllocLen),
encodeContextPtr);
ResetBitstream(queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
OutputBitstreamWriteAlignZero(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
// Flush the Bitstream
FlushBitstream(
queueEntryPtr->bitStreamPtr2->outputBitstreamPtr);
CopyRbspBitstreamToPayload(
queueEntryPtr->bitStreamPtr2,
outputStreamPtr->pBuffer,
(EB_U32*) &(outputStreamPtr->nFilledLen),
(EB_U32*) &(outputStreamPtr->nAllocLen),
encodeContextPtr);
}
}
}
EbReleaseMutex(encodeContextPtr->bufferFillMutex);

EbPostFullObject(outputStreamWrapperPtr);
// Reset the Reorder Queue Entry
queueEntryPtr->pictureNumber += PACKETIZATION_REORDER_QUEUE_MAX_DEPTH;
queueEntryPtr->outputStreamWrapperPtr = (EbObjectWrapper_t *)EB_NULL;
Expand Down