Fix Hybrid CBR with DRED and CELT->SILK redundancy

Need to move the redundant frame even in CBR because the hybrid
frame now gets encoded as VBR, with DRED picking up the rest.
Fixes an issue introduced in 4600e77.
This commit is contained in:
Jean-Marc Valin 2023-12-19 22:12:03 -05:00 committed by Jean-Marc Valin
parent b63e22cff9
commit 231caa3720
No known key found for this signature in database
GPG Key ID: 5E5DD9A36F9189C8

View File

@ -2232,7 +2232,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
return OPUS_INTERNAL_ERROR;
}
/* Put CELT->SILK redundancy data in the right place. */
if (redundancy && celt_to_silk && st->mode==MODE_HYBRID && st->use_vbr)
if (redundancy && celt_to_silk && st->mode==MODE_HYBRID && nb_compr_bytes != ret)
{
OPUS_MOVE(data+ret, data+nb_compr_bytes, redundancy_bytes);
nb_compr_bytes = ret+redundancy_bytes;