Skip to content
Snippets Groups Projects
Unverified Commit 997fdf54 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Change pitch scaling behavior wrt nFramesPerPacket

Not sure if it was the original intent, but we now reduce the
loss percentage threshold for pitch scaling as 1/nFramesPerPacket
since only the first frame will have pitch scaling anyway.
As a side effect, this brings back the original behavior of
disabling pitch scaling for 0% loss.
parent ab04fbb1
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ void silk_LTP_scale_ctrl_FIX(
if( condCoding == CODE_INDEPENDENTLY ) {
/* Only scale if first frame in packet */
round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket;
round_loss = psEnc->sCmn.PacketLoss_perc * psEnc->sCmn.nFramesPerPacket;
if ( psEnc->sCmn.LBRR_flag ) {
/* LBRR reduces the effective loss. In practice, it does not square the loss because
losses aren't independent, but that still seems to work best. We also never go below 2%. */
......
......@@ -41,7 +41,7 @@ void silk_LTP_scale_ctrl_FLP(
if( condCoding == CODE_INDEPENDENTLY ) {
/* Only scale if first frame in packet */
round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket;
round_loss = psEnc->sCmn.PacketLoss_perc * psEnc->sCmn.nFramesPerPacket;
if ( psEnc->sCmn.LBRR_flag ) {
/* LBRR reduces the effective loss. In practice, it does not square the loss because
losses aren't independent, but that still seems to work best. We also never go below 2%. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment