mode 0/9 tunings

This commit is contained in:
Christian R. Helmrich 2020-10-23 10:00:00 +02:00
parent 9323a9d0e8
commit a43f9b31f7
14 changed files with 60 additions and 55 deletions

View File

@ -1,12 +1,12 @@
# CMakeLists.txt - Main CMake file that defines how cmake should process and generate the necessary build files
# written by C. D. Degawa, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under a Modified BSD-Style License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#
# Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved.
#
## CMakeLists.txt - Main CMake file that defines how cmake should process and generate the necessary build files
# written by C. D. Degawa, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under the exhale Copyright License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#
# Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved.
##
cmake_minimum_required(VERSION 3.5) # Default version of cmake on Ubuntu 16.04
@ -16,7 +16,7 @@ if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
endif()
project(exhale VERSION 1.0.7 LANGUAGES CXX)
project(exhale VERSION 1.0.8 LANGUAGES CXX)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release

View File

@ -34,7 +34,7 @@ exhale is being made available under an open-source license which is
similar to the 3-clause BSD license but modified to address specific
aspects dictated by the nature and the output of this application.
The license text and release notes for the current version 1.0.7 can
The license text and release notes for the current version 1.0.8 can
be found in the `include` subdirectory of the exhale distribution.

View File

@ -24,22 +24,23 @@
<td colspan="2"></td>
<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>referred to as &laquo;Software&raquo; below; additions to original BSD license text marked by [ ]</sup></span><br><br></h1>
<h3>&nbsp; &nbsp;This Software is being made available and/or distributed under the following Modified <a href="http://www.linfo.org/bsdlicense.html">BSD</a>-style License. For a list of authors which have contributed to this Software, called &laquo;contributors&raquo; in the text below, please refer to the respective files provided with this distribution (source files or binary executable) to which modifications were contributed.</h3>
<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>referred to as &laquo;Software&raquo; below; clarifications introduced in October 2020 in <i>italics</i></sup></span><br><br></h1>
<h3>&nbsp; &nbsp;This Software is being made available and/or distributed under the following <i>exhale Copyright</i> License. For a list of authors which have contributed to this Software, called &laquo;contributors&raquo; in the text below, please refer to the respective files provided with this distribution (source files or binary executable) to which modifications were contributed.</h3>
<h3><br><b>Licensor's Copyright Notice</b></h3>
<h3>&nbsp; &nbsp;Copyright &copy; 2018&#x2013;2020 Christian R. Helmrich, <a href="http://www.ecodis.de">ecodis</a> (Licensor). All rights reserved.</h3>
<h3><br><b>List of License Conditions</b></h3>
<h3>&nbsp; &nbsp;Redistribution and use <span class="gray">[</span>of this Software<span class="gray">]</span> in source and binary forms, with or without modification, are permitted provided that<sub>&nbsp;</sub><span class="gray">[</span>all of<span class="gray">]</span><sub>&nbsp;</sub>the following<sub>&nbsp;</sub><span class="gray">[</span>four<span class="gray">]</span><sub>&nbsp;</sub>conditions are met:</h3>
<h3>&nbsp; &nbsp;Redistribution and use of this Software in source and binary forms, with or without modification, are permitted provided that all of the following four conditions are met:</h3>
<ul>
<li><h3>Redistributions of source code must retain the above copyright notice <span class="gray">[</span>in each file provided with the distribution<span class="gray">]</span>, this list of conditions, and the following disclaimer.</h3></li>
<li><h3>Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other files provided with the distribution.</h3></li>
<li><h3><span class="gray">[</span>Redistributions of modified versions of this Software, whether in source or binary form, must reproduce a notice in each file provided with the distribution and affec&shy;ted by the modification, documenting the name of the contributor having authored the modification and the year of the modification.<span class="gray">]</span></h3></li>
<li><h3>Neither the name of the Licensor nor the names of the contributors may be used to endorse or promote products derived from this Software without specific prior written permission <span class="gray">[</span>from the Licensor<span class="gray">]</span>.</h3></li>
<li><h3>Redistributions of source code must retain the above copyright notice in each file provided with the distribution, this list of conditions, and the following disclaimer<i>s</i>.</h3></li>
<li><h3>Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer<i>s</i> in the documentation and/or other files provided with the distribution.</h3></li>
<li><h3>Redistributions of modified versions of this Software, whether in source or binary form, must reproduce a notice in each file provided with the distribution and affec&shy;ted by the modification, documenting the name of the contributor having authored the modification and the year of the modification.</h3></li>
<li><h3>Neither the name of the Licensor nor the names of the contributors may be used to endorse or promote products derived from this Software without specific prior written permission from the Licensor <i>or the contributors, respectively</i>.</h3></li>
</ul>
<h3><br><b>Liability and Patent Disclaimer</b></h3>
<h3>&nbsp; &nbsp;THIS SOFTWARE IS PROVIDED BY THE LICENSOR AND THE CONTRIBUTORS &laquo;<b>AS IS</b>&raquo; AND ANY EXPRESS OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR&shy;POSE) ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</h3>
<h3>&nbsp; <span class="gray">[</span>This Software may be subject to other third-party and/or contributor rights, including patent rights. In particular, this Software may implement methods and/or technologies required to perform in compliance with certain specifications of the ISO/IEC (MPEG-D) international standard <a href="https://www.iso.org/standard/76385.html">23003-3</a>, which may be subject to said other rights. NO express or implied licenses to any patent claims related to the use of this Software are granted under this license, and the Licensor provides NO WARRANTY of patent non-infringement with respect to this Software. Patent licenses required for the use of this Software to generate digital bit-streams according to any specifications of ISO/IEC 23003-3 may be obtained through <a href="https://www.via-corp.com/licensing/aac/">Via Licensing</a> and/or the corresponding patent holders individually.<span class="gray">]</span><br><br></h3>
<h4><span class="gray">Written by C. R. Helmrich for exhale 1.0.0, Jan. 2020. Available at www.ecodis.de/exhale/license.htm.</span><br><br></h4>
<h3><br><b><i>No Patents Granted</i> Disclaimer</b></h3>
<h3>&nbsp; &nbsp;This Software may be subject to other third-party and/or contributor rights, including patent rights. In particular, this Software may implement methods and/or technologies required to perform in compliance with certain specifications of the ISO/IEC (MPEG-D) international standard<i>s</i> <a href="https://www.iso.org/standard/76385.html">23003</a>, which may be subject to said other rights. NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS related to the use of this Software ARE GRANTED <i>BY THIS SOFTWARE</i> LICENSE, AND THE LICENSOR <i>AND THE CONTRIBUTORS</i> PROVIDE NO WARRANTY OF PATENT NON-INFRINGEMENT with respect to this Software. <i>You may use this Software or modifications thereto only for purposes authorized by appropriate patent licenses.</i> Patent licenses required for the use of this Software to generate digital bit-streams according to any specifications of ISO/IEC 23003 may be obtained through <a href="https://www.via-corp.com/licensing/aac/">Via Licensing</a> and/or the corresponding patent holders individually.</h3>
<h3><br><b><i>Software Liability</i> Disclaimer</b></h3>
<h3>&nbsp; &nbsp;THIS SOFTWARE IS PROVIDED BY THE LICENSOR AND THE CONTRIBUTORS &laquo;<b>AS IS</b>&raquo; AND ANY EXPRESS OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR&shy;POSE) ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br><br></h3>
<h4><span class="gray">Written by C. R. Helmrich for exhale 1.0.8, Oct. 2020. Available at www.ecodis.de/exhale/license.htm.</span><br><br></h4>
</td>
<td valign="top" colspan="2">

View File

@ -25,9 +25,16 @@
<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.0.7</b> (official pub&shy;lic minor release) from August 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.0.8</b> (official pub&shy;lic minor release) from October 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.0.7 <span class="gray">&nbsp;Aug. 2020, this release</span></b></h3>
<h3>&nbsp; &nbsp;Version <b>1.0.8 <span class="gray">&nbsp;Oct. 2020, this release</span></b></h3>
<ul>
<li><h3>minor quality improvements at low and high rates, some license text clarifications</h3></li>
<li><h3>exhaleApp: slightly improved loudness calculation for low and high sampling rates</h3></li>
<li><h3>exhaleLib: improved audio quality a bit for the lower and higher-rate CVBR modes</h3></li>
<li><h3>License: removed references to BSD text, clarified disclaimer and contributor text</h3></li>
</ul>
<h3>&nbsp; &nbsp;Version <b>1.0.7 <span class="gray">&nbsp;Aug. 2020</span></b></h3>
<ul>
<li><h3>minor bugfixes in bit-rate control and higher-rate coding at 32 kHz sampling rate</h3></li>
<li><h3>exhaleApp: add support for CVBR mode 0 at codec sampling rates below 44.1 kHz</h3></li>
@ -104,7 +111,7 @@
<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.0.7, August 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.0.8, October 2020. Available at www.ecodis.de/exhale/release.htm.</span><br><br></h4>
</td>
<td valign="top" colspan="2">

View File

