Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Christian R. Helmrich
exhale
Commits
c7de6bb9
Commit
c7de6bb9
authored
May 03, 2020
by
Christian R. Helmrich
Browse files
mono-in-stereo fix
parent
08279e21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/lib/exhaleEnc.cpp
src/lib/exhaleEnc.cpp
+4
-2
No files found.
src/lib/exhaleEnc.cpp
View file @
c7de6bb9
...
...
@@ -672,7 +672,6 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s
const
unsigned
samplingRate
=
toSamplingRate
(
m_frequencyIdx
);
const
unsigned
lfeChannelIndex
=
(
m_channelConf
>=
CCI_6_CH
?
__max
(
5
,
nChannels
-
1
)
:
USAC_MAX_NUM_CHANNELS
);
const
uint32_t
maxSfbLong
=
(
samplingRate
<
37566
?
51
/*32 kHz*/
:
brModeAndFsToMaxSfbLong
(
m_bitRateMode
,
samplingRate
));
const
uint32_t
reductionFactor
=
(
m_bitRateMode
<
3
?
2
:
3
);
// for undercoding reduction
const
uint64_t
scaleSr
=
(
samplingRate
<
27713
?
37
-
m_bitRateMode
:
37
)
-
(
m_bitRateMode
>
1
?
nChannels
>>
1
:
0
);
const
uint64_t
scaleBr
=
(
m_bitRateMode
==
0
?
32
:
scaleSr
-
eightTimesSqrt256Minus
[
256
-
m_bitRateMode
]
-
__min
(
3
,
(
m_bitRateMode
-
1
)
>>
1
));
uint32_t
*
sfbStepSizes
=
(
uint32_t
*
)
m_tempIntBuf
;
...
...
@@ -718,6 +717,8 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s
}
else
// SCE or CPE: bandwidth-to-max_sfb mapping, short-window grouping for each channel
{
const
uint32_t
reductionFactor
=
(
m_bitRateMode
<
3
?
2
:
3
)
-
(
coreConfig
.
stereoConfig
>>
3
);
if
(
coreConfig
.
commonWindow
&&
(
coreConfig
.
stereoMode
==
0
)
&&
(
m_perCorrHCurr
[
el
]
>
SCHAR_MAX
||
m_perCorrLCurr
[
el
]
>
(
UCHAR_MAX
*
3
)
/
4
))
{
coreConfig
.
stereoMode
=
1
;
...
...
@@ -805,7 +806,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s
coreConfig
.
tnsData
[
0
],
coreConfig
.
tnsData
[
1
],
numSwbFrame
,
coreConfig
.
stereoDataCurr
,
m_bitRateMode
<=
4
,
coreConfig
.
stereoMode
>
1
,
(
coreConfig
.
stereoConfig
>>
1
)
>
0
,
(
coreConfig
.
stereoConfig
&
1
)
>
0
,
(
coreConfig
.
stereoConfig
&
2
)
>
0
,
(
coreConfig
.
stereoConfig
&
1
)
>
0
,
&
sfbStepSizes
[
m_numSwbShort
*
NUM_WINDOW_GROUPS
*
ci
],
&
sfbStepSizes
[
m_numSwbShort
*
NUM_WINDOW_GROUPS
*
(
ci
+
1
)]);
if
(
errorValue
==
2
)
// signal M/S with complex prediction
...
...
@@ -1258,6 +1259,7 @@ unsigned ExhaleEncoder::spectralProcessing () // complete ics_info(), calc TNS
if
((
int
)
s
==
steAnaStats
*
-
1
)
coreConfig
.
stereoConfig
=
2
;
// 2: S>M, pred_dir=1
if
(
s
>
(
UCHAR_MAX
*
3
)
/
4
)
coreConfig
.
stereoMode
=
2
;
// 2: all, ms_mask_present=2
if
(
s
>=
UCHAR_MAX
)
coreConfig
.
stereoConfig
|=
8
;
// coding of mono-in-stereo signal
}
else
if
(
nrChannels
>
1
)
m_perCorrHCurr
[
el
]
=
m_perCorrLCurr
[
el
]
=
128
;
// "mid" value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment