Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Speex
Commits
f1cd6279
Commit
f1cd6279
authored
Oct 06, 2014
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove trailing whitespace
parent
566a73a6
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1847 additions
and
1847 deletions
+1847
-1847
include/speex/speex.h
include/speex/speex.h
+15
-15
include/speex/speex_bits.h
include/speex/speex_bits.h
+13
-13
include/speex/speex_callbacks.h
include/speex/speex_callbacks.h
+4
-4
include/speex/speex_header.h
include/speex/speex_header.h
+5
-5
include/speex/speex_stereo.h
include/speex/speex_stereo.h
+4
-4
include/speex/speex_types.h
include/speex/speex_types.h
+1
-1
src/getopt.c
src/getopt.c
+1047
-1047
src/getopt1.c
src/getopt1.c
+188
-188
src/getopt_win.h
src/getopt_win.h
+169
-169
src/skeleton.c
src/skeleton.c
+12
-12
src/speexdec.c
src/speexdec.c
+33
-33
src/speexenc.c
src/speexenc.c
+50
-50
src/wav_io.c
src/wav_io.c
+9
-9
src/wav_io.h
src/wav_io.h
+6
-6
src/wave_out.c
src/wave_out.c
+220
-220
src/wave_out.h
src/wave_out.h
+71
-71
No files found.
include/speex/speex.h
View file @
f1cd6279
...
...
@@ -7,18 +7,18 @@
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 the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
@@ -246,14 +246,14 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef
int
(
*
mode_query_func
)(
const
void
*
mode
,
int
request
,
void
*
ptr
);
/** Struct defining a Speex mode */
/** Struct defining a Speex mode */
typedef
struct
SpeexMode
{
/** Pointer to the low-level mode data */
const
void
*
mode
;
/** Pointer to the mode query function */
mode_query_func
query
;
/** The name of the mode (you should not rely on this to identify the mode)*/
const
char
*
modeName
;
...
...
@@ -291,25 +291,25 @@ typedef struct SpeexMode {
}
SpeexMode
;
/**
* Returns a handle to a newly created Speex encoder state structure. For now,
* the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* Returns a handle to a newly created Speex encoder state structure. For now,
* the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
* @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void
*
speex_encoder_init
(
const
SpeexMode
*
mode
);
/** Frees all resources associated to an existing Speex encoder state.
/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void
speex_encoder_destroy
(
void
*
state
);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
@param in Frame that will be encoded with a +-2^15 range. This data MAY be
overwritten by the encoder and should be considered uninitialised
@param in Frame that will be encoded with a +-2^15 range. This data MAY be
overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
...
...
@@ -335,14 +335,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
int
speex_encoder_ctl
(
void
*
state
,
int
request
,
void
*
ptr
);
/** Returns a handle to a newly created decoder state structure. For now,
/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
*/
*/
void
*
speex_decoder_init
(
const
SpeexMode
*
mode
);
/** Frees all resources associated to an existing decoder state.
...
...
include/speex/speex_bits.h
View file @
f1cd6279
...
...
@@ -7,18 +7,18 @@
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 the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
@@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits);
void
speex_bits_read_from
(
SpeexBits
*
bits
,
const
char
*
bytes
,
int
len
);
/** Append bytes to the bit-stream
*
*
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
...
...
@@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, const char *bytes, int len);
void
speex_bits_read_whole_bytes
(
SpeexBits
*
bits
,
const
char
*
bytes
,
int
len
);
/** Write the content of a bit-stream to an area of memory
*
*
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
...
...
@@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
*/
int
speex_bits_nbytes
(
SpeexBits
*
bits
);
/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
*
/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
*
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
...
...
@@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits);
unsigned
int
speex_bits_peek_unsigned
(
SpeexBits
*
bits
,
int
nbBits
);
/** Get the value of the next bit in the stream, without modifying the
* "cursor" position
*
* "cursor" position
*
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int
speex_bits_peek
(
SpeexBits
*
bits
);
/** Advances the position of the "bit cursor" in the stream
/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
...
...
@@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n);
*/
int
speex_bits_remaining
(
SpeexBits
*
bits
);
/** Insert a terminator so that the data can be sent as a packet while auto-detecting
* the number of frames in each packet
/** Insert a terminator so that the data can be sent as a packet while auto-detecting
* the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
...
...
include/speex/speex_callbacks.h
View file @
f1cd6279
...
...
@@ -7,18 +7,18 @@
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 the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
include/speex/speex_header.h
View file @
f1cd6279
...
...
@@ -7,18 +7,18 @@
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 the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
@@ -58,7 +58,7 @@ struct SpeexMode;
/** Speex header info for file-based formats */
typedef
struct
SpeexHeader
{
char
speex_string
[
SPEEX_HEADER_STRING_LENGTH
];
/**< Identifies a Speex bit-stream, always set to "Speex " */
char
speex_version
[
SPEEX_HEADER_VERSION_LENGTH
];
/**< Speex version */
char
speex_version
[
SPEEX_HEADER_VERSION_LENGTH
];
/**< Speex version */
spx_int32_t
speex_version_id
;
/**< Version for Speex (for checking compatibility) */
spx_int32_t
header_size
;
/**< Total size of the header ( sizeof(SpeexHeader) ) */
spx_int32_t
rate
;
/**< Sampling rate used */
...
...
include/speex/speex_stereo.h
View file @
f1cd6279
...
...
@@ -7,18 +7,18 @@
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 the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
include/speex/speex_types.h
View file @
f1cd6279
...
...
@@ -22,7 +22,7 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
#if defined(_WIN32)
#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
...
...
src/getopt.c
View file @
f1cd6279
This diff is collapsed.
Click to expand it.
src/getopt1.c
View file @
f1cd6279
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "getopt_win.h"
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long
(
argc
,
argv
,
options
,
long_options
,
opt_index
)
int
argc
;
char
*
const
*
argv
;
const
char
*
options
;
const
struct
option
*
long_options
;
int
*
opt_index
;
{
return
_getopt_internal
(
argc
,
argv
,
options
,
long_options
,
opt_index
,
0
);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only
(
argc
,
argv
,
options
,
long_options
,
opt_index
)
int
argc
;
char
*
const
*
argv
;
const
char
*
options
;
const
struct
option
*
long_options
;
int
*
opt_index
;
{
return
_getopt_internal
(
argc
,
argv
,
options
,
long_options
,
opt_index
,
1
);
}
#endif
/* Not ELIDE_CODE. */
#ifdef TEST
#include <stdio.h>
int
main
(
argc
,
argv
)
int
argc
;
char
**
argv
;
{
int
c
;
int
digit_optind
=
0
;
while
(
1
)
{
int
this_option_optind
=
optind
?
optind
:
1
;
int
option_index
=
0
;
static
struct
option
long_options
[]
=
{
{
"add"
,
1
,
0
,
0
},
{
"append"
,
0
,
0
,
0
},
{
"delete"
,
1
,
0
,
0
},
{
"verbose"
,
0
,
0
,
0
},
{
"create"
,
0
,
0
,
0
},
{
"file"
,
1
,
0
,
0
},
{
0
,
0
,
0
,
0
}
};
c
=
getopt_long
(
argc
,
argv
,
"abc:d:0123456789"
,
long_options
,
&
option_index
);
if
(
c
==
-
1
)
break
;
switch
(
c
)
{
case
0
:
printf
(
"option %s"
,
long_options
[
option_index
].
name
);
if
(
optarg
)
printf
(
" with arg %s"
,
optarg
);
printf
(
"
\n
"
);
break
;
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
if
(
digit_optind
!=
0
&&
digit_optind
!=
this_option_optind
)
printf
(
"digits occur in two different argv-elements.
\n
"
);
digit_optind
=
this_option_optind
;
printf
(
"option %c
\n
"
,
c
);
break
;
case
'a'
:
printf
(
"option a
\n
"
);
break
;
case
'b'
:
printf
(
"option b
\n
"
);
break
;
case
'c'
:
printf
(
"option c with value `%s'
\n
"
,
optarg
);
break
;
case
'd'
:
printf
(
"option d with value `%s'
\n
"
,
optarg
);
break
;
case
'?'
:
break
;
default:
printf
(
"?? getopt returned character code 0%o ??
\n
"
,
c
);
}
}
if
(
optind
<
argc
)
{
printf
(
"non-option ARGV-elements: "
);
while
(
optind
<
argc
)
printf
(
"%s "
,
argv
[
optind
++
]);
printf
(
"
\n
"
);
}
exit
(
0
);
}
#endif
/* TEST */
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "getopt_win.h"
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long
(
argc
,
argv
,
options
,
long_options
,
opt_index
)
int
argc
;
char
*
const
*
argv
;
const
char
*
options
;
const
struct
option
*
long_options
;
int
*
opt_index
;
{
return
_getopt_internal
(
argc
,
argv
,
options
,
long_options
,
opt_index
,
0
);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only
(
argc
,
argv
,
options
,
long_options
,
opt_index
)
int
argc
;
char
*
const
*
argv
;
const
char
*
options
;
const
struct
option
*
long_options
;
int
*
opt_index
;
{
return
_getopt_internal
(
argc
,
argv
,
options
,
long_options
,
opt_index
,
1
);
}
#endif
/* Not ELIDE_CODE. */
#ifdef TEST
#include <stdio.h>
int
main
(
argc
,
argv
)
int
argc
;
char
**
argv
;
{
int
c
;
int
digit_optind
=
0
;
while
(
1
)
{
int
this_option_optind
=
optind
?
optind
:
1
;
int
option_index
=
0
;
static
struct
option
long_options
[]
=
{
{
"add"
,
1
,
0
,
0
},
{
"append"
,
0
,
0
,
0
},
{
"delete"
,
1
,
0
,
0
},
{
"verbose"
,
0
,
0
,
0
},
{
"create"
,
0
,
0
,
0
},
{
"file"
,
1
,
0
,
0
},
{
0
,
0
,
0
,
0
}
};
c
=
getopt_long
(
argc
,
argv
,
"abc:d:0123456789"
,
long_options
,
&
option_index
);
if
(
c
==
-
1
)
break
;
switch
(
c
)
{
case
0
:
printf
(
"option %s"
,
long_options
[
option_index
].
name
);
if
(
optarg
)
printf
(
" with arg %s"
,
optarg
);
printf
(
"
\n
"
);
break
;
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
if
(
digit_optind
!=
0
&&
digit_optind
!=
this_option_optind
)
printf
(
"digits occur in two different argv-elements.
\n
"
);
digit_optind
=
this_option_optind
;
printf
(
"option %c
\n
"
,
c
);
break
;
case
'a'
:
printf
(
"option a
\n
"
);
break
;
case
'b'
:
printf
(
"option b
\n
"
);
break
;
case
'c'
:
printf
(
"option c with value `%s'
\n
"
,
optarg
);
break
;
case
'd'
:
printf
(
"option d with value `%s'
\n
"
,
optarg
);
break
;
case
'?'
:
break
;
default:
printf
(
"?? getopt returned character code 0%o ??
\n
"
,
c
);
}
}
if
(
optind
<
argc
)
{
printf
(
"non-option ARGV-elements: "
);
while
(
optind
<
argc
)
printf
(
"%s "
,
argv
[
optind
++
]);
printf
(
"
\n
"
);
}
exit
(
0
);
}
#endif
/* TEST */
src/getopt_win.h
View file @
f1cd6279