summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy B. Terriberry <tterribe@xiph.org>2012-08-22 17:40:01 -0700
committerTimothy B. Terriberry <tterribe@xiph.org>2012-08-22 17:40:01 -0700
commitc73ed6481d214ef433e93b45172d1b2ad628de81 (patch)
treeabcd99a9e5f53fb3fd5a28bea45a9d50973eb356
parentbbb6edb19680897c4ba5e9fb7ee6af9e8c36f358 (diff)
downloadopus-c73ed6481d214ef433e93b45172d1b2ad628de81.tar.gz
Resolve rewhitening description issues.
Plus other minor changes.
-rw-r--r--COPYING2
-rw-r--r--README.draft6
-rw-r--r--celt/opus_custom_demo.c14
-rw-r--r--configure.ac18
-rw-r--r--doc/draft-ietf-codec-opus.xml136
-rw-r--r--include/opus_custom.h6
-rw-r--r--silk/SigProc_FIX.h8
-rw-r--r--silk/ana_filt_bank_1.c2
-rw-r--r--silk/fixed/burg_modified_FIX.c2
-rw-r--r--silk/fixed/encode_frame_FIX.c2
-rw-r--r--silk/fixed/find_pred_coefs_FIX.c6
-rw-r--r--silk/float/SigProc_FLP.h6
-rw-r--r--silk/float/encode_frame_FLP.c2
-rw-r--r--silk/float/find_LPC_FLP.c2
-rw-r--r--silk/float/find_pred_coefs_FLP.c2
-rw-r--r--silk/lin2log.c2
-rw-r--r--silk/log2lin.c2
-rw-r--r--silk/resampler_private_IIR_FIR.c8
-rw-r--r--silk/resampler_private_down_FIR.c10
-rw-r--r--silk/sigm_Q15.c2
-rw-r--r--src/opus_encoder.c2
-rwxr-xr-xtests/run_vectors.sh4
-rw-r--r--win32/config.h2
23 files changed, 139 insertions, 107 deletions
diff --git a/COPYING b/COPYING
index 1d3514bf..5db750ca 100644
--- a/COPYING
+++ b/COPYING
@@ -17,7 +17,7 @@ notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/README.draft b/README.draft
index 650eb68a..3912222a 100644
--- a/README.draft
+++ b/README.draft
@@ -12,12 +12,12 @@ in the Makefile.
An up-to-date implementation conforming to this standard is available in a
Git repository at git://git.xiph.org/opus.git or on a website at:
http://opus-codec.org/
-However, although that implementation is expected to remain conformant
-with the standard, it is the code in this RFC that shall remain normative.
+However, although that implementation is expected to remain conformant
+with the standard, it is the code in this RFC that shall remain normative.
To build from the git repository instead of using this RFC, follow these
steps:
-1) Clone the repository (latest implementation of this standard at the time
+1) Clone the repository (latest implementation of this standard at the time
of publication)
% git clone git://git.opus-codec.org/opus.git
diff --git a/celt/opus_custom_demo.c b/celt/opus_custom_demo.c
index 5796a977..be7dd8e4 100644
--- a/celt/opus_custom_demo.c
+++ b/celt/opus_custom_demo.c
@@ -8,14 +8,14 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
"<input> <output>\n");
return 1;
}
-
+
rate = (opus_int32)atol(argv[1]);
channels = atoi(argv[2]);
frame_size = atoi(argv[3]);
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
fclose(fin);
return 1;
}
-
+
enc = opus_custom_encoder_create(mode, channels, &err);
if (err != 0)
{
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
complexity=atoi(argv[5]);
opus_custom_encoder_ctl(enc,OPUS_SET_COMPLEXITY(complexity));
}
-
+
in = (opus_int16*)malloc(frame_size*channels*sizeof(opus_int16));
out = (opus_int16*)malloc(frame_size*channels*sizeof(opus_int16));
@@ -194,7 +194,7 @@ int main(int argc, char *argv[])
skip = 0;
}
PRINT_MIPS(stderr);
-
+
opus_custom_encoder_destroy(enc);
opus_custom_decoder_destroy(dec);
fclose(fin);
diff --git a/configure.ac b/configure.ac
index ffd409cf..5c32292f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,13 +60,13 @@ AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
for ac_kw in __restrict __restrict__ _Restrict restrict; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[typedef int * int_ptr;
- int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) {
- return ip[0];
+ int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) {
+ return ip[0];
}]],
[[int s[1];
- int * $ac_kw t = s;
- t[0] = 0;
- return foo(t, (void *)0)]])],
+ int * $ac_kw t = s;
+ t[0] = 0;
+ return foo(t, (void *)0)]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
@@ -134,7 +134,7 @@ has_float_approx=no
#i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64)
# has_float_approx=yes
# ;;
-#esac
+#esac
ac_enable_fixed="no";
AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point compile as fixed-point],
@@ -277,15 +277,15 @@ AC_OUTPUT([Makefile opus.pc opus-uninstalled.pc
AC_MSG_RESULT([
------------------------------------------------------------------------
$PACKAGE $VERSION: Automatic configuration OK.
-
+
Compiler support:
C99 var arrays: ................ ${has_var_arrays}
C99 lrintf: .................... ${ac_cv_func_lrintf}
Alloca: ........................ ${has_alloca}
-
+
General configuration:
-
+
Fast float approximations: ..... ${float_approx}
Fixed point support: ........... ${ac_enable_fixed}
Fixed point debugging: ......... ${ac_enable_fixed_debug}
diff --git a/doc/draft-ietf-codec-opus.xml b/doc/draft-ietf-codec-opus.xml
index 36779b18..3664e9ee 100644
--- a/doc/draft-ietf-codec-opus.xml
+++ b/doc/draft-ietf-codec-opus.xml
@@ -71,8 +71,8 @@ This document defines the Opus interactive speech and audio codec.
Opus is designed to handle a wide range of interactive audio applications,
including Voice over IP, videoconferencing, in-game chat, and even live,
distributed music performances.
-It scales from low bitrate narrowband speech at 6 kbit/s to very high quality
- stereo music at 510 kbit/s.
+It scales from low bitrate narrowband speech at 6&nbsp;kbit/s to very high
+ quality stereo music at 510&nbsp;kbit/s.
Opus uses both Linear Prediction (LP) and the Modified Discrete Cosine
@@ -544,9 +544,9 @@ AAC (Advanced Audio Coding) call CBR (i.e., not true
CBR due to the bit reservoir). In some (rare) applications, constant bitrate (CBR)
is required. There are two main reasons to operate in CBR mode:
<list style="symbols">
-<t>When the transport only supports a fixed size for each compressed frame</t>
+<t>When the transport only supports a fixed size for each compressed frame, or</t>
<t>When encryption is used for an audio stream that is either highly constrained
- (e.g., yes/no, recorded prompts) or highly sensitive <xref target="SRTP-VBR"></xref> </t>
+ (e.g., yes/no, recorded prompts) or highly sensitive <xref target="SRTP-VBR"></xref>.</t>
</list>
Bitrate may still be allowed
@@ -2252,7 +2252,7 @@ This is the first subframe in the current SILK frame, and
<t>
This is the first SILK frame of its type (LBRR or regular) for this channel in
the current Opus frame, or
- </t>
+</t>
<t>
The previous SILK frame of the same type (LBRR or regular) for this channel in
the same Opus frame was not coded.
@@ -2387,7 +2387,7 @@ The normalized LSFs are coded using a two-stage vector quantizer (VQ)
and&nbsp;<xref target="silk_nlsf_stage2" format="counter"/>).
NB and MB frames use an order-10 predictor, while WB frames use an order-16
predictor.
-Thus, there are different sets of tables used for each of these two cases.
+Thus, each of these two cases uses a different set of tables.
After reconstructing the normalized LSFs
(<xref target="silk_nlsf_reconstruction"/>), the decoder runs them through a
stabilization process (<xref target="silk_nlsf_stabilization"/>), interpolates
@@ -4738,32 +4738,58 @@ Also, let n be the number of samples in a subframe (40 for NB, 60 for MB, and
<section anchor="silk_ltp_synthesis" title="LTP Synthesis">
<t>
-Voiced SILK frames (see <xref target="silk_frame_type"/>) pass the excitation
- through an LTP filter using the parameters decoded in
- <xref target="silk_ltp_params"/> to produce an LPC residual.
+For unvoiced frames (see <xref target="silk_frame_type"/>), the LPC residual
+ for i such that j&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;(j&nbsp;+&nbsp;n) is simply
+ a normalized copy of the excitation signal, i.e.,
+<figure align="center">
+<artwork align="center"><![CDATA[
+ e_Q23[i]
+res[i] = ---------
+ 2.0**23
+]]></artwork>
+</figure>
+</t>
+
+<t>
+Voiced SILK frames, on the other hand, pass the excitation through an LTP
+ filter using the parameters decoded in <xref target="silk_ltp_params"/> to
+ produce an LPC residual.
The LTP filter requires LPC residual values from before the current subframe as
input.
However, since the LPC coefficients may have changed, it obtains this residual
by "rewhitening" the corresponding output signal using the LPC coefficients
from the current subframe.
-Let out[i] for
+Let out[i] for i such that
(j&nbsp;-&nbsp;pitch_lags[s]&nbsp;-&nbsp;d_LPC&nbsp;-&nbsp;2)&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;j
be the fully reconstructed output signal from the last
(pitch_lags[s]&nbsp;+&nbsp;d_LPC&nbsp;+&nbsp;2) samples of previous subframes
(see <xref target="silk_lpc_synthesis"/>), where pitch_lags[s] is the pitch
lag for the current subframe from <xref target="silk_ltp_lags"/>.
+Additionally, let lpc[i] for i such that
+ (j&nbsp;-&nbsp;s*n&nbsp;-&nbsp;d_LPC)&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;j
+ be the fully reconstructed output signal from the last
+ (s*n&nbsp;+&nbsp;d_LPC) samples of previous subframes before clamping
+ (see <xref target="silk_lpc_synthesis"/>).
During reconstruction of the first subframe for this channel after either
<list style="symbols">
<t>An uncoded regular SILK frame (if this is the side channel), or</t>
<t>A decoder reset (see <xref target="decoder-reset"/>),</t>
</list>
+ out[i] and lpc[i] are initially cleared to all zeros.
+If this is the third or fourth subframe of a 20&nbsp;ms SILK frame and the LSF
+ interpolation factor, w_Q2 (see <xref target="silk_nlsf_interpolation"/>), is
+ less than 4, then let out_end be set to (j&nbsp;-&nbsp;(s-2)*n) and let
+ LTP_scale_Q14 be set to 16384.
+Otherwise, set out_end to (j&nbsp;-&nbsp;s*n) and set LTP_scale_Q14 to the Q14
+ LTP scaling value from <xref target="silk_ltp_scaling"/>.
+Then, for i such that
+ (j&nbsp;-&nbsp;pitch_lags[s]&nbsp;-&nbsp;2)&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;out_end,
out[i] is rewhitened into an LPC residual, res[i], via
<figure align="center">
<artwork align="center"><![CDATA[
4.0*LTP_scale_Q14
res[i] = ----------------- * clamp(-1.0,
gain_Q16[s]
-
d_LPC-1
__ a_Q12[k]
out[i] - \ out[i-k-1] * --------, 1.0)
@@ -4776,8 +4802,26 @@ This requires storage to buffer up to 306 values of out[i] from previous
This corresponds to WB with a maximum pitch lag of
18&nbsp;ms&nbsp;*&nbsp;16&nbsp;kHz samples, plus 16 samples for d_LPC, plus 2
samples for the width of the LTP filter.
+Then, for i such that out_end&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;j, lpc[i] is
+ rewhitened into an LPC residual, res[i], via
+<figure align="center">
+<artwork align="center"><![CDATA[
+ d_LPC-1
+ 65536.0 __ a_Q12[k]
+res[i] = ----------- * (lpc[i] - \ lpc[i-k-1] * --------)
+ gain_Q16[s] /_ 4096.0
+ k=0
+]]></artwork>
+</figure>
+This requires storage to buffer up to 256 values of lpc[i] from previous
+ subframes (240 from the current SILK frame and 16 from the previous SILK
+ frame).
+This corresponds to WB with up to three previous subframes in the current SILK
+ frame, plus 16 samples for d_LPC.
+The astute reader will notice that, given the definition of lpc[i] in
+ <xref target="silk_lpc_synthesis"/>, the output of this latter equation is
+ merely a scaled version of the values of res[i] from previous subframes.
</t>
-
<t>
Let e_Q23[i] for j&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;(j&nbsp;+&nbsp;n) be the
excitation for the current subframe, and b_Q7[k] for
@@ -4800,18 +4844,6 @@ res[i] = --------- + \ res[i - pitch_lags[s] + 2 - k] * -------
</figure>
</t>
-<t>
-For unvoiced frames, the LPC residual for
- j&nbsp;&lt;=&nbsp;i&nbsp;&lt;&nbsp;(j&nbsp;+&nbsp;n) is simply a normalized
- copy of the excitation signal, i.e.,
-<figure align="center">
-<artwork align="center"><![CDATA[
- e_Q23[i]
-res[i] = ---------
- 2.0**23
-]]></artwork>
-</figure>
-</t>
</section>
<section anchor="silk_lpc_synthesis" title="LPC Synthesis">
@@ -7495,7 +7527,7 @@ and band skipping.
<t>The reference encoder makes a decision to boost a band when the energy of that band is significantly
higher than that of the neighboring bands. Let E_j be the log-energy of band j, we define
<list>
-<t>D_j = 2*E_j - E_j-1 - E_j+1 </t>
+<t>D_j = 2*E_j - E_j-1 - E_j+1</t>
</list>
The allocation of band j is boosted once if D_j &gt; t1 and twice if D_j &gt; t2. For LM&gt;=1, t1=2 and t2=4,
@@ -7513,7 +7545,7 @@ trim is increased by up to 2, while for signals with more high frequencies, the
decreased by up to 2.
For stereo inputs, the trim value can
be decreased by up to 4 when the inter-channel correlation at low frequency (first 8 bands)
-is high. </t>
+is high.</t>
</section>
<section title="Band Skipping">
@@ -7844,8 +7876,8 @@ There were no errors reported on any of the tested conditions.
<section anchor="Acknowledgements" title="Acknowledgements">
<t>
-Thanks to all other developers, including Henrik Astrom, Jon Bergenheim,
-Raymond Chen, Soeren Skak Jensen,
+Thanks to all other developers, including Henrik Astrom, Jon Bergenheim,
+Raymond Chen, Soren Skak Jensen,
Gregory Maxwell, Christopher Montgomery, and Karsten Vandborg Sorensen.
We would also like to thank Igor Dyakonov, Hoang Thi Minh Nguyet, Christian Hoene, Gian-Carlo Pascutto,
and Jan Skoglund for their help with testing of the Opus codec.
@@ -7944,9 +7976,9 @@ or left in their current order?
<front>
<title>Requirements for an Internet Audio Codec</title>
-<author initials='J.' surname='Valin' fullname='J. Valin'>
+<author initials='JM' surname='Valin' fullname='Jean-Marc Valin'>
<organization /></author>
-<author initials='K.' surname='Vos' fullname='K. Vos'>
+<author initials='K.' surname='Vos' fullname='Koen Vos'>
<organization /></author>
<date year='2011' month='August' />
<abstract>
@@ -7966,15 +7998,15 @@ or left in their current order?
<front>
<title>SILK Speech Codec</title>
-<author initials='K' surname='Vos' fullname='Koen Vos'>
+<author initials='K.' surname='Vos' fullname='Koen Vos'>
<organization />
</author>
-<author initials='S' surname='Jensen' fullname='Soeren Skak Jensen'>
+<author initials='S.' surname='Jensen' fullname='Soren Skak Jensen'>
<organization />
</author>
-<author initials='K' surname='Sorensen' fullname='Karsten Vandborg Sorensen'>
+<author initials='K.' surname='Sorensen' fullname='Karsten Vandborg Sorensen'>
<organization />
</author>
@@ -7995,13 +8027,13 @@ or left in their current order?
<title abbrev="Robust and Efficient Quantization of Speech LSP">
Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vector Quantization
</title>
-<author initials="R.L." surname="Laroia" fullname="R.">
+<author initials="R." surname="Laroia" fullname="Rajiv Laroia">
<organization/>
</author>
-<author initials="N.P." surname="Phamdo" fullname="N.">
+<author initials="N." surname="Phamdo" fullname="Nam Phamdo">
<organization/>
</author>
-<author initials="N.F." surname="Farvardin" fullname="N.">
+<author initials="N." surname="Farvardin" fullname="Nariman Favardin">
<organization/>
</author>
</front>
@@ -8016,19 +8048,19 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<front>
<title>Constrained-Energy Lapped Transform (CELT) Codec</title>
-<author initials='J' surname='Valin' fullname='Jean-Marc Valin'>
+<author initials='JM' surname='Valin' fullname='Jean-Marc Valin'>
<organization />
</author>
-<author initials='T' surname='Terriberry' fullname='Timothy Terriberry'>
+<author initials='T. B.' surname='Terriberry' fullname='Timothy B. Terriberry'>
<organization />
</author>
-<author initials='G' surname='Maxwell' fullname='Gregory Maxwell'>
+<author initials='G.' surname='Maxwell' fullname='Gregory Maxwell'>
<organization />
</author>
-<author initials='C' surname='Montgomery' fullname='Christopher Montgomery'>
+<author initials='C.' surname='Montgomery' fullname='Christopher Montgomery'>
<organization />
</author>
@@ -8044,9 +8076,9 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<reference anchor='SRTP-VBR'>
<front>
<title>Guidelines for the Use of Variable Bit Rate Audio with Secure RTP</title>
-<author initials='C.' surname='Perkins' fullname='C. Perkins'>
+<author initials='C.' surname='Perkins' fullname='Colin Perkins'>
<organization /></author>
-<author initials='JM.' surname='Valin' fullname='JM. Valin'>
+<author initials='JM' surname='Valin' fullname='Jean-Marc Valin'>
<organization /></author>
<date year='2012' month='March' />
<abstract>
@@ -8061,9 +8093,9 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<front>
<title>Internet Denial-of-Service Considerations</title>
-<author initials='M.' surname='Handley' fullname='M. Handley'>
+<author initials='M.' surname='Handley' fullname='Mark Handley'>
<organization /></author>
-<author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
+<author initials='E.' surname='Rescorla' fullname='Eric Rescorla'>
<organization /></author>
<author>
<organization>IAB</organization></author>
@@ -8090,7 +8122,7 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<reference anchor="CODING-THESIS">
<front>
<title>Source coding algorithms for fast data compression</title>
-<author initials="R." surname="Pasco" fullname=""><organization/></author>
+<author initials="R." surname="Pasco" fullname="Richard C. Pasco"><organization/></author>
<date month="May" year="1976" />
</front>
<seriesInfo name="Ph.D. thesis" value="Dept. of Electrical Engineering, Stanford University" />
@@ -8099,7 +8131,7 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<reference anchor="PVQ">
<front>
<title>A Pyramid Vector Quantizer</title>
-<author initials="T." surname="Fischer" fullname=""><organization/></author>
+<author initials="T." surname="Fischer" fullname="Thomas R. Fischer"><organization/></author>
<date month="July" year="1986" />
</front>
<seriesInfo name="IEEE Trans. on Information Theory, Vol. 32," value="pp. 568-583" />
@@ -8108,8 +8140,8 @@ Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vect
<reference anchor="KABAL86">
<front>
<title>The Computation of Line Spectral Frequencies Using Chebyshev Polynomials</title>
-<author initials="P." surname="Kabal" fullname="P. Kabal"><organization/></author>
-<author initials="R." surname="Ramachandran" fullname="R. P. Ramachandran"><organization/></author>
+<author initials="P." surname="Kabal" fullname="Peter Kabal"><organization/></author>
+<author initials="R." surname="Ramachandran" fullname="Ravi P. Ramachandran"><organization/></author>
<date month="December" year="1986" />
</front>
<seriesInfo name="IEEE Trans. Acoustics, Speech, Signal Processing, Vol. 34, no. 6," value="pp. 1419-1426" />
@@ -8251,7 +8283,7 @@ http://git.xiph.org/?p=opus.git
<reference anchor="BURG">
<front>
<title>Maximum Entropy Spectral Analysis</title>
-<author initials="JP." surname="Burg" fullname="J.P. Burg"><organization/></author>
+<author initials="J.P." surname="Burg" fullname="John Parker Burg"><organization/></author>
</front>
<seriesInfo name="Proceedings of the 37th Annual International SEG Meeting, Vol. 6," value="1975"/>
</reference>
@@ -8259,8 +8291,8 @@ http://git.xiph.org/?p=opus.git
<reference anchor="SCHUR">
<front>
<title>A fixed point computation of partial correlation coefficients</title>
-<author initials="J." surname="Le Roux" fullname="J. Le Roux"><organization/></author>
-<author initials="C." surname="Gueguen" fullname="C. Gueguen"><organization/></author>
+<author initials="J." surname="Le Roux" fullname="Joel Le Roux"><organization/></author>
+<author initials="C." surname="Gueguen" fullname="Claude J. Gueguen"><organization/></author>
</front>
<seriesInfo name="ICASSP-1977, Proc. IEEE Int. Conf. Acoustics, Speech, and Signal Processing, pp. 257-259, June" value="1977"/>
</reference>
@@ -8279,7 +8311,7 @@ http://git.xiph.org/?p=opus.git
<title>A High-Quality Speech and Audio Codec With Less Than 10 ms Delay</title>
<author initials="JM" surname="Valin" fullname="Jean-Marc Valin"><organization/>
</author>
-<author initials="T. B." surname="Terriberry" fullname="Timothy Terriberry"><organization/></author>
+<author initials="T. B." surname="Terriberry" fullname="Timothy B. Terriberry"><organization/></author>
<author initials="C." surname="Montgomery" fullname="Christopher Montgomery"><organization/></author>
<author initials="G." surname="Maxwell" fullname="Gregory Maxwell"><organization/></author>
</front>
diff --git a/include/opus_custom.h b/include/opus_custom.h
index 954e46b3..53d0834f 100644
--- a/include/opus_custom.h
+++ b/include/opus_custom.h
@@ -14,14 +14,14 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
diff --git a/silk/SigProc_FIX.h b/silk/SigProc_FIX.h
index 80f1732e..846eab67 100644
--- a/silk/SigProc_FIX.h
+++ b/silk/SigProc_FIX.h
@@ -145,7 +145,7 @@ opus_int32 silk_LPC_inverse_pred_gain_Q24( /* O Returns inverse pred
/* Split signal in two decimated bands using first-order allpass filters */
void silk_ana_filt_bank_1(
- const opus_int16 *in, /* I Input signal [N] */
+ const opus_int16 *in, /* I Input signal [N] */
opus_int32 *S, /* I/O State vector [2] */
opus_int16 *outL, /* O Low band [N/2] */
opus_int16 *outH, /* O High band [N/2] */
@@ -158,18 +158,18 @@ void silk_ana_filt_bank_1(
/* Approximation of 128 * log2() (exact inverse of approx 2^() below) */
/* Convert input to a log scale */
-opus_int32 silk_lin2log(
+opus_int32 silk_lin2log(
const opus_int32 inLin /* I input in linear scale */
);
/* Approximation of a sigmoid function */
-opus_int silk_sigm_Q15(
+opus_int silk_sigm_Q15(
opus_int in_Q5 /* I */
);
/* Approximation of 2^() (exact inverse of approx log2() above) */
/* Convert input to a linear scale */
-opus_int32 silk_log2lin(
+opus_int32 silk_log2lin(
const opus_int32 inLog_Q7 /* I input on log scale */
);
diff --git a/silk/ana_filt_bank_1.c b/silk/ana_filt_bank_1.c
index 8a834e8e..98512b8e 100644
--- a/silk/ana_filt_bank_1.c
+++ b/silk/ana_filt_bank_1.c
@@ -41,7 +41,7 @@ static opus_int16 A_fb1_21 = -24290; /* (opus_int16)(20623 << 1) */
/* Split signal into two decimated bands using first-order allpass filters */
void silk_ana_filt_bank_1(
- const opus_int16 *in, /* I Input signal [N] */
+ const opus_int16 *in, /* I Input signal [N] */
opus_int32 *S, /* I/O State vector [2] */
opus_int16 *outL, /* O Low band [N/2] */
opus_int16 *outH, /* O High band [N/2] */
diff --git a/silk/fixed/burg_modified_FIX.c b/silk/fixed/burg_modified_FIX.c
index 772d33a2..d17a3dff 100644
--- a/silk/fixed/burg_modified_FIX.c
+++ b/silk/fixed/burg_modified_FIX.c
@@ -269,5 +269,5 @@ void silk_burg_modified(
}
*res_nrg = silk_SMLAWW( nrg, silk_SMMUL( FIND_LPC_COND_FAC, C0 ), -tmp1 ); /* Q( -rshifts ) */
*res_nrg_Q = -rshifts;
- }
+ }
}
diff --git a/silk/fixed/encode_frame_FIX.c b/silk/fixed/encode_frame_FIX.c
index 59ba616d..fc1d82fd 100644
--- a/silk/fixed/encode_frame_FIX.c
+++ b/silk/fixed/encode_frame_FIX.c
@@ -280,7 +280,7 @@ opus_int silk_encode_frame_FIX(
for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) {
sEncCtrl.Gains_Q16[ i ] = silk_LSHIFT_SAT32( silk_SMULWB( sEncCtrl.GainsUnq_Q16[ i ], gainMult_Q8 ), 8 );
}
-
+
/* Quantize gains */
psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev;
silk_gains_quant( psEnc->sCmn.indices.GainsIndices, sEncCtrl.Gains_Q16,
diff --git a/silk/fixed/find_pred_coefs_FIX.c b/silk/fixed/find_pred_coefs_FIX.c
index 99a51e5a..a023c457 100644
--- a/silk/fixed/find_pred_coefs_FIX.c
+++ b/silk/fixed/find_pred_coefs_FIX.c
@@ -118,10 +118,10 @@ void silk_find_pred_coefs_FIX(
/* Limit on total predictive coding gain */
if( psEnc->sCmn.first_frame_after_reset ) {
minInvGain_Q30 = SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN_AFTER_RESET, 30 );
- } else {
+ } else {
minInvGain_Q30 = silk_log2lin( silk_SMLAWB( 16 << 7, psEncCtrl->LTPredCodGain_Q7, SILK_FIX_CONST( 1.0 / 3, 16 ) ) ); /* Q16 */
- minInvGain_Q30 = silk_DIV32_varQ( minInvGain_Q30,
- silk_SMULWW( SILK_FIX_CONST( MAX_PREDICTION_POWER_GAIN, 0 ),
+ minInvGain_Q30 = silk_DIV32_varQ( minInvGain_Q30,
+ silk_SMULWW( SILK_FIX_CONST( MAX_PREDICTION_POWER_GAIN, 0 ),
silk_SMLAWB( SILK_FIX_CONST( 0.25, 18 ), SILK_FIX_CONST( 0.75, 18 ), psEncCtrl->coding_quality_Q14 ) ), 14 );
}
diff --git a/silk/float/SigProc_FLP.h b/silk/float/SigProc_FLP.h
index 47ca85a7..18211111 100644
--- a/silk/float/SigProc_FLP.h
+++ b/silk/float/SigProc_FLP.h
@@ -198,9 +198,9 @@ static inline void silk_short2float_array(
}
/* using log2() helps the fixed-point conversion */
-static inline silk_float silk_log2( double x )
-{
- return ( silk_float )( 3.32192809488736 * log10( x ) );
+static inline silk_float silk_log2( double x )
+{
+ return ( silk_float )( 3.32192809488736 * log10( x ) );
}
#ifdef __cplusplus
diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c
index a0494b20..f84fa482 100644
--- a/silk/float/encode_frame_FLP.c
+++ b/silk/float/encode_frame_FLP.c
@@ -204,7 +204,7 @@ opus_int silk_encode_frame_FLP(
/****************************************/
silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType,
psEnc->sCmn.pulses, psEnc->sCmn.frame_length );
-
+
nBits = ec_tell( psRangeEnc );
if( useCBR == 0 && iter == 0 && nBits <= maxBits ) {
diff --git a/silk/float/find_LPC_FLP.c b/silk/float/find_LPC_FLP.c
index 5d0ee124..5187d7ed 100644
--- a/silk/float/find_LPC_FLP.c
+++ b/silk/float/find_LPC_FLP.c
@@ -103,6 +103,6 @@ void silk_find_LPC_FLP(
silk_A2NLSF_FLP( NLSF_Q15, a, psEncC->predictLPCOrder );
}
- silk_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 ||
+ silk_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 ||
( psEncC->useInterpolatedNLSFs && !psEncC->first_frame_after_reset && psEncC->nb_subfr == MAX_NB_SUBFR ) );
}
diff --git a/silk/float/find_pred_coefs_FLP.c b/silk/float/find_pred_coefs_FLP.c
index d661bb94..248d8c38 100644
--- a/silk/float/find_pred_coefs_FLP.c
+++ b/silk/float/find_pred_coefs_FLP.c
@@ -99,7 +99,7 @@ void silk_find_pred_coefs_FLP(
/* Limit on total predictive coding gain */
if( psEnc->sCmn.first_frame_after_reset ) {
minInvGain = 1.0f / MAX_PREDICTION_POWER_GAIN_AFTER_RESET;
- } else {
+ } else {
minInvGain = (silk_float)pow( 2, psEncCtrl->LTPredCodGain / 3 ) / MAX_PREDICTION_POWER_GAIN;
minInvGain /= 0.25f + 0.75f * psEncCtrl->coding_quality;
}
diff --git a/silk/lin2log.c b/silk/lin2log.c
index a466b061..7d3f45fd 100644
--- a/silk/lin2log.c
+++ b/silk/lin2log.c
@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "SigProc_FIX.h"
/* Approximation of 128 * log2() (very close inverse of silk_log2lin()) */
/* Convert input to a log scale */
-opus_int32 silk_lin2log(
+opus_int32 silk_lin2log(
const opus_int32 inLin /* I input in linear scale */
)
{
diff --git a/silk/log2lin.c b/silk/log2lin.c
index 47107308..22722191 100644
--- a/silk/log2lin.c
+++ b/silk/log2lin.c
@@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* Approximation of 2^() (very close inverse of silk_lin2log()) */
/* Convert input to a linear scale */
-opus_int32 silk_log2lin(
+opus_int32 silk_log2lin(
const opus_int32 inLog_Q7 /* I input on log scale */
)
{
diff --git a/silk/resampler_private_IIR_FIR.c b/silk/resampler_private_IIR_FIR.c
index c0fbfdda..dbd6d9a8 100644
--- a/silk/resampler_private_IIR_FIR.c
+++ b/silk/resampler_private_IIR_FIR.c
@@ -37,10 +37,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "resampler_private.h"
static inline opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
- opus_int16 *out,
- opus_int16 *buf,
- opus_int32 max_index_Q16,
- opus_int32 index_increment_Q16
+ opus_int16 *out,
+ opus_int16 *buf,
+ opus_int32 max_index_Q16,
+ opus_int32 index_increment_Q16
)
{
opus_int32 index_Q16, res_Q15;
diff --git a/silk/resampler_private_down_FIR.c b/silk/resampler_private_down_FIR.c
index bc9802a9..1fbe91d8 100644
--- a/silk/resampler_private_down_FIR.c
+++ b/silk/resampler_private_down_FIR.c
@@ -37,12 +37,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "resampler_private.h"
static inline opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
- opus_int16 *out,
- opus_int32 *buf,
- const opus_int16 *FIR_Coefs,
+ opus_int16 *out,
+ opus_int32 *buf,
+ const opus_int16 *FIR_Coefs,
opus_int FIR_Order,
opus_int FIR_Fracs,
- opus_int32 max_index_Q16,
+ opus_int32 max_index_Q16,
opus_int32 index_increment_Q16
)
{
@@ -174,7 +174,7 @@ void silk_resampler_private_down_FIR(
max_index_Q16 = silk_LSHIFT32( nSamplesIn, 16 );
/* Interpolate filtered signal */
- out = silk_resampler_private_down_FIR_INTERPOL( out, buf, FIR_Coefs, S->FIR_Order,
+ out = silk_resampler_private_down_FIR_INTERPOL( out, buf, FIR_Coefs, S->FIR_Order,
S->FIR_Fracs, max_index_Q16, index_increment_Q16 );
in += nSamplesIn;
diff --git a/silk/sigm_Q15.c b/silk/sigm_Q15.c
index 8260d4c5..1f4439e5 100644
--- a/silk/sigm_Q15.c
+++ b/silk/sigm_Q15.c
@@ -50,7 +50,7 @@ static const opus_int32 sigm_LUT_neg_Q15[ 6 ] = {
16384, 8812, 3906, 1554, 589, 219
};
-opus_int silk_sigm_Q15(
+opus_int silk_sigm_Q15(
opus_int in_Q5 /* I */
)
{
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index f65f9c17..44171c2b 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -216,7 +216,7 @@ int opus_encoder_init(OpusEncoder* st, opus_int32 Fs, int channels, int applicat
st->voice_ratio = -1;
st->encoder_buffer = st->Fs/100;
- /* Delay compensation of 4 ms (2.5 ms for SILK's extra look-ahead
+ /* Delay compensation of 4 ms (2.5 ms for SILK's extra look-ahead
+ 1.5 ms for SILK resamplers and stereo prediction) */
st->delay_compensation = st->Fs/250;
diff --git a/tests/run_vectors.sh b/tests/run_vectors.sh
index d01e403c..7cd23ed4 100755
--- a/tests/run_vectors.sh
+++ b/tests/run_vectors.sh
@@ -73,7 +73,7 @@ for file in 01 02 03 04 05 06 07 08 09 10 11 12
do
if [ -e $VECTOR_PATH/testvector$file.bit ]; then
echo Testing testvector$file
- else
+ else
echo Bitstream file not found: testvector$file.bit
fi
if $OPUS_DEMO -d $RATE 1 $VECTOR_PATH/testvector$file.bit tmp.out >> logs_mono.txt 2>&1; then
@@ -102,7 +102,7 @@ for file in 01 02 03 04 05 06 07 08 09 10 11 12
do
if [ -e $VECTOR_PATH/testvector$file.bit ]; then
echo Testing testvector$file
- else
+ else
echo Bitstream file not found: testvector$file
fi
if $OPUS_DEMO -d $RATE 2 $VECTOR_PATH/testvector$file.bit tmp.out >> logs_stereo.txt 2>&1; then
diff --git a/win32/config.h b/win32/config.h
index 38cb441e..c5b57796 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -3,7 +3,7 @@
#define CELT_BUILD 1
-#define restrict
+#define restrict
#define inline __inline
#define USE_ALLOCA 1