@ -1,7 +1,7 @@
/* exhaleDecl.h - header file with declarations for exhale DLL ex-/import under Windows
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
*
* The copyright in this software is being made available under a Modified BSD-Style License
* The copyright in this software is being made available under the exhale Copyright License
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
* party rights, including patent rights. No such rights are granted under this License.
*

View File

@ -1,7 +1,7 @@
/* version.h - header file with major and minor library version numbers as characters
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
*
* The copyright in this software is being made available under a Modified BSD-Style License
* The copyright in this software is being made available under the exhale Copyright License
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
* party rights, including patent rights. No such rights are granted under this License.
*
@ -15,5 +15,5 @@
# define EXHALELIB_VERSION_MINOR "0"
#endif
#ifndef EXHALELIB_VERSION_BUGFIX
# define EXHALELIB_VERSION_BUGFIX ".7" // "RC" or ".0", ".1", ...
# define EXHALELIB_VERSION_BUGFIX ".8" // "RC" or ".0", ".1", ...
#endif

View File

@ -1,7 +1,7 @@
## makefile - master user make-file for compiling exhale on Linux and MacOS platforms
# written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under a Modified BSD-Style License
# The copyright in this software is being made available under the exhale Copyright License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#

View File

@ -13,7 +13,7 @@
0 ICON "exhaleApp.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,7
FILEVERSION 1,0,8
BEGIN
BLOCK "StringFileInfo"
BEGIN

View File

@ -1,7 +1,7 @@
## makefile - application make-file for compiling exhale on Linux and MacOS platforms
# written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under a Modified BSD-Style License
# The copyright in this software is being made available under the exhale Copyright License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#

View File

@ -1605,14 +1605,14 @@ unsigned ExhaleEncoder::temporalProcessing () // determine time-domain aspects o
// get temporal channel statistics for this frame, used for spectral grouping/quantization
m_tempAnalyzer.getTempAnalysisStats (m_tempAnaCurr, nChannels);
m_tempAnalyzer.getTransientLocation (m_tranLocCurr, nChannels);
m_tempAnalyzer.getTransientAndPitch (m_tranLocCurr, nChannels);
// temporal analysis for look-ahead signal (central nSamplesInFrame samples of next frame)
errorValue |= m_tempAnalyzer.temporalAnalysis (m_timeSignals, nChannels, nSamplesInFrame, nSamplesTempAna, lfeChannelIndex);
// get temporal channel statistics for next frame, used for window length/overlap decision
m_tempAnalyzer.getTempAnalysisStats (m_tempAnaNext, nChannels);
m_tempAnalyzer.getTransientLocation (m_tranLocNext, nChannels);
m_tempAnalyzer.getTransientAndPitch (m_tranLocNext, nChannels);
#ifndef NO_FIX_FOR_ISSUE_1
m_indepFlag = (((m_frameCount++) % m_indepPeriod) <= 1); // configure usacIndependencyFlag
@ -1654,10 +1654,13 @@ unsigned ExhaleEncoder::temporalProcessing () // determine time-domain aspects o
const USAC_WSEQ wsPrev = icsPrev.windowSequence;
USAC_WSEQ& wsCurr = icsCurr.windowSequence;
// get temporal signal statistics, then determine overlap config. for the next frame
const unsigned plCurr = abs (m_tranLocCurr[ci]) & 1023;
const unsigned sfCurr = (m_tempAnaCurr[ci] >> 24) & UCHAR_MAX;
const unsigned tfCurr = (m_tempAnaCurr[ci] >> 16) & UCHAR_MAX;
const unsigned plNext = abs (m_tranLocNext[ci]) & 1023;
const unsigned sfNext = (m_tempAnaNext[ci] >> 24) & UCHAR_MAX;
const unsigned tfNext = (m_tempAnaNext[ci] >> 16) & UCHAR_MAX;
const unsigned tThresh = UCHAR_MAX * (__max (plCurr, plNext) < 614 /*0.6 * 1024*/ ? 16 : 15 - (m_bitRateMode >> 2));
tsCurr[ch] = (m_tempAnaCurr[ci] /*R*/) & UCHAR_MAX;
tsNext[ch] = (m_tempAnaNext[ci] >> 8) & UCHAR_MAX;
@ -1677,7 +1680,7 @@ unsigned ExhaleEncoder::temporalProcessing () // determine time-domain aspects o
}
else // LONG_START_SEQUENCE, STOP_START_SEQUENCE, EIGHT_SHORT_SEQUENCE - min overlap
{
wsCurr = (m_tranLocCurr[ci] >= 0) || (tsCurr[ch] > (UCHAR_MAX * 5) / 8) || (tfCurr > (UCHAR_MAX * 15) / 16) ? EIGHT_SHORT :
wsCurr = (m_tranLocCurr[ci] >= 0) || (tsCurr[ch] > (UCHAR_MAX * 5) / 8) || (tfCurr > tThresh / 16) ? EIGHT_SHORT :
#if RESTRICT_TO_AAC
(lowOlapNext ? EIGHT_SHORT : LONG_STOP);
#else
@ -1697,7 +1700,7 @@ unsigned ExhaleEncoder::temporalProcessing () // determine time-domain aspects o
}
// set scale_factor_grouping
icsCurr.windowGrouping = (wsCurr == EIGHT_SHORT ? (m_tranLocCurr[ci] * 8) / (int16_t) nSamplesInFrame : 0);
icsCurr.windowGrouping = (wsCurr == EIGHT_SHORT ? __max (0, m_tranLocCurr[ci]) / (2 * nSamplesInFrame) : 0);
ci++;
} // for ch
@ -1743,7 +1746,7 @@ unsigned ExhaleEncoder::temporalProcessing () // determine time-domain aspects o
{
const int16_t tranLocSynch = __min (m_tranLocCurr[ci - 2], m_tranLocCurr[ci - 1]);
icsInfo0.windowGrouping = icsInfo1.windowGrouping = (tranLocSynch * 8) / (int16_t) nSamplesInFrame;
icsInfo0.windowGrouping = icsInfo1.windowGrouping = __max (0, tranLocSynch) / (2 * nSamplesInFrame);
}
if ((icsInfo0.windowShape != WINDOW_SINE) || (icsInfo1.windowShape != WINDOW_SINE))

