Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tim-Philipp Müller
Opus
Commits
38f4e9ff
Commit
38f4e9ff
authored
Oct 09, 2010
by
Jean-Marc Valin
Browse files
Renamed to Harmony
Also a CELT update
parent
a7455ca2
Changes
11
Hide whitespace changes
Inline
Side-by-side
README
View file @
38f4e9ff
...
...
@@ -23,10 +23,10 @@ To build from the git repository, the following steps are necessary
% make
Once you have compiled the codec, there will be a test_h
ybrid
executable in
Once you have compiled the codec, there will be a test_h
armony
executable in
the src/ directory. This can be in the following way:
% ./test_h
ybrid
48000 1 960 80 input.sw output.sw
% ./test_h
armony
48000 1 960 80 input.sw output.sw
The arguments are:
1) The sampling rate (only 48000 supported for now)
...
...
celt
@
8226ac08
Subproject commit 8
abc6bee40f4df4c346f997f60d07d027bf9d27d
Subproject commit 8
226ac083ea19f57b69e863251fe487228bc2925
configure.ac
View file @
38f4e9ff
...
...
@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(src/h
ybrid
.h)
AM_INIT_AUTOMAKE(
ietfcodec
,20100921)
AC_INIT(src/h
armony
.h)
AM_INIT_AUTOMAKE(
harmony
,20100921)
# Checks for programs.
AC_PROG_CC
...
...
src/Makefile.am
View file @
38f4e9ff
...
...
@@ -2,12 +2,12 @@
INCLUDES
=
-I
$(top_srcdir)
/celt/libcelt/
-I
$(top_srcdir)
/silk/interface
lib_LTLIBRARIES
=
libietfcodec.la
libietfcodec_la_SOURCES
=
h
ybrid
_decoder.c h
ybrid
_encoder.c
libietfcodec_la_SOURCES
=
h
armony
_decoder.c h
armony
_encoder.c
noinst_HEADERS
=
h
ybrid
_decoder.h h
ybrid
_encoder.h
noinst_HEADERS
=
h
armony
_decoder.h h
armony
_encoder.h
pkginclude_HEADERS
=
h
ybrid
.h
pkginclude_HEADERS
=
h
armony
.h
noinst_PROGRAMS
=
test_h
ybrid
test_h
ybrid
_SOURCES
=
test_h
ybrid
.c
$(top_srcdir)
/silk/test/SKP_debug.c
test_h
ybrid
_LDADD
=
libietfcodec.la
$(top_builddir)
/celt/libcelt/libcelt0.la
$(top_builddir)
/silk/libSKP_SILK_SDK.la
noinst_PROGRAMS
=
test_h
armony
test_h
armony
_SOURCES
=
test_h
armony
.c
$(top_srcdir)
/silk/test/SKP_debug.c
test_h
armony
_LDADD
=
libietfcodec.la
$(top_builddir)
/celt/libcelt/libcelt0.la
$(top_builddir)
/silk/libSKP_SILK_SDK.la
src/framepack.c
View file @
38f4e9ff
...
...
@@ -100,7 +100,7 @@ int count_frames(unsigned char *packet, int len)
}
#define MAX_FRAMES 256
int
h
ybrid
_merge_packets
(
unsigned
char
**
packets
,
int
*
plen
,
int
nb_packets
,
int
h
armony
_merge_packets
(
unsigned
char
**
packets
,
int
*
plen
,
int
nb_packets
,
unsigned
*
output
,
int
maxlen
)
{
int
i
;
...
...
src/h
ybrid
.h
→
src/h
armony
.h
View file @
38f4e9ff
...
...
@@ -29,8 +29,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef H
YBRID
_H
#define H
YBRID
_H
#ifndef H
ARMONY
_H
#define H
ARMONY
_H
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -59,44 +59,44 @@ extern "C" {
#define H
YBRID
_SET_MODE_REQUEST 0
#define H
YBRID
_SET_MODE(x) H
YBRID
_SET_MODE_REQUEST, __check_int(x)
#define H
YBRID
_GET_MODE_REQUEST 1
#define H
YBRID
_GET_MODE(x) H
YBRID
_GET_MODE_REQUEST, __check_int_ptr(x)
#define H
ARMONY
_SET_MODE_REQUEST 0
#define H
ARMONY
_SET_MODE(x) H
ARMONY
_SET_MODE_REQUEST, __check_int(x)
#define H
ARMONY
_GET_MODE_REQUEST 1
#define H
ARMONY
_GET_MODE(x) H
ARMONY
_GET_MODE_REQUEST, __check_int_ptr(x)
#define H
YBRID
_SET_BANDWIDTH_REQUEST 2
#define H
YBRID
_SET_BANDWIDTH(x) H
YBRID
_SET_BANDWIDTH_REQUEST, __check_int(x)
#define H
YBRID
_GET_BANDWIDTH_REQUEST 3
#define H
YBRID
_GET_BANDWIDTH(x) H
YBRID
_GET_BANDWIDTH_REQUEST, __check_int_ptr(x)
#define H
ARMONY
_SET_BANDWIDTH_REQUEST 2
#define H
ARMONY
_SET_BANDWIDTH(x) H
ARMONY
_SET_BANDWIDTH_REQUEST, __check_int(x)
#define H
ARMONY
_GET_BANDWIDTH_REQUEST 3
#define H
ARMONY
_GET_BANDWIDTH(x) H
ARMONY
_GET_BANDWIDTH_REQUEST, __check_int_ptr(x)
#define H
YBRID
_SET_VBR_RATE_REQUEST 4
#define H
YBRID
_SET_VBR_RATE(x) H
YBRID
_SET_VBR_RATE_REQUEST, __check_int(x)
#define H
YBRID
_GET_VBR_RATE_REQUEST 5
#define H
YBRID
_GET_VBR_RATE(x) H
YBRID
_GET_VBR_RATE_REQUEST, __check_int_ptr(x)
#define H
ARMONY
_SET_VBR_RATE_REQUEST 4
#define H
ARMONY
_SET_VBR_RATE(x) H
ARMONY
_SET_VBR_RATE_REQUEST, __check_int(x)
#define H
ARMONY
_GET_VBR_RATE_REQUEST 5
#define H
ARMONY
_GET_VBR_RATE(x) H
ARMONY
_GET_VBR_RATE_REQUEST, __check_int_ptr(x)
typedef
struct
H
ybrid
Encoder
H
ybrid
Encoder
;
typedef
struct
H
ybrid
Decoder
H
ybrid
Decoder
;
typedef
struct
H
armony
Encoder
H
armony
Encoder
;
typedef
struct
H
armony
Decoder
H
armony
Decoder
;
H
ybrid
Encoder
*
h
ybrid
_encoder_create
(
int
Fs
);
H
armony
Encoder
*
h
armony
_encoder_create
(
int
Fs
);
int
h
ybrid
_encode
(
H
ybrid
Encoder
*
st
,
const
short
*
pcm
,
int
frame_size
,
int
h
armony
_encode
(
H
armony
Encoder
*
st
,
const
short
*
pcm
,
int
frame_size
,
unsigned
char
*
data
,
int
bytes_per_packet
);
void
h
ybrid
_encoder_destroy
(
H
ybrid
Encoder
*
st
);
void
h
armony
_encoder_destroy
(
H
armony
Encoder
*
st
);
void
h
ybrid
_encoder_ctl
(
H
ybrid
Encoder
*
st
,
int
request
,
...);
void
h
armony
_encoder_ctl
(
H
armony
Encoder
*
st
,
int
request
,
...);
H
ybrid
Decoder
*
h
ybrid
_decoder_create
(
int
Fs
);
H
armony
Decoder
*
h
armony
_decoder_create
(
int
Fs
);
int
h
ybrid
_decode
(
H
ybrid
Decoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
int
h
armony
_decode
(
H
armony
Decoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
short
*
pcm
,
int
frame_size
);
void
h
ybrid
_decoder_ctl
(
H
ybrid
Decoder
*
st
,
int
request
,
...);
void
h
armony
_decoder_ctl
(
H
armony
Decoder
*
st
,
int
request
,
...);
void
h
ybrid
_decoder_destroy
(
H
ybrid
Decoder
*
st
);
void
h
armony
_decoder_destroy
(
H
armony
Decoder
*
st
);
#ifdef __cplusplus
}
#endif
#endif
/* H
YBRID
_H */
#endif
/* H
ARMONY
_H */
src/h
ybrid
_decoder.c
→
src/h
armony
_decoder.c
View file @
38f4e9ff
...
...
@@ -36,18 +36,18 @@
#include
<stdlib.h>
#include
<stdio.h>
#include
<stdarg.h>
#include
"h
ybrid
_decoder.h"
#include
"h
armony
_decoder.h"
#include
"entdec.h"
#include
"modes.h"
#include
"SKP_Silk_SDK_API.h"
H
ybrid
Decoder
*
h
ybrid
_decoder_create
(
int
Fs
)
H
armony
Decoder
*
h
armony
_decoder_create
(
int
Fs
)
{
char
*
raw_state
;
int
ret
,
silkDecSizeBytes
,
celtDecSizeBytes
;
CELTMode
*
celtMode
;
H
ybrid
Decoder
*
st
;
H
armony
Decoder
*
st
;
/* We should not have to create a CELT mode for each encoder state */
celtMode
=
celt_mode_create
(
Fs
,
Fs
/
50
,
NULL
);
...
...
@@ -58,10 +58,10 @@ HybridDecoder *hybrid_decoder_create(int Fs)
/* Handle error */
}
celtDecSizeBytes
=
celt_decoder_get_size
(
celtMode
,
1
);
raw_state
=
calloc
(
sizeof
(
H
ybrid
Decoder
)
+
silkDecSizeBytes
+
celtDecSizeBytes
,
1
);
st
=
(
H
ybrid
Decoder
*
)
raw_state
;
st
->
silk_dec
=
(
void
*
)(
raw_state
+
sizeof
(
H
ybrid
Decoder
));
st
->
celt_dec
=
(
CELTDecoder
*
)(
raw_state
+
sizeof
(
H
ybrid
Decoder
)
+
silkDecSizeBytes
);
raw_state
=
calloc
(
sizeof
(
H
armony
Decoder
)
+
silkDecSizeBytes
+
celtDecSizeBytes
,
1
);
st
=
(
H
armony
Decoder
*
)
raw_state
;
st
->
silk_dec
=
(
void
*
)(
raw_state
+
sizeof
(
H
armony
Decoder
));
st
->
celt_dec
=
(
CELTDecoder
*
)(
raw_state
+
sizeof
(
H
armony
Decoder
)
+
silkDecSizeBytes
);
st
->
Fs
=
Fs
;
st
->
celt_mode
=
celtMode
;
...
...
@@ -78,7 +78,7 @@ HybridDecoder *hybrid_decoder_create(int Fs)
return
st
;
}
int
h
ybrid
_decode
(
H
ybrid
Decoder
*
st
,
const
unsigned
char
*
data
,
int
h
armony
_decode
(
H
armony
Decoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
short
*
pcm
,
int
frame_size
)
{
int
i
,
silk_ret
=
0
,
celt_ret
=
0
;
...
...
@@ -164,7 +164,7 @@ int hybrid_decode(HybridDecoder *st, const unsigned char *data,
}
void
h
ybrid
_decoder_ctl
(
H
ybrid
Decoder
*
st
,
int
request
,
...)
void
h
armony
_decoder_ctl
(
H
armony
Decoder
*
st
,
int
request
,
...)
{
va_list
ap
;
...
...
@@ -172,39 +172,39 @@ void hybrid_decoder_ctl(HybridDecoder *st, int request, ...)
switch
(
request
)
{
case
H
YBRID
_SET_MODE_REQUEST
:
case
H
ARMONY
_SET_MODE_REQUEST
:
{
int
value
=
va_arg
(
ap
,
int
);
st
->
mode
=
value
;
}
break
;
case
H
YBRID
_GET_MODE_REQUEST
:
case
H
ARMONY
_GET_MODE_REQUEST
:
{
int
*
value
=
va_arg
(
ap
,
int
*
);
*
value
=
st
->
mode
;
}
break
;
case
H
YBRID
_SET_BANDWIDTH_REQUEST
:
case
H
ARMONY
_SET_BANDWIDTH_REQUEST
:
{
int
value
=
va_arg
(
ap
,
int
);
st
->
bandwidth
=
value
;
}
break
;
case
H
YBRID
_GET_BANDWIDTH_REQUEST
:
case
H
ARMONY
_GET_BANDWIDTH_REQUEST
:
{
int
*
value
=
va_arg
(
ap
,
int
*
);
*
value
=
st
->
bandwidth
;
}
break
;
default:
fprintf
(
stderr
,
"unknown h
ybrid
_decoder_ctl() request: %d"
,
request
);
fprintf
(
stderr
,
"unknown h
armony
_decoder_ctl() request: %d"
,
request
);
break
;
}
va_end
(
ap
);
}
void
h
ybrid
_decoder_destroy
(
H
ybrid
Decoder
*
st
)
void
h
armony
_decoder_destroy
(
H
armony
Decoder
*
st
)
{
celt_mode_destroy
(
st
->
celt_mode
);
...
...
src/h
ybrid
_decoder.h
→
src/h
armony
_decoder.h
View file @
38f4e9ff
...
...
@@ -29,13 +29,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef H
YBRID
_DECODER_H
#define H
YBRID
_DECODER_H
#ifndef H
ARMONY
_DECODER_H
#define H
ARMONY
_DECODER_H
#include
"celt.h"
#include
"h
ybrid
.h"
#include
"h
armony
.h"
struct
H
ybrid
Decoder
{
struct
H
armony
Decoder
{
CELTMode
*
celt_mode
;
CELTDecoder
*
celt_dec
;
void
*
silk_dec
;
...
...
@@ -47,5 +47,5 @@ struct HybridDecoder {
};
#endif
/* H
YBRID
_DECODER_H */
#endif
/* H
ARMONY
_DECODER_H */
src/h
ybrid
_encoder.c
→
src/h
armony
_encoder.c
View file @
38f4e9ff
...
...
@@ -36,16 +36,16 @@
#include
<stdlib.h>
#include
<stdio.h>
#include
<stdarg.h>
#include
"h
ybrid
_encoder.h"
#include
"h
armony
_encoder.h"
#include
"entenc.h"
#include
"modes.h"
#include
"SKP_Silk_SDK_API.h"
H
ybrid
Encoder
*
h
ybrid
_encoder_create
(
int
Fs
)
H
armony
Encoder
*
h
armony
_encoder_create
(
int
Fs
)
{
char
*
raw_state
;
CELTMode
*
celtMode
;
H
ybrid
Encoder
*
st
;
H
armony
Encoder
*
st
;
int
ret
,
silkEncSizeBytes
,
celtEncSizeBytes
;
SKP_SILK_SDK_EncControlStruct
encControl
;
...
...
@@ -58,10 +58,10 @@ HybridEncoder *hybrid_encoder_create(int Fs)
/* Handle error */
}
celtEncSizeBytes
=
celt_encoder_get_size
(
celtMode
,
1
);
raw_state
=
calloc
(
sizeof
(
H
ybrid
Encoder
)
+
silkEncSizeBytes
+
celtEncSizeBytes
,
1
);
st
=
(
H
ybrid
Encoder
*
)
raw_state
;
st
->
silk_enc
=
(
void
*
)(
raw_state
+
sizeof
(
H
ybrid
Encoder
));
st
->
celt_enc
=
(
CELTEncoder
*
)(
raw_state
+
sizeof
(
H
ybrid
Encoder
)
+
silkEncSizeBytes
);
raw_state
=
calloc
(
sizeof
(
H
armony
Encoder
)
+
silkEncSizeBytes
+
celtEncSizeBytes
,
1
);
st
=
(
H
armony
Encoder
*
)
raw_state
;
st
->
silk_enc
=
(
void
*
)(
raw_state
+
sizeof
(
H
armony
Encoder
));
st
->
celt_enc
=
(
CELTEncoder
*
)(
raw_state
+
sizeof
(
H
armony
Encoder
)
+
silkEncSizeBytes
);
st
->
Fs
=
Fs
;
st
->
celt_mode
=
celtMode
;
...
...
@@ -87,7 +87,7 @@ HybridEncoder *hybrid_encoder_create(int Fs)
return
st
;
}
int
h
ybrid
_encode
(
H
ybrid
Encoder
*
st
,
const
short
*
pcm
,
int
frame_size
,
int
h
armony
_encode
(
H
armony
Encoder
*
st
,
const
short
*
pcm
,
int
frame_size
,
unsigned
char
*
data
,
int
bytes_per_packet
)
{
int
i
;
...
...
@@ -199,7 +199,7 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size,
data
[
0
]
=
0x80
;
data
[
0
]
|=
tmp
<<
5
;
data
[
0
]
|=
period
<<
3
;
}
else
/* H
ybrid
*/
}
else
/* H
armony
*/
{
data
[
0
]
=
0x60
;
data
[
0
]
|=
(
st
->
bandwidth
-
BANDWIDTH_SUPERWIDEBAND
)
<<
4
;
...
...
@@ -210,7 +210,7 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size,
return
ret
+
1
;
}
void
h
ybrid
_encoder_ctl
(
H
ybrid
Encoder
*
st
,
int
request
,
...)
void
h
armony
_encoder_ctl
(
H
armony
Encoder
*
st
,
int
request
,
...)
{
va_list
ap
;
...
...
@@ -218,51 +218,51 @@ void hybrid_encoder_ctl(HybridEncoder *st, int request, ...)
switch
(
request
)
{
case
H
YBRID
_SET_MODE_REQUEST
:
case
H
ARMONY
_SET_MODE_REQUEST
:
{
int
value
=
va_arg
(
ap
,
int
);
st
->
mode
=
value
;
}
break
;
case
H
YBRID
_GET_MODE_REQUEST
:
case
H
ARMONY
_GET_MODE_REQUEST
:
{
int
*
value
=
va_arg
(
ap
,
int
*
);
*
value
=
st
->
mode
;
}
break
;
case
H
YBRID
_SET_BANDWIDTH_REQUEST
:
case
H
ARMONY
_SET_BANDWIDTH_REQUEST
:
{
int
value
=
va_arg
(
ap
,
int
);
st
->
bandwidth
=
value
;
}
break
;
case
H
YBRID
_GET_BANDWIDTH_REQUEST
:
case
H
ARMONY
_GET_BANDWIDTH_REQUEST
:
{
int
*
value
=
va_arg
(
ap
,
int
*
);
*
value
=
st
->
bandwidth
;
}
break
;
case
H
YBRID
_SET_VBR_RATE_REQUEST
:
case
H
ARMONY
_SET_VBR_RATE_REQUEST
:
{
int
value
=
va_arg
(
ap
,
int
);
st
->
vbr_rate
=
value
;
}
break
;
case
H
YBRID
_GET_VBR_RATE_REQUEST
:
case
H
ARMONY
_GET_VBR_RATE_REQUEST
:
{
int
*
value
=
va_arg
(
ap
,
int
*
);
*
value
=
st
->
vbr_rate
;
}
break
;
default:
fprintf
(
stderr
,
"unknown h
ybrid
_encoder_ctl() request: %d"
,
request
);
fprintf
(
stderr
,
"unknown h
armony
_encoder_ctl() request: %d"
,
request
);
break
;
}
va_end
(
ap
);
}
void
h
ybrid
_encoder_destroy
(
H
ybrid
Encoder
*
st
)
void
h
armony
_encoder_destroy
(
H
armony
Encoder
*
st
)
{
celt_mode_destroy
(
st
->
celt_mode
);
free
(
st
);
...
...
src/h
ybrid
_encoder.h
→
src/h
armony
_encoder.h
View file @
38f4e9ff
...
...
@@ -29,17 +29,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef H
YBRID
_ENCODER_H
#define H
YBRID
_ENCODER_H
#ifndef H
ARMONY
_ENCODER_H
#define H
ARMONY
_ENCODER_H
#include
"celt.h"
#include
"h
ybrid
.h"
#include
"h
armony
.h"
#include
"SKP_Silk_SDK_API.h"
/* FIXME: This is only valid for 48 kHz */
#define ENCODER_DELAY_COMPENSATION 130
struct
H
ybrid
Encoder
{
struct
H
armony
Encoder
{
CELTMode
*
celt_mode
;
CELTEncoder
*
celt_enc
;
void
*
silk_enc
;
...
...
@@ -54,5 +54,5 @@ struct HybridEncoder {
};
#endif
/* H
YBRID
_ENCODER_H */
#endif
/* H
ARMONY
_ENCODER_H */
src/test_h
ybrid
.c
→
src/test_h
armony
.c
View file @
38f4e9ff
...
...
@@ -38,7 +38,7 @@
#include
<stdlib.h>
#include
<math.h>
#include
<string.h>
#include
"h
ybrid
.h"
#include
"h
armony
.h"
#define MAX_PACKET 1024
...
...
@@ -48,8 +48,8 @@ int main(int argc, char *argv[])
int
err
;
char
*
inFile
,
*
outFile
;
FILE
*
fin
,
*
fout
;
H
ybrid
Encoder
*
enc
;
H
ybrid
Decoder
*
dec
;
H
armony
Encoder
*
enc
;
H
armony
Decoder
*
dec
;
int
len
;
int
frame_size
,
channels
;
int
bytes_per_packet
;
...
...
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
double
bits
=
0
;
if
(
argc
!=
9
&&
argc
!=
8
&&
argc
!=
7
)
{
fprintf
(
stderr
,
"Usage: test_h
ybrid
<rate (kHz)> <channels> <frame size> "
fprintf
(
stderr
,
"Usage: test_h
armony
<rate (kHz)> <channels> <frame size> "
" <bytes per packet> [<VBR rate (kb/s)>] [<packet loss rate>] "
"<input> <output>
\n
"
);
return
1
;
...
...
@@ -105,15 +105,15 @@ int main(int argc, char *argv[])
return
1
;
}
enc
=
h
ybrid
_encoder_create
(
rate
);
dec
=
h
ybrid
_decoder_create
(
rate
);
enc
=
h
armony
_encoder_create
(
rate
);
dec
=
h
armony
_decoder_create
(
rate
);
mode
=
MODE_HYBRID
;
h
ybrid
_encoder_ctl
(
enc
,
H
YBRID
_SET_BANDWIDTH
(
BANDWIDTH_FULLBAND
));
h
ybrid
_encoder_ctl
(
enc
,
H
YBRID
_SET_MODE
(
mode
));
h
armony
_encoder_ctl
(
enc
,
H
ARMONY
_SET_BANDWIDTH
(
BANDWIDTH_FULLBAND
));
h
armony
_encoder_ctl
(
enc
,
H
ARMONY
_SET_MODE
(
mode
));
if
(
vbr
)
h
ybrid
_encoder_ctl
(
enc
,
H
YBRID
_SET_VBR_RATE
(
vbr
));
h
armony
_encoder_ctl
(
enc
,
H
ARMONY
_SET_VBR_RATE
(
vbr
));
skip
=
5
*
rate
/
1000
+
10
;
...
...
@@ -130,14 +130,14 @@ int main(int argc, char *argv[])
for
(
i
=
err
;
i
<
frame_size
*
channels
;
i
++
)
in
[
i
]
=
0
;
}
len
=
h
ybrid
_encode
(
enc
,
in
,
frame_size
,
data
,
bytes_per_packet
);
len
=
h
armony
_encode
(
enc
,
in
,
frame_size
,
data
,
bytes_per_packet
);
if
(
len
<=
0
)
{
fprintf
(
stderr
,
"h
ybrid
_encode() returned %d
\n
"
,
len
);
fprintf
(
stderr
,
"h
armony
_encode() returned %d
\n
"
,
len
);
return
1
;
}
bits
+=
len
*
8
;
h
ybrid
_decode
(
dec
,
rand
()
%
100
<
loss
?
NULL
:
data
,
len
,
out
,
frame_size
);
h
armony
_decode
(
dec
,
rand
()
%
100
<
loss
?
NULL
:
data
,
len
,
out
,
frame_size
);
count
++
;
tot_written
+=
(
frame_size
-
skip
)
*
channels
;
write_samples
=
frame_size
;
...
...
@@ -150,8 +150,8 @@ int main(int argc, char *argv[])
skip
=
0
;
}
fprintf
(
stderr
,
"average bit-rate: %f kb/s
\n
"
,
bits
*
rate
/
(
frame_size
*
(
double
)
count
));
h
ybrid
_encoder_destroy
(
enc
);
h
ybrid
_decoder_destroy
(
dec
);
h
armony
_encoder_destroy
(
enc
);
h
armony
_decoder_destroy
(
dec
);
fclose
(
fin
);
fclose
(
fout
);
free
(
in
);
...
...
Write
Preview
Supports
Markdown
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