Commit 8a69cf17 authored by vaillancour's avatar vaillancour
Browse files

more comments to limiter functions

parent 67a77ab8
Loading
Loading
Loading
Loading
+29 −1
Original line number Diff line number Diff line
@@ -1030,7 +1030,25 @@ static int16_t limit_idx_Dwnmix(

    idx = idx_in;
    idx = check_bounds_s( idx, 1, 29 );

   /*-------------------------------------------------------------------*
    * The ratio index is limited between [1. 29]
    * in case of uncorrelated content 
    * (not interfering talker, but really uncorrelated left and right channel) 
    * after the transition period, some more checks are done to choose the 
    * dominant channel 
    * if the ratio index is below or equal to mid-range (15) 
    *   and the instantaneous ratio index is below 17
    *   then the right channel will be considered as dominant (0 or 1)
    * else if the ratio index is above or equal to mid-range (15) 
    *   and the instantaneous ratio index is above 14
    *   then the left channel will be considered as dominant (29 or 30)
    * else if the instantaneous ratio index is below 11
    *   then the right channel will be considered as dominant (0 or 1)
    * else if the instantaneous ratio index is above 19
    *   then the left channel will be considered as dominant (29 or 30)
    * else the previous ratio index will be used
    * 
    *-------------------------------------------------------------------*/
    if ( unclr_decision == 1 && tdm_last_LRTD_frame_cnt > 1 )
    {
        if ( tdm_last_LRTD_PriCh_cnt > 0 )
@@ -1080,6 +1098,16 @@ static int16_t limit_idx_NoDwnmix(
    int16_t idx;

    idx = idx_in;
   /*-------------------------------------------------------------------*
    * if the energy ratio index is close to the mid range ]10,20[, 
    * but changing primary to secondary channel is not recommended the output 
    * index is forced to 30 (dominant left channel) unless the raw 
    * correlation difference in negative (pointing to dominant right channel ) 
    * else, 
    *   the output index is force to 0 (dominant right channel) 
    *   if the index is below or equal to mid-range 
    *   else it is force to 30 (dominant left channel)
    *-------------------------------------------------------------------*/
    if ( side_can_change == 0 && idx_in > 10 && idx_in < 20 )
    {
        idx = 30;