fix #16 and mode a

This commit is contained in:
Christian R. Helmrich 2020-11-28 22:00:01 +01:00
parent 7f47aaab53
commit c71ec4805a
7 changed files with 15 additions and 11 deletions

View File

@ -31,10 +31,10 @@ License
-------
exhale is being made available under an open-source license which is
similar to the 3-clause BSD license but modified to address specific
based on the 3-clause BSD license but modified to address particular
aspects dictated by the nature and the output of this application.
The license text and release notes for the current version 1.1RC can
The license text and release notes for the current version 1.1.0 can
be found in the `include` subdirectory of the exhale distribution.

View File

@ -25,9 +25,9 @@
<td valign="top">
<h1><br><span class="pink">exhale</span> - <span class="pink">e</span>codis e<span class="pink">x</span>tended <span class="pink">h</span>igh-efficiency <span class="pink">a</span>nd <span class="pink">l</span>ow-complexity <span class="pink">e</span>ncoder<br><span class="gray"><sup><br>Software Release Notes, Version History, Known Issues, Upcoming Feature Roadmap</sup></span><br><br></h1>
<h3>&nbsp; &nbsp;The version of this distribution of the &laquo;exhale&raquo; software release is <b>1.1RC</b> (preliminary pub&shy;lic major release) from Nov. 2020. Please check <a href="http://www.ecodis.de/audio.htm#mpeg">www.ecodis.de</a> regularly for new versions of this software. A summary of each version up to this release, a list of known issues with this release, and a roadmap of additional functionality are provided below.</h3>
<h3>&nbsp; &nbsp;The version of this distribution of the &laquo;exhale&raquo; software release is <b>1.1.0</b> (official pub&shy;lic major release) from Nov. 2020. Please check <a href="http://www.ecodis.de/audio.htm#mpeg">www.ecodis.de</a> regularly for new versions of this software. A summary of each version up to this release, a list of known issues with this release, and a roadmap of additional functionality are provided below.</h3>
<h3><br><b>Chronological Version History</b></h3>
<h3>&nbsp; &nbsp;Version <b>1.1RC <span class="gray">Nov. 2020, this release</span></b></h3>
<h3>&nbsp; &nbsp;Version <b>1.1.0 <span class="gray">&nbsp;Nov. 2020, this release</span></b></h3>
<ul>
<li><h3>addition of basic SBR functionality for lower-rate coding down to 18 kbps/channel</h3></li>
<li><h3>exhaleApp: add support for CVBR modes a&#x2014;g for encoding with SBR functionality</h3></li>
@ -112,13 +112,14 @@
<h3><br><b>Roadmap of Upcoming Features</b></h3>
<h3>&nbsp; &nbsp;If you are in need of an additional library or application feature <b>not</b> mentioned below, please contact ecodis or a contributor with a request, and we will see what we can do.</h3>
<ul>
<li><h3>calculate<sup> </sup>/<sup> </sup>code SBR envelope values at higher frequency resolution, version 1.1.x</h3></li>
<li><h3>support for coding with a core coder frame length of 768 samples, no version plan</h3></li>
<li><h3>exhaleLib: complete integration of predictive joint-channel coding, no version plan</h3></li>
<li><h3>exhaleLib: finalization of support for 5.1&#x2013;7.1 multichannel coding, no version plan</h3></li>
<li><h3>exhaleLib: speed-ups and further quality tuning for difficult signals, as necessary.</h3></li>
</ul>
<h3><br></h3>
<h4><span class="gray">Written by C. R. Helmrich for exhale 1.1RC, Nov. 2020. Available at www.ecodis.de/exhale/release.htm.</span><br><br></h4>
<h4><span class="gray">Written by C. R. Helmrich for exhale 1.1.0, Nov. 2020. Available at www.ecodis.de/exhale/release.htm.</span><br><br></h4>
</td>
<td valign="top" colspan="2">

View File

