Commit 554b349c authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

There are no tabs in source code.

There is also no trailing whitespace.
parent 020a0a48
......@@ -9,12 +9,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
......
......@@ -4,7 +4,7 @@ INCLUDES=-I. -I../ -I../.. -I../../include
all: dump_modes
dump_modes:
$(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES_ONLY -DCUSTOM_MODES dump_modes.c ../modes.c ../cwrs.c ../rate.c ../entenc.c ../entdec.c ../mathops.c ../mdct.c ../kiss_fft.c -o dump_modes -lm
$(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES_ONLY -DCUSTOM_MODES dump_modes.c ../modes.c ../cwrs.c ../rate.c ../entenc.c ../entdec.c ../mathops.c ../mdct.c ../kiss_fft.c -o dump_modes -lm
clean:
rm -f dump_modes
......@@ -171,18 +171,18 @@ void dump_modes(FILE *file, CELTMode **modes, int nb_modes)
fprintf(file, "#define FFT_STATE%d_%d_%d\n", mode->Fs, mdctSize, k);
fprintf (file, "static const kiss_fft_state fft_state%d_%d_%d = {\n",
mode->Fs, mdctSize, k);
fprintf (file, "%d,\t/* nfft */\n", mode->mdct.kfft[k]->nfft);
fprintf (file, WORD16 ",\t/* scale */\n", mode->mdct.kfft[k]->scale);
fprintf (file, "%d, /* nfft */\n", mode->mdct.kfft[k]->nfft);
fprintf (file, WORD16 ", /* scale */\n", mode->mdct.kfft[k]->scale);
#ifdef FIXED_POINT
fprintf (file, "%d,\t/* scale_shift */\n", mode->mdct.kfft[k]->scale_shift);
fprintf (file, "%d, /* scale_shift */\n", mode->mdct.kfft[k]->scale_shift);
#endif
fprintf (file, "%d,\t/* shift */\n", mode->mdct.kfft[k]->shift);
fprintf (file, "%d, /* shift */\n", mode->mdct.kfft[k]->shift);
fprintf (file, "{");
for (j=0;j<2*MAXFACTORS;j++)
fprintf (file, "%d, ", mode->mdct.kfft[k]->factors[j]);
fprintf (file, "},\t/* factors */\n");
fprintf (file, "fft_bitrev%d,\t/* bitrev */\n", mode->mdct.kfft[k]->nfft);
fprintf (file, "fft_twiddles%d_%d,\t/* bitrev */\n", mode->Fs, mdctSize);
fprintf (file, "}, /* factors */\n");
fprintf (file, "fft_bitrev%d, /* bitrev */\n", mode->mdct.kfft[k]->nfft);
fprintf (file, "fft_twiddles%d_%d, /* bitrev */\n", mode->Fs, mdctSize);
fprintf (file, "};\n");
fprintf(file, "#endif\n");
......@@ -208,37 +208,37 @@ void dump_modes(FILE *file, CELTMode **modes, int nb_modes)
/* Print the actual mode data */
fprintf(file, "static const CELTMode mode%d_%d_%d = {\n", mode->Fs, mdctSize, mode->overlap);
fprintf(file, INT32 ",\t/* Fs */\n", mode->Fs);
fprintf(file, "%d,\t/* overlap */\n", mode->overlap);
fprintf(file, "%d,\t/* nbEBands */\n", mode->nbEBands);
fprintf(file, "%d,\t/* effEBands */\n", mode->effEBands);
fprintf(file, INT32 ", /* Fs */\n", mode->Fs);
fprintf(file, "%d, /* overlap */\n", mode->overlap);
fprintf(file, "%d, /* nbEBands */\n", mode->nbEBands);
fprintf(file, "%d, /* effEBands */\n", mode->effEBands);
fprintf(file, "{");
for (j=0;j<4;j++)
fprintf(file, WORD16 ", ", mode->preemph[j]);
fprintf(file, "},\t/* preemph */\n");
fprintf(file, "}, /* preemph */\n");
if (standard)
fprintf(file, "eband5ms,\t/* eBands */\n");
fprintf(file, "eband5ms, /* eBands */\n");
else
fprintf(file, "eBands%d_%d,\t/* eBands */\n", mode->Fs, mdctSize);
fprintf(file, "eBands%d_%d, /* eBands */\n", mode->Fs, mdctSize);
fprintf(file, "%d,\t/* maxLM */\n", mode->maxLM);
fprintf(file, "%d,\t/* nbShortMdcts */\n", mode->nbShortMdcts);
fprintf(file, "%d,\t/* shortMdctSize */\n", mode->shortMdctSize);
fprintf(file, "%d, /* maxLM */\n", mode->maxLM);
fprintf(file, "%d, /* nbShortMdcts */\n", mode->nbShortMdcts);
fprintf(file, "%d, /* shortMdctSize */\n", mode->shortMdctSize);
fprintf(file, "%d,\t/* nbAllocVectors */\n", mode->nbAllocVectors);
fprintf(file, "%d, /* nbAllocVectors */\n", mode->nbAllocVectors);
if (standard)
fprintf(file, "band_allocation,\t/* allocVectors */\n");
fprintf(file, "band_allocation, /* allocVectors */\n");
else
fprintf(file, "allocVectors%d_%d,\t/* allocVectors */\n", mode->Fs, mdctSize);
fprintf(file, "allocVectors%d_%d, /* allocVectors */\n", mode->Fs, mdctSize);
fprintf(file, "logN%d,\t/* logN */\n", framerate);
fprintf(file, "window%d,\t/* window */\n", mode->overlap);
fprintf(file, "logN%d, /* logN */\n", framerate);
fprintf(file, "window%d, /* window */\n", mode->overlap);
fprintf(file, "{%d, %d, {", mode->mdct.n, mode->mdct.maxshift);
for (k=0;k<=mode->mdct.maxshift;k++)
fprintf(file, "&fft_state%d_%d_%d, ", mode->Fs, mdctSize, k);
fprintf (file, "}, mdct_twiddles%d},\t/* mdct */\n", mdctSize);
fprintf (file, "}, mdct_twiddles%d}, /* mdct */\n", mdctSize);
fprintf(file, "{%d, cache_index%d, cache_bits%d, cache_caps%d},\t/* cache */\n",
fprintf(file, "{%d, cache_index%d, cache_bits%d, cache_caps%d}, /* cache */\n",
mode->cache.size, mode->Fs/mdctSize, mode->Fs/mdctSize, mode->Fs/mdctSize);
fprintf(file, "};\n");
}
......
......@@ -35,38 +35,38 @@
#undef MULT16_32_Q15_ADD
static inline int MULT16_32_Q15_ADD(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
#undef MULT16_32_Q15_SUB
static inline int MULT16_32_Q15_SUB(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
#undef MULT16_16_Q15_ADD
static inline int MULT16_16_Q15_ADD(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
#undef MULT16_16_Q15_SUB
static inline int MULT16_16_Q15_SUB(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
......
......@@ -37,20 +37,20 @@
#undef S_MUL_ADD
static inline int S_MUL_ADD(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("madd $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
#undef S_MUL_SUB
static inline int S_MUL_SUB(int a, int b, int c, int d) {
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
int m;
asm volatile("MULT $ac1, %0, %1" : : "r" ((int)a), "r" ((int)b));
asm volatile("msub $ac1, %0, %1" : : "r" ((int)c), "r" ((int)d));
asm volatile("EXTR.W %0,$ac1, %1" : "=r" (m): "i" (15));
return m;
}
#undef C_MUL
......
......@@ -46,11 +46,11 @@ static inline void dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, c
/* Compute the norm of X+Y and X-Y as |X|^2 + |Y|^2 +/- sum(xy) */
for (j=0;j<N;j++)
{
asm volatile("MADD $ac1, %0, %1" : : "r" ((int)x[j]), "r" ((int)y01[j]));
asm volatile("MADD $ac2, %0, %1" : : "r" ((int)x[j]), "r" ((int)y02[j]));
++j;
asm volatile("MADD $ac1, %0, %1" : : "r" ((int)x[j]), "r" ((int)y01[j]));
asm volatile("MADD $ac2, %0, %1" : : "r" ((int)x[j]), "r" ((int)y02[j]));
asm volatile("MADD $ac1, %0, %1" : : "r" ((int)x[j]), "r" ((int)y01[j]));
asm volatile("MADD $ac2, %0, %1" : : "r" ((int)x[j]), "r" ((int)y02[j]));
++j;
asm volatile("MADD $ac1, %0, %1" : : "r" ((int)x[j]), "r" ((int)y01[j]));
asm volatile("MADD $ac2, %0, %1" : : "r" ((int)x[j]), "r" ((int)y02[j]));
}
asm volatile ("mflo %0, $ac1": "=r"(xy01));
asm volatile ("mflo %0, $ac2": "=r"(xy02));
......
......@@ -426,10 +426,10 @@ static const opus_int16 fft_bitrev60[60] = {
#define FFT_STATE48000_960_0
static const kiss_fft_state fft_state48000_960_0 = {
480, /* nfft */
17476, /* scale */
17476, /* scale */
8, /* scale_shift */
-1, /* shift */
{5, 96, 3, 32, 4, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 96, 3, 32, 4, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev480, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......@@ -439,10 +439,10 @@ fft_twiddles48000_960, /* bitrev */
#define FFT_STATE48000_960_1
static const kiss_fft_state fft_state48000_960_1 = {
240, /* nfft */
17476, /* scale */
17476, /* scale */
7, /* scale_shift */
1, /* shift */
{5, 48, 3, 16, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 48, 3, 16, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev240, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......@@ -452,10 +452,10 @@ fft_twiddles48000_960, /* bitrev */
#define FFT_STATE48000_960_2
static const kiss_fft_state fft_state48000_960_2 = {
120, /* nfft */
17476, /* scale */
17476, /* scale */
6, /* scale_shift */
2, /* shift */
{5, 24, 3, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 24, 3, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev120, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......@@ -465,10 +465,10 @@ fft_twiddles48000_960, /* bitrev */
#define FFT_STATE48000_960_3
static const kiss_fft_state fft_state48000_960_3 = {
60, /* nfft */
17476, /* scale */
17476, /* scale */
5, /* scale_shift */
3, /* shift */
{5, 12, 3, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 12, 3, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev60, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......
......@@ -440,7 +440,7 @@ static const kiss_fft_state fft_state48000_960_1 = {
240, /* nfft */
0.004166667f, /* scale */
1, /* shift */
{5, 48, 3, 16, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 48, 3, 16, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev240, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......@@ -452,7 +452,7 @@ static const kiss_fft_state fft_state48000_960_2 = {
120, /* nfft */
0.008333333f, /* scale */
2, /* shift */
{5, 24, 3, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 24, 3, 8, 2, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev120, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......@@ -464,7 +464,7 @@ static const kiss_fft_state fft_state48000_960_3 = {
60, /* nfft */
0.016666667f, /* scale */
3, /* shift */
{5, 12, 3, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
{5, 12, 3, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, /* factors */
fft_bitrev60, /* bitrev */
fft_twiddles48000_960, /* bitrev */
};
......
......@@ -66,10 +66,10 @@ int main(int _argc,char **_argv){
const char *env_seed;
ret=0;
entropy=0;
if (_argc > 2) {
fprintf(stderr, "Usage: %s [<seed>]\n", _argv[0]);
return 1;
}
if (_argc > 2) {
fprintf(stderr, "Usage: %s [<seed>]\n", _argv[0]);
return 1;
}
env_seed = getenv("SEED");
if (_argc > 1)
seed = atoi(_argv[1]);
......
......@@ -224,7 +224,7 @@ void testexp2(void)
float error2 = fabs(exp(0.6931471805599453094*x/1024.0)-celt_exp2(x)/65536.0);
if (error1>0.0002&&error2>0.00004)
{
fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2);
fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2);
ret = 1;
}
}
......
......@@ -611,7 +611,7 @@ WARN_LOGFILE =
# with spaces.
INPUT = @top_srcdir@/include/opus.h \
@top_srcdir@/include/opus_types.h \
@top_srcdir@/include/opus_types.h \
@top_srcdir@/include/opus_defines.h \
@top_srcdir@/include/opus_multistream.h \
@top_srcdir@/include/opus_custom.h
......
/* The standard CSS for doxygen */
body, table, div, p, dl {
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 13px;
line-height: 1.3;
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 13px;
line-height: 1.3;
}
/* @group Heading Levels */
h1 {
font-size: 150%;
font-size: 150%;
}
.title {
font-size: 150%;
font-weight: bold;
margin: 10px 2px;
font-size: 150%;
font-weight: bold;
margin: 10px 2px;
}
h2 {
font-size: 120%;
font-size: 120%;
}
h3 {
font-size: 100%;
font-size: 100%;
}
dt {
font-weight: bold;
font-weight: bold;
}
div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
}
p.startli, p.startdd, p.starttd {
margin-top: 2px;
margin-top: 2px;
}
p.endli {
margin-bottom: 0px;
margin-bottom: 0px;
}
p.enddd {
margin-bottom: 4px;
margin-bottom: 4px;
}
p.endtd {
margin-bottom: 2px;
margin-bottom: 2px;
}
/* @end */
caption {
font-weight: bold;
font-weight: bold;
}
span.legend {
......@@ -70,45 +70,45 @@ h3.version {
}
div.qindex, div.navtab{
background-color: #F1F1F1;
border: 1px solid #BDBDBD;
text-align: center;
background-color: #F1F1F1;
border: 1px solid #BDBDBD;
text-align: center;
}
div.qindex, div.navpath {
width: 100%;
line-height: 140%;
width: 100%;
line-height: 140%;
}
div.navtab {
margin-right: 15px;
margin-right: 15px;
}
/* @group Link Styling */
a {
color: #646464;
font-weight: normal;
text-decoration: none;
color: #646464;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
color: #747474;
color: #747474;
}
a:hover {
text-decoration: underline;
text-decoration: underline;
}
a.qindex {
font-weight: bold;
font-weight: bold;
}
a.qindexHL {
font-weight: bold;
background-color: #B8B8B8;
color: #ffffff;
border: 1px double #A8A8A8;
font-weight: bold;
background-color: #B8B8B8;
color: #ffffff;
border: 1px double #A8A8A8;
}
.contents a.qindexHL:visited {
......@@ -116,181 +116,181 @@ a.qindexHL {
}
a.el {
font-weight: bold;
font-weight: bold;
}
a.elRef {
}
a.code, a.code:visited {
color: #4665A2;
color: #4665A2;
}
a.codeRef, a.codeRef:visited {
color: #4665A2;
color: #4665A2;
}
/* @end */
dl.el {
margin-left: -1cm;
margin-left: -1cm;
}
.fragment {
font-family: monospace, fixed;
font-size: 105%;
font-family: monospace, fixed;
font-size: 105%;
}
pre.fragment {
border: 1px solid #D5D5D5;
background-color: #FCFCFC;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 9pt;
line-height: 125%;
border: 1px solid #D5D5D5;
background-color: #FCFCFC;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 9pt;
line-height: 125%;
}
div.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
border: solid thin #333;
border-radius: 0.5em;
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
box-shadow: 2px 2px 3px #999;
-webkit-box-shadow: 2px 2px 3px #999;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
border: solid thin #333;
border-radius: 0.5em;
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
box-shadow: 2px 2px 3px #999;
-webkit-box-shadow: 2px 2px 3px #999;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
margin-left: 16px;
font-style: italic;
}
body {
background-color: white;
color: black;
background-color: white;
color: black;
margin: 0;
}
div.contents {
margin-top: 10px;
margin-left: 8px;
margin-right: 8px;
margin-top: 10px;
margin-left: 8px;
margin-right: 8px;