Commit 8b75b675 authored by sekine's avatar sekine
Browse files

Added inline comments for explanations of NTT_UPDATE_ITD_SW codes.

parent 5c62f4b7
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -459,31 +459,31 @@ static float find_poc_peak(
        *itd = ( *itd > 0 ) ? (float) itdLR[0] : (float) itdLR[1];
    }
#else
    if ( ( on[0] && prev_off[0] ) && ( on[1] && prev_off[1] ) )
    if ( ( on[0] && prev_off[0] ) && ( on[1] && prev_off[1] ) ) /*if both channels have newly detected as active (possibility of preceding), select channel by peakness Q[] of POC */
    {
        *itd = ( Q[0] > Q[1] ) ? (float) itdLR[0] : (float) itdLR[1];
    }
    else if ( ( on[0] && prev_off[0] ) && ( Q[0] > ( Q[1] - 0.1 ) ) )
    else if ( ( on[0] && prev_off[0] ) && ( Q[0] > ( Q[1] - 0.1 ) ) ) /* if channel 0 becomes active, select channel 0*/
    {
        *itd = (float) itdLR[0];
    }
    else if ( ( on[1] && prev_off[1] ) && ( Q[1] > ( Q[0] - 0.1 ) ) )
    else if ( ( on[1] && prev_off[1] ) && ( Q[1] > ( Q[0] - 0.1 ) ) ) /*if channel 1 becomes active, selsect channel 1*/
    {
        *itd = (float) itdLR[1];
    }
    else if ( Q[0] > ( Q[1] + Q_BAND ) )
    else if ( Q[0] > ( Q[1] + Q_BAND ) ) /* if no status change, use Q[]*/
    {
        *itd = (float) itdLR[0];
    }
    else if ( Q[1] > ( Q[0] + Q_BAND ) )
    else if ( Q[1] > ( Q[0] + Q_BAND ) ) /* if no status change, use Q[]*/
    {
        *itd = (float) itdLR[1];
    }
    else if ( *itd == 0.0 )
    else if ( *itd == 0.0 ) /*if no channels are likely to be preceding, follow the status of the previous frame*/
    {
        *itd = 0;
    }
    else
    else /*follow the status of the previous frame*/
    {
        *itd = ( *itd > 0 ) ? (float) itdLR[0] : (float) itdLR[1];
    }