diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-04-08 00:48:28 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-04-08 00:48:28 +0100 |
commit | c39fba703bf35da0b4b894b2b33978c205507341 (patch) | |
tree | cbfb51e11c41a1b6f7c89bc241249dc7958bd6f1 | |
parent | 42ffc67208b18e7048c0deed0ff3b289c870c66d (diff) | |
download | ffmpeg-c39fba703bf35da0b4b894b2b33978c205507341.tar.gz |
opusenc: do not signal digital silence
Apparently its only use is to enable comfort noise/error recovery.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
-rw-r--r-- | libavcodec/opusenc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index d80ae7a5e4..4e0781bf51 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -249,9 +249,9 @@ static void celt_frame_mdct(OpusEncContext *s, CeltFrame *f) } /* Fills the bands and normalizes them */ -static int celt_frame_map_norm_bands(OpusEncContext *s, CeltFrame *f) +static void celt_frame_map_norm_bands(OpusEncContext *s, CeltFrame *f) { - int i, j, ch, noise = 0; + int i, j, ch; for (ch = 0; ch < f->channels; ch++) { CeltBlock *block = &f->block[ch]; @@ -274,10 +274,8 @@ static int celt_frame_map_norm_bands(OpusEncContext *s, CeltFrame *f) /* CELT_ENERGY_SILENCE is what the decoder uses and its not -infinity */ block->energy[i] = FFMAX(block->energy[i], CELT_ENERGY_SILENCE); - noise |= block->energy[i] > CELT_ENERGY_SILENCE; } } - return !noise; } static void celt_enc_tf(OpusRangeCoder *rc, CeltFrame *f) @@ -811,11 +809,7 @@ static void celt_encode_frame(OpusEncContext *s, OpusRangeCoder *rc, CeltFrame * /* Not implemented */ } celt_frame_mdct(s, f); - f->silence = celt_frame_map_norm_bands(s, f); - if (f->silence) { - f->framebits = 1; - return; - } + celt_frame_map_norm_bands(s, f); ff_opus_rc_enc_log(rc, f->silence, 15); |