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
Mark Harris
Opus
Commits
5ad41a36
Commit
5ad41a36
authored
Feb 04, 2011
by
Koen Vos
Committed by
Jean-Marc Valin
Feb 04, 2011
Browse files
Tuning the hybrid bit-rate split
parent
2c8b2980
Changes
2
Hide whitespace changes
Inline
Side-by-side
celt
@
4305ab6b
Subproject commit
a093f4df740b7680443e938775b4db2b0fa24844
Subproject commit
4305ab6bfbd23dcf83ca40af67ef7542fa63f71a
src/opus_encoder.c
View file @
5ad41a36
...
...
@@ -111,18 +111,18 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
if
(
st
->
bandwidth
==
BANDWIDTH_SUPERWIDEBAND
)
{
if
(
st
->
Fs
==
100
*
frame_size
)
{
/* 24 kHz, 10 ms */
st
->
silk_mode
.
bitRate
=
(
(
st
->
silk_mode
.
bitRate
+
1
2000
-
(
1
-
st
->
use_vbr
)
*
1000
0
)
*
2
)
/
3
;
st
->
silk_mode
.
bitRate
=
(
(
st
->
silk_mode
.
bitRate
+
2000
+
st
->
use_vbr
*
1000
)
*
2
)
/
3
;
}
else
{
/* 24 kHz, 20 ms */
st
->
silk_mode
.
bitRate
=
(
(
st
->
silk_mode
.
bitRate
+
8
000
-
(
1
-
st
->
use_vbr
)
*
7
000
)
*
2
)
/
3
;
st
->
silk_mode
.
bitRate
=
(
(
st
->
silk_mode
.
bitRate
+
1
000
+
st
->
use_vbr
*
1
000
)
*
2
)
/
3
;
}
}
else
{
if
(
st
->
Fs
==
100
*
frame_size
)
{
/* 48 kHz, 10 ms */
st
->
silk_mode
.
bitRate
=
(
st
->
silk_mode
.
bitRate
+
16
000
-
(
1
-
st
->
use_vbr
)
*
8
000
)
/
2
;
st
->
silk_mode
.
bitRate
=
(
st
->
silk_mode
.
bitRate
+
8
000
+
st
->
use_vbr
*
3
000
)
/
2
;
}
else
{
/* 48 kHz, 20 ms */
st
->
silk_mode
.
bitRate
=
(
st
->
silk_mode
.
bitRate
+
14
000
-
(
1
-
st
->
use_vbr
)
*
5
000
)
/
2
;
st
->
silk_mode
.
bitRate
=
(
st
->
silk_mode
.
bitRate
+
9
000
+
st
->
use_vbr
*
1
000
)
/
2
;
}
}
}
...
...
@@ -194,7 +194,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
len
=
(
ec_tell
(
&
enc
)
+
7
)
>>
3
;
if
(
st
->
use_vbr
)
{
nb_compr_bytes
=
len
+
(
st
->
bit
r
ate
_bps
-
12000
)
*
frame_size
/
(
2
*
8
*
st
->
Fs
);
nb_compr_bytes
=
len
+
bytes_target
-
(
st
->
silk_mode
.
bit
R
ate
*
frame_size
)
/
(
8
*
st
->
Fs
);
}
else
{
/* check if SILK used up too much */
nb_compr_bytes
=
len
>
bytes_target
?
len
:
bytes_target
;
...
...
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