Commit beed2104 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3GPP issue 1542: One bit systematic error between BASOP and float...

Fix for 3GPP issue 1542: One bit systematic error between BASOP and float decoder MASA EXT output of energy ratios

Link #1542
parent 8611527b
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -2572,13 +2572,9 @@ static void create_masa_ext_out_meta_fx(
            {
                FOR( b_new = bandMap[b_old]; b_new < bandMap[b_old + 1]; b_new++ )
                {
                    IF( EQ_32( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], ONE_IN_Q30 ) )
                    {
                        hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf]--;
                    }
                    UWord8 tmp = (UWord8) L_shr( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], Q30 - 8 ); // Q8
                    UWord8 tmp = (UWord8) W_extract_h( W_mult_32_16( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], UINT8_MAX << 1 ) ); //Q0
                    move16();
                    extOutMeta->directToTotalRatio[dir][sf][b_new] = tmp; // Q8
                    extOutMeta->directToTotalRatio[dir][sf][b_new] = tmp; // Q0
                    move16();
                }
            }
@@ -2637,12 +2633,8 @@ static void create_masa_ext_out_meta_fx(
                move16();
                FOR( dir = 0; dir < numDirections; dir++ )
                {
                    /* todo: not optimal, but less invasive */
                    IF( EQ_32( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], ONE_IN_Q30 ) )
                    {
                        hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf]--;
                    }
                    UWord8 tmp = (UWord8) L_shr( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], Q30 - 8 ); // Q8

                    UWord8 tmp = (UWord8) W_extract_h( W_mult_32_16( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], UINT8_MAX << 1 ) ); //Q0
                    move16();
                    extOutMeta->diffuseToTotalRatio[sf][b_new] = (UWord8) sub( extOutMeta->diffuseToTotalRatio[sf][b_new], tmp ); // Q8
                    move16();