Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
6af380d8
Commit
6af380d8
authored
Jun 10, 2009
by
Alexandre Savard
Browse files
[#936] Test using a frame size at 320 smpls
parent
c132248c
Changes
3
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/audio/codecs/speexcodec_nb.cpp
View file @
6af380d8
...
...
@@ -113,11 +113,12 @@ class Speex : public AudioCodec{
{
int
ratio
=
320
/
_speex_frame_size
;
printf
(
"Codec::codecDecode() size %i
\n
"
,
size
);
printf
(
"Codec::codecDecode() ratio %i
\n
"
,
ratio
);
printf
(
"Codec::codecDecode() _speex_frame_size %i
\n
"
,
_speex_frame_size
);
speex_bits_read_from
(
&
_speex_dec_bits
,
(
char
*
)
src
,
size
);
speex_decode_int
(
_speex_dec_state
,
&
_speex_dec_bits
,
dst
);
printf
(
"Codec::codec
En
code() _speex_frame_size * ratio %i
\n
"
,
_speex_frame_size
*
ratio
);
printf
(
"Codec::codec
De
code() _speex_frame_size * ratio %i
\n
"
,
_speex_frame_size
*
ratio
);
return
_speex_frame_size
*
ratio
;
}
...
...
@@ -129,10 +130,11 @@ class Speex : public AudioCodec{
speex_preprocess_run
(
_preprocess_state
,
src
);
#endif
printf
(
"Codec::codecEncode() size %i
\n
"
,
size
);
speex_encode_int
(
_speex_enc_state
,
src
,
&
_speex_enc_bits
);
int
nbBytes
=
speex_bits_write
(
&
_speex_enc_bits
,
(
char
*
)
dst
,
size
);
printf
(
"Codec::codec
De
code() nbBytes %i"
,
nbBytes
);
printf
(
"Codec::codec
En
code() nbBytes %i
\n
"
,
nbBytes
);
return
nbBytes
;
}
...
...
sflphone-common/src/audio/codecs/speexcodec_ub.cpp
View file @
6af380d8
...
...
@@ -36,7 +36,7 @@ class Speex : public AudioCodec{
_preprocess_state
()
{
_clockRate
=
32000
;
_frameSize
=
64
0
;
// 20 ms at
16
kHz
_frameSize
=
32
0
;
// 20 ms at
32
kHz
_channel
=
1
;
_bitrate
=
0
;
_bandwidth
=
0
;
...
...
@@ -113,12 +113,13 @@ class Speex : public AudioCodec{
{
// int ratio = 320 / _speex_frame_size;
printf
(
"Codec::codecDecode() size %i
\n
"
,
size
);
// printf("Codec::codecDecode() ratio %i\n", ratio);
//
printf("Codec::codecDecode() _speex_frame_size %i\n", _speex_frame_size);
printf
(
"Codec::codecDecode() _speex_frame_size %i
\n
"
,
_speex_frame_size
);
speex_bits_read_from
(
&
_speex_dec_bits
,
(
char
*
)
src
,
size
);
speex_decode_int
(
_speex_dec_state
,
&
_speex_dec_bits
,
dst
);
// printf("Codec::codecEncode() _speex_frame_size * ratio %i\n", _speex_frame_size * ratio);
return
128
0
;
return
64
0
;
}
virtual
int
codecEncode
(
unsigned
char
*
dst
,
short
*
src
,
unsigned
int
size
)
...
...
@@ -129,7 +130,8 @@ class Speex : public AudioCodec{
speex_preprocess_run
(
_preprocess_state
,
src
);
#endif
printf
(
"Codec::codecEncode() nbBytes: %i
\n
"
,
size
);
printf
(
"Codec::codecEncode() size: %i
\n
"
,
size
);
speex_encode_int
(
_speex_enc_state
,
src
,
&
_speex_enc_bits
);
int
nbBytes
=
speex_bits_write
(
&
_speex_enc_bits
,
(
char
*
)
dst
,
size
);
printf
(
"Codec::codecEncode() nbBytes: %i
\n
"
,
nbBytes
);
...
...
sflphone-common/src/audio/codecs/speexcodec_wb.cpp
View file @
6af380d8
...
...
@@ -113,11 +113,12 @@ class Speex : public AudioCodec{
{
int
ratio
=
320
/
_speex_frame_size
;
printf
(
"Codec::codecDecode() size %i
\n
"
,
size
);
printf
(
"Codec::codecDecode() ratio %i
\n
"
,
ratio
);
printf
(
"Codec::codecDecode() _speex_frame_size %i
\n
"
,
_speex_frame_size
);
speex_bits_read_from
(
&
_speex_dec_bits
,
(
char
*
)
src
,
size
);
speex_decode_int
(
_speex_dec_state
,
&
_speex_dec_bits
,
dst
);
printf
(
"Codec::codec
En
code() _speex_frame_size * ratio %i
\n
"
,
_speex_frame_size
*
ratio
);
printf
(
"Codec::codec
De
code() _speex_frame_size * ratio %i
\n
"
,
_speex_frame_size
*
ratio
);
return
2
*
_speex_frame_size
*
ratio
;
}
...
...
@@ -131,9 +132,10 @@ class Speex : public AudioCodec{
speex_preprocess_run
(
_preprocess_state
,
src
);
#endif
printf
(
"Codec::codecEncode() size %i
\n
"
,
size
);
speex_encode_int
(
_speex_enc_state
,
src
,
&
_speex_enc_bits
);
int
nbBytes
=
speex_bits_write
(
&
_speex_enc_bits
,
(
char
*
)
dst
,
size
);
printf
(
"Codec::codec
De
code() nbBytes %i"
,
nbBytes
);
printf
(
"Codec::codec
En
code() nbBytes %i
\n
"
,
nbBytes
);
return
nbBytes
;
}
...
...
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