@ -15,5 +15,5 @@
# define EXHALELIB_VERSION_MINOR "1"
#endif
#ifndef EXHALELIB_VERSION_BUGFIX
# define EXHALELIB_VERSION_BUGFIX "RC" // "RC" or ".0", ".1", ...
# define EXHALELIB_VERSION_BUGFIX ".0" // "RC" or ".0", ".1", ...
#endif

View File

@ -435,7 +435,7 @@ unsigned BitAllocator::imprSfbStepSizes (const SfbGroupData* const groupData[USA
const SfbGroupData& grpData = *groupData[ch];
const uint32_t maxSfbInCh = __min (MAX_NUM_SWB_LONG, grpData.sfbsPerGroup);
const bool eightShorts = (grpData.numWindowGroups != 1);
const bool lowRateTuning = (samplingRate >= 27713) && (sfm[ch] <= (SCHAR_MAX >> 1));
const bool lowRateTuning = (samplingRate >= 25495) && (sfm[ch] <= (SCHAR_MAX >> 1));
const uint32_t* rms = grpData.sfbRmsValues;
uint32_t* stepSizes = &sfbStepSizes[ch * numSwbShort * NUM_WINDOW_GROUPS];

View File

@ -282,8 +282,11 @@ static inline unsigned arithGetPkIndex (const unsigned ctx) // cumul. frequency
static inline unsigned writeSymbol (OutputStream* const stream, const bool leadingBitIs1, const uint16_t trailingBits)
{
const uint8_t lowBits = trailingBits & 0x1F;
stream->write (leadingBitIs1 ? 1 : 0, 1);
stream->write (leadingBitIs1 ? 0 : (1u << trailingBits) - 1, (uint8_t) trailingBits);
stream->write (leadingBitIs1 ? 0 : UINT_MAX, trailingBits & 0x20);
stream->write (leadingBitIs1 ? 0 : (1u << lowBits) - 1u, lowBits);
return trailingBits + 1; // count
}

View File

@ -464,7 +464,7 @@ static const uint8_t tnsScaleFactorBandLimit[2 /*long/short*/][USAC_NUM_FREQ_TAB
#endif
};
static const uint8_t sbrRateOffset[10] = {8, 6, 6, 8, 7, 8, 8, 8, 8, 8}; // used for scaleSBR
static const uint8_t sbrRateOffset[10] = {7, 6, 6, 8, 7, 8, 8, 8, 8, 8}; // used for scaleSBR
// scale_factor_grouping map
// group lengths based on transient location: 1133, 1115, 2114, 3113, 4112, 5111, 3311, 1331
@ -773,7 +773,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s
const uint16_t scaleSBR = (m_shiftValSBR > 0 || m_nonMpegExt ? sbrRateOffset[m_bitRateMode] : 0); // -25% rate
const uint64_t scaleSr = (samplingRate < 27713 ? (samplingRate < 23004 ? 32 : 34) - __min (3 << m_shiftValSBR, m_bitRateMode)
: (samplingRate < 37566 && m_bitRateMode != 3u ? 36 : 37)) - (nChannels >> 1);
const uint64_t scaleBr = (m_bitRateMode == 0 ? __min (32, 3 + (samplingRate >> 10) + (samplingRate >> 13) - (nChannels >> 1))
const uint64_t scaleBr = (m_bitRateMode == 0 ? __min (32, 17u + (((samplingRate + (1 << 11)) >> 12) << 1) - (nChannels >> 1))
: scaleSr - eightTimesSqrt256Minus[256 - m_bitRateMode] - __min (3, (m_bitRateMode - 1) >> 1)) + scaleSBR;
uint32_t* sfbStepSizes = (uint32_t*) m_tempIntBuf;
uint8_t meanSpecFlat[USAC_MAX_NUM_CHANNELS];

View File

@ -20,7 +20,7 @@ void OutputStream::reset () // clear writer states and byte buffer
void OutputStream::write (const uint32_t bitChunk, const uint8_t bitCount)
{
if (bitCount > 32) return; // only a maximum of 32 bits is writable at once
if (bitCount == 0) return; // nothing to do for length 0, max. length is 32
const uint8_t totalBitCount = bitCount + heldBitCount;
const uint8_t totalByteCount = totalBitCount >> 3; // to be written