mirror of
https://github.com/xiph/opus.git
synced 2025-06-07 07:50:51 +00:00
Update bandwidth and opusCanSwitch before generating SILK DTX ToC
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
This commit is contained in:
parent
9962bf3d94
commit
33698ee159
2 changed files with 10 additions and 13 deletions
|
@ -2070,13 +2070,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
|
||||||
RESTORE_STACK;
|
RESTORE_STACK;
|
||||||
return OPUS_INTERNAL_ERROR;
|
return OPUS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
if (nBytes==0)
|
|
||||||
{
|
|
||||||
st->rangeFinal = 0;
|
|
||||||
data[-1] = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels);
|
|
||||||
RESTORE_STACK;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
/* Extract SILK internal bandwidth for signaling in first byte */
|
/* Extract SILK internal bandwidth for signaling in first byte */
|
||||||
if( st->mode == MODE_SILK_ONLY ) {
|
if( st->mode == MODE_SILK_ONLY ) {
|
||||||
if( st->silk_mode.internalSampleRate == 8000 ) {
|
if( st->silk_mode.internalSampleRate == 8000 ) {
|
||||||
|
@ -2091,6 +2085,15 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
|
||||||
}
|
}
|
||||||
|
|
||||||
st->silk_mode.opusCanSwitch = st->silk_mode.switchReady && !st->nonfinal_frame;
|
st->silk_mode.opusCanSwitch = st->silk_mode.switchReady && !st->nonfinal_frame;
|
||||||
|
|
||||||
|
if (nBytes==0)
|
||||||
|
{
|
||||||
|
st->rangeFinal = 0;
|
||||||
|
data[-1] = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels);
|
||||||
|
RESTORE_STACK;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: How do we allocate the redundancy for CBR? */
|
/* FIXME: How do we allocate the redundancy for CBR? */
|
||||||
if (st->silk_mode.opusCanSwitch)
|
if (st->silk_mode.opusCanSwitch)
|
||||||
{
|
{
|
||||||
|
|
|
@ -236,12 +236,6 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
|
||||||
int frame_size_enum = get_frame_size_enum(frame_size, sampling_rate);
|
int frame_size_enum = get_frame_size_enum(frame_size, sampling_rate);
|
||||||
force_channel = IMIN(force_channel, num_channels);
|
force_channel = IMIN(force_channel, num_channels);
|
||||||
|
|
||||||
/* Todo: remove when a fix is available for coding SILK in DTX mode for >60 ms.
|
|
||||||
* Currently, SILK may internally adjust the bandwidth leading to mismatching
|
|
||||||
* bandwidths within a packet. */
|
|
||||||
if (frame_size_ms_x2 > 120)
|
|
||||||
dtx = 0;
|
|
||||||
|
|
||||||
sprintf(debug_info,
|
sprintf(debug_info,
|
||||||
"fuzz_encoder_settings: %d kHz, %d ch, application: %d, "
|
"fuzz_encoder_settings: %d kHz, %d ch, application: %d, "
|
||||||
"%d bps, force ch: %d, vbr: %d, vbr constraint: %d, complexity: %d, "
|
"%d bps, force ch: %d, vbr: %d, vbr constraint: %d, complexity: %d, "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue