Commit be7d8ed1 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Manuel Jander
Browse files

Scaling related fix in ivas_enc_fx

parent 2f5ee23c
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -344,7 +344,10 @@ ivas_error ivas_enc_fx(
                {
                    norm_data_in = s_min( norm_data_in, L_norm_arr( data_fx[i], input_frame ) );
                }
                IF( LT_16( norm_data_in, 31 ) )
                {
                    norm_data_in = sub( norm_data_in, 7 );    /*guard bit is 4->to handle overflow in cldfbAnalysis*/
                    norm_data_in = s_min( norm_data_in, 20 ); // limit Q to 31 (11 + norm)
                    FOR( i = 0; i < hEncoderConfig->nchan_ism + st_ivas->nchan_transport; i++ )
                    {
                        scale_sig32( data_fx[i], input_frame, norm_data_in ); /*  st_ivas->q_data_fx + norm_data_in */
@@ -352,6 +355,12 @@ ivas_error ivas_enc_fx(
                    st_ivas->q_data_fx = add( st_ivas->q_data_fx, norm_data_in );
                    move16();
                }
                ELSE
                {
                    st_ivas->q_data_fx = 31;
                    move16();
                }
            }

            /* Estimate MASA parameters for the objects */
            ivas_omasa_enc_fx( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hIsmMetaData, data_fx, st_ivas->q_data_fx, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object_fx, &idx_separated_object );