aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-12-13 05:45:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-12-13 05:45:20 +0000
commitc75797cfaa5199247c53cf40dcc3329e6cdf3cce (patch)
tree35b2bf867a84f3a12f791c43de60e55c7e77bfb4 /libFDK
parentcdaf85d874abe9b772b2a3bbef7fadee9199bdc3 (diff)
parent20c336953febeabbf6deeb38f479ec7642b5a69b (diff)
downloadfdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.tar.gz
fdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.tar.bz2
fdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.zip
Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
Diffstat (limited to 'libFDK')
-rw-r--r--libFDK/include/FDK_bitbuffer.h6
-rw-r--r--libFDK/include/FDK_bitstream.h46
-rw-r--r--libFDK/src/FDK_bitbuffer.cpp29
3 files changed, 0 insertions, 81 deletions
diff --git a/libFDK/include/FDK_bitbuffer.h b/libFDK/include/FDK_bitbuffer.h
index ed0b2f6..19a24b3 100644
--- a/libFDK/include/FDK_bitbuffer.h
+++ b/libFDK/include/FDK_bitbuffer.h
@@ -113,7 +113,6 @@ typedef struct {
UINT ValidBits;
UINT ReadOffset;
UINT WriteOffset;
- UINT BitCnt;
UINT BitNdx;
UCHAR *Buffer;
@@ -159,15 +158,10 @@ void FDK_pushBack(HANDLE_FDK_BITBUF hBitBuffer, const UINT numberOfBits,
void FDK_pushForward(HANDLE_FDK_BITBUF hBitBuffer, const UINT numberOfBits,
UCHAR config);
-void FDK_byteAlign(HANDLE_FDK_BITBUF hBitBuffer, UCHAR config);
-
UINT FDK_getValidBits(HANDLE_FDK_BITBUF hBitBuffer);
INT FDK_getFreeBits(HANDLE_FDK_BITBUF hBitBuffer);
-void FDK_setBitCnt(HANDLE_FDK_BITBUF hBitBuffer, const UINT value);
-INT FDK_getBitCnt(HANDLE_FDK_BITBUF hBitBuffer);
-
void FDK_Feed(HANDLE_FDK_BITBUF hBitBuffer, const UCHAR inputBuffer[],
const UINT bufferSize, UINT *bytesValid);
diff --git a/libFDK/include/FDK_bitstream.h b/libFDK/include/FDK_bitstream.h
index 49eeeaf..f799026 100644
--- a/libFDK/include/FDK_bitstream.h
+++ b/libFDK/include/FDK_bitstream.h
@@ -481,21 +481,6 @@ FDK_INLINE void FDKsyncCacheBwd(HANDLE_FDK_BITSTREAM hBitStream) {
}
/**
- * \brief Byte Alignment Function.
- * This function performs the byte_alignment() syntactic function on the
- * input stream, i.e. some bits will be discarded/padded so that the next bits
- * to be read/written will be aligned on a byte boundary with respect to
- * the bit position 0.
- *
- * \param hBitStream HANDLE_FDK_BITSTREAM handle
- * \return void
- */
-FDK_INLINE void FDKbyteAlign(HANDLE_FDK_BITSTREAM hBitStream) {
- FDKsyncCache(hBitStream);
- FDK_byteAlign(&hBitStream->hBitBuf, (UCHAR)hBitStream->ConfigCache);
-}
-
-/**
* \brief Byte Alignment Function with anchor
* This function performs the byte_alignment() syntactic function on the
* input stream, i.e. some bits will be discarded so that the next bits to be
@@ -604,37 +589,6 @@ FDK_INLINE INT FDKgetFreeBits(HANDLE_FDK_BITSTREAM hBitStream) {
}
/**
- * \brief reset bitcounter in bitBuffer to zero.
- * \param hBitStream HANDLE_FDK_BITSTREAM handle
- * \return void
- */
-FDK_INLINE void FDKresetBitCnt(HANDLE_FDK_BITSTREAM hBitStream) {
- FDKsyncCache(hBitStream);
- FDK_setBitCnt(&hBitStream->hBitBuf, 0);
-}
-
-/**
- * \brief set bitcoutner in bitBuffer to given value.
- * \param hBitStream HANDLE_FDK_BITSTREAM handle
- * \param value new value to be assigned to the bit counter
- * \return void
- */
-FDK_INLINE void FDKsetBitCnt(HANDLE_FDK_BITSTREAM hBitStream, UINT value) {
- FDKsyncCache(hBitStream);
- FDK_setBitCnt(&hBitStream->hBitBuf, value);
-}
-
-/**
- * \brief get bitcounter state from bitBuffer.
- * \param hBitStream HANDLE_FDK_BITSTREAM handle
- * \return current bit counter value
- */
-FDK_INLINE INT FDKgetBitCnt(HANDLE_FDK_BITSTREAM hBitStream) {
- FDKsyncCache(hBitStream);
- return FDK_getBitCnt(&hBitStream->hBitBuf);
-}
-
-/**
* \brief Fill the BitBuffer with a number of input bytes from external source.
* The bytesValid variable returns the number of ramaining valid bytes in
* extern inputBuffer.
diff --git a/libFDK/src/FDK_bitbuffer.cpp b/libFDK/src/FDK_bitbuffer.cpp
index a990c58..98905ea 100644
--- a/libFDK/src/FDK_bitbuffer.cpp
+++ b/libFDK/src/FDK_bitbuffer.cpp
@@ -128,7 +128,6 @@ void FDK_InitBitBuffer(HANDLE_FDK_BITBUF hBitBuf, UCHAR *pBuffer, UINT bufSize,
hBitBuf->ValidBits = validBits;
hBitBuf->ReadOffset = 0;
hBitBuf->WriteOffset = 0;
- hBitBuf->BitCnt = 0;
hBitBuf->BitNdx = 0;
hBitBuf->Buffer = pBuffer;
@@ -151,7 +150,6 @@ void FDK_ResetBitBuffer(HANDLE_FDK_BITBUF hBitBuf) {
hBitBuf->ValidBits = 0;
hBitBuf->ReadOffset = 0;
hBitBuf->WriteOffset = 0;
- hBitBuf->BitCnt = 0;
hBitBuf->BitNdx = 0;
}
@@ -161,7 +159,6 @@ INT FDK_get(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits) {
UINT bitOffset = hBitBuf->BitNdx & 0x07;
hBitBuf->BitNdx = (hBitBuf->BitNdx + numberOfBits) & (hBitBuf->bufBits - 1);
- hBitBuf->BitCnt += numberOfBits;
hBitBuf->ValidBits -= numberOfBits;
UINT byteMask = hBitBuf->bufSize - 1;
@@ -184,7 +181,6 @@ INT FDK_get(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits) {
INT FDK_get32(HANDLE_FDK_BITBUF hBitBuf) {
UINT BitNdx = hBitBuf->BitNdx + 32;
hBitBuf->BitNdx = BitNdx & (hBitBuf->bufBits - 1);
- hBitBuf->BitCnt += 32;
hBitBuf->ValidBits = (UINT)((INT)hBitBuf->ValidBits - (INT)32);
UINT byteOffset = (BitNdx - 1) >> 3;
@@ -223,7 +219,6 @@ INT FDK_getBwd(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits) {
int i;
hBitBuf->BitNdx = (hBitBuf->BitNdx - numberOfBits) & (hBitBuf->bufBits - 1);
- hBitBuf->BitCnt -= numberOfBits;
hBitBuf->ValidBits += numberOfBits;
UINT tx = hBitBuf->Buffer[(byteOffset - 3) & byteMask] << 24 |
@@ -256,7 +251,6 @@ void FDK_put(HANDLE_FDK_BITBUF hBitBuf, UINT value, const UINT numberOfBits) {
UINT bitOffset = hBitBuf->BitNdx & 0x7;
hBitBuf->BitNdx = (hBitBuf->BitNdx + numberOfBits) & (hBitBuf->bufBits - 1);
- hBitBuf->BitCnt += numberOfBits;
hBitBuf->ValidBits += numberOfBits;
UINT byteMask = hBitBuf->bufSize - 1;
@@ -307,7 +301,6 @@ void FDK_putBwd(HANDLE_FDK_BITBUF hBitBuf, UINT value,
int i;
hBitBuf->BitNdx = (hBitBuf->BitNdx - numberOfBits) & (hBitBuf->bufBits - 1);
- hBitBuf->BitCnt -= numberOfBits;
hBitBuf->ValidBits -= numberOfBits;
/* in place turn around */
@@ -344,7 +337,6 @@ void FDK_putBwd(HANDLE_FDK_BITBUF hBitBuf, UINT value,
#ifndef FUNCTION_FDK_pushBack
void FDK_pushBack(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits,
UCHAR config) {
- hBitBuf->BitCnt = (UINT)((INT)hBitBuf->BitCnt - (INT)numberOfBits);
hBitBuf->ValidBits =
(config == 0) ? (UINT)((INT)hBitBuf->ValidBits + (INT)numberOfBits)
: ((UINT)((INT)hBitBuf->ValidBits - (INT)numberOfBits));
@@ -355,7 +347,6 @@ void FDK_pushBack(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits,
void FDK_pushForward(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits,
UCHAR config) {
- hBitBuf->BitCnt = (UINT)((INT)hBitBuf->BitCnt + (INT)numberOfBits);
hBitBuf->ValidBits =
(config == 0) ? ((UINT)((INT)hBitBuf->ValidBits - (INT)numberOfBits))
: (UINT)((INT)hBitBuf->ValidBits + (INT)numberOfBits);
@@ -363,19 +354,6 @@ void FDK_pushForward(HANDLE_FDK_BITBUF hBitBuf, const UINT numberOfBits,
(UINT)((INT)hBitBuf->BitNdx + (INT)numberOfBits) & (hBitBuf->bufBits - 1);
}
-void FDK_byteAlign(HANDLE_FDK_BITBUF hBitBuf, UCHAR config) {
- INT alignment = hBitBuf->BitCnt & 0x07;
-
- if (alignment) {
- if (config == 0)
- FDK_pushForward(hBitBuf, 8 - alignment, config); /* BS_READER */
- else
- FDK_put(hBitBuf, 0, 8 - alignment); /* BS_WRITER */
- }
-
- hBitBuf->BitCnt = 0;
-}
-
#ifndef FUNCTION_FDK_getValidBits
UINT FDK_getValidBits(HANDLE_FDK_BITBUF hBitBuf) { return hBitBuf->ValidBits; }
#endif /* #ifndef FUNCTION_FDK_getValidBits */
@@ -384,12 +362,6 @@ INT FDK_getFreeBits(HANDLE_FDK_BITBUF hBitBuf) {
return (hBitBuf->bufBits - hBitBuf->ValidBits);
}
-void FDK_setBitCnt(HANDLE_FDK_BITBUF hBitBuf, const UINT value) {
- hBitBuf->BitCnt = value;
-}
-
-INT FDK_getBitCnt(HANDLE_FDK_BITBUF hBitBuf) { return hBitBuf->BitCnt; }
-
void FDK_Feed(HANDLE_FDK_BITBUF hBitBuf, const UCHAR *RESTRICT inputBuffer,
const UINT bufferSize, UINT *bytesValid) {
inputBuffer = &inputBuffer[bufferSize - *bytesValid];
@@ -438,7 +410,6 @@ void CopyAlignedBlock(HANDLE_FDK_BITBUF h_BitBufSrc, UCHAR *RESTRICT dstBuffer,
h_BitBufSrc->BitNdx =
(h_BitBufSrc->BitNdx + bToRead) & (h_BitBufSrc->bufBits - 1);
- h_BitBufSrc->BitCnt += bToRead;
h_BitBufSrc->ValidBits -= bToRead;
}