View File

@ -1,7 +1,7 @@
## makefile - code library make-file for compiling exhale on Linux and MacOS platforms
# written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under a Modified BSD-Style License
# The copyright in this software is being made available under the exhale Copyright License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#

View File

@ -61,14 +61,14 @@ static inline uint32_t packAvgTempAnalysisStats (const unsigned avgAbsHpL, cons
return (CLIP_UCHAR (flatSpec) << 24) | (CLIP_UCHAR (flatTemp) << 16) | (CLIP_UCHAR (statTmpL) << 8) | CLIP_UCHAR (statTmpR);
}
static inline int16_t getMaxAbsHpValueLocation (const unsigned maxAbsValL, const unsigned maxAbsValR, const unsigned maxAbsValP,
const int16_t maxAbsIdxL, const int16_t maxAbsIdxR)
static inline int16_t packTransLocWithPitchLag (const unsigned maxAbsValL, const unsigned maxAbsValR, const unsigned maxAbsValP,
const int16_t maxAbsIdxL, const int16_t maxAbsIdxR, const int16_t optPitchLag)
{
if ((maxAbsValP * 5 < maxAbsValL * 2) || (maxAbsValL * 5 < maxAbsValR * 2)) // has transient
{
return maxAbsValR > maxAbsValL ? maxAbsIdxR : maxAbsIdxL;
return (((maxAbsValR > maxAbsValL ? maxAbsIdxR : maxAbsIdxL) << 4) & 0xF800) | __min (2047, optPitchLag);
}
return -1; // no transient
return -1 * optPitchLag; // has no transient
}
// constructor
@ -95,13 +95,13 @@ void TempAnalyzer::getTempAnalysisStats (uint32_t avgTempAnaStats[USAC_MAX_NUM_C
memcpy (avgTempAnaStats, m_tempAnaStats, nChannels * sizeof (uint32_t));
}
void TempAnalyzer::getTransientLocation (int16_t maxHighPassValueLocation[USAC_MAX_NUM_CHANNELS], const unsigned nChannels)
void TempAnalyzer::getTransientAndPitch (int16_t transIdxAndPitch[USAC_MAX_NUM_CHANNELS], const unsigned nChannels)
{
if ((maxHighPassValueLocation == nullptr) || (nChannels > USAC_MAX_NUM_CHANNELS))
if ((transIdxAndPitch == nullptr) || (nChannels > USAC_MAX_NUM_CHANNELS))
{
return;
}
memcpy (maxHighPassValueLocation, m_transientLoc, nChannels * sizeof (int16_t));
memcpy (transIdxAndPitch, m_transientLoc, nChannels * sizeof (int16_t));
}
unsigned TempAnalyzer::temporalAnalysis (const int32_t* const timeSignals[USAC_MAX_NUM_CHANNELS], const unsigned nChannels,
@ -213,23 +213,19 @@ unsigned TempAnalyzer::temporalAnalysis (const int32_t* const timeSignals[USAC_M
{
sumAbsPpL = sumAbsValL; // left side
}
#if TA_MORE_PITCH_TESTS
if ((sumAbsValR = applyPitchPred (chSigPH, halfFrameOffset, pLag, pSgn)) < sumAbsPpR)
{
sumAbsPpR = sumAbsValR; // right side
pLagBestR = pLag;
}
#endif
// test right-side pitch lag on the frame
pLag = __min (maxAbsIdxR - maxAbsIdxL, (int) lookaheadOffset - 1);
pSgn = (((chSig[maxAbsIdxR] - chSigM1[maxAbsIdxR] > 0) && (chSig[maxAbsIdxL] - chSigM1[maxAbsIdxL] < 0)) ||
((chSig[maxAbsIdxR] - chSigM1[maxAbsIdxR] < 0) && (chSig[maxAbsIdxL] - chSigM1[maxAbsIdxL] > 0)) ? -1 : 1);
#if TA_MORE_PITCH_TESTS
if ((sumAbsValL = applyPitchPred (chSig, halfFrameOffset, pLag, pSgn)) < sumAbsPpL)
{
sumAbsPpL = sumAbsValL; // left side
}
#endif
if ((sumAbsValR = applyPitchPred (chSigPH, halfFrameOffset, pLag, pSgn)) < sumAbsPpR)
{
sumAbsPpR = sumAbsValR; // right side
@ -248,7 +244,6 @@ unsigned TempAnalyzer::temporalAnalysis (const int32_t* const timeSignals[USAC_M
sumAbsPpR = sumAbsValR; // right side
pLagBestR = pLag;
}
#if TA_MORE_PITCH_TESTS
if (pLagBestR >= halfFrameOffset) // half
{
pLag = pLagBestR >> 1;
@ -264,7 +259,7 @@ unsigned TempAnalyzer::temporalAnalysis (const int32_t* const timeSignals[USAC_M
pLagBestR = pLag;
}
}
#endif
// convert L1 norms into average values
sumAbsHpL = (sumAbsHpL + unsigned (halfFrameOffset >> 1)) / unsigned (halfFrameOffset);
sumAbsHpR = (sumAbsHpR + unsigned (halfFrameOffset >> 1)) / unsigned (halfFrameOffset);
@ -273,8 +268,8 @@ unsigned TempAnalyzer::temporalAnalysis (const int32_t* const timeSignals[USAC_M
// --- temporal analysis statistics for frame
m_tempAnaStats[ch] = packAvgTempAnalysisStats (sumAbsHpL, sumAbsHpR, m_avgAbsHpPrev[ch],
sumAbsPpL + sumAbsPpR, maxAbsValL + maxAbsValR);
m_transientLoc[ch] = getMaxAbsHpValueLocation (maxAbsValL, maxAbsValR, m_maxAbsHpPrev[ch],
maxAbsIdxL, maxAbsIdxR);
m_transientLoc[ch] = packTransLocWithPitchLag (maxAbsValL, maxAbsValR, m_maxAbsHpPrev[ch],
maxAbsIdxL, maxAbsIdxR, __max (1, pLagBestR));
// update stats history for this channel
m_avgAbsHpPrev[ch] = sumAbsHpR;
m_maxAbsHpPrev[ch] = maxAbsValR;

View File

@ -15,7 +15,6 @@
// constants, experimental macros
#define TA_EPS 4096
#define TA_MORE_PITCH_TESTS 1
// temporal signal analysis class
class TempAnalyzer
@ -38,7 +37,7 @@ public:
~TempAnalyzer () { }
// public functions
void getTempAnalysisStats (uint32_t avgTempAnaStats[USAC_MAX_NUM_CHANNELS], const unsigned nChannels);
void getTransientLocation (int16_t maxHighPassValueLocation[USAC_MAX_NUM_CHANNELS], const unsigned nChannels);
void getTransientAndPitch (int16_t transIdxAndPitch[USAC_MAX_NUM_CHANNELS], const unsigned nChannels);
unsigned temporalAnalysis (const int32_t* const timeSignals[USAC_MAX_NUM_CHANNELS], const unsigned nChannels,
const int nSamplesInFrame, const unsigned lookaheadOffset,
const unsigned lfeChannelIndex = USAC_MAX_NUM_CHANNELS); // to skip an LFE channel

View File

@ -1,7 +1,7 @@
## makefile.base - common make-file for compiling exhale on Linux and MacOS platforms
# written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
#
# The copyright in this software is being made available under a Modified BSD-Style License
# The copyright in this software is being made available under the exhale Copyright License
# and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
# party rights, including patent rights. No such rights are granted under this License.
#