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

alternative to qmetadata penalty calculation

parent 90ee154b
Loading
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
@@ -526,9 +526,14 @@ ivas_error only_reduce_bits_direction_fx(
    Word16 *bits_dir0;

    Word16 bits_sph_idx_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES];
#ifdef FIX_QMETADATA_PENALTY 
    Word32 penalty[MASA_MAXIMUM_CODING_SUBBANDS];
    Word16 tmp;
#else
    Word16 penalty[MASA_MAXIMUM_CODING_SUBBANDS];
    Word16 shift, tmp, tmp_e, flag;
    Word32 tmp_32;
#endif
    FOR( j = 0; j < coding_subbands; j++ )
    {
        FOR( k = 0; k < no_subframes; k++ )
@@ -612,6 +617,34 @@ ivas_error only_reduce_bits_direction_fx(
    }
    ELSE
    {
#ifdef FIX_QMETADATA_PENALTY    
        FOR( j = 0; j < coding_subbands; j++ )
        {
            penalty[j] = 1;
            move32();
            FOR( k = 0; k < coding_subbands; k++ )
            {
                IF( NE_16(k, j) )
                {
                    penalty[j] = L_shr( W_extract_l( W_mult_32_16( penalty[j], bits_sph_idx_orig[k][0] ) ), 1 );
                }
            }
                 
            tmp = sub( bits_sph_idx_orig[j][0], q_direction->band_data[j].bits_sph_idx[0] ); 
            FOR( k = 1; k < no_subframes; k++ )
            {
                tmp = add( tmp, sub( bits_sph_idx_orig[j][k], q_direction->band_data[j].bits_sph_idx[k] ) ) ;
            }
        
            penalty[j] =  L_shr(W_extract_l( W_mult_32_16( penalty[j], tmp )), 1);
        }
        sort_desc_ind_32_fx( penalty, coding_subbands, ind_order );
        for ( j = 0; j < coding_subbands; j++ )
        {
            printf( "%d ", ind_order[j] );
        }
        printf( "\n" );
#else
        FOR( j = 0; j < coding_subbands; j++ )
        {
            penalty[j] = 0;
@@ -669,6 +702,7 @@ ivas_error only_reduce_bits_direction_fx(
            }
        }
        sort_desc_ind_16_fx( penalty, coding_subbands, ind_order );
#endif
    }

    *reduce_bits_out = negate( reduce_bits );
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@

#define FIX_ISSUE_723_INFO_TCX_NOISE /*FhG: Issue 723: fix for IGF that introduces wrong noise filling behavion*/

#define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */

/* ##################### End NON-BE switches ########################### */
#define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE
#define FIX_746  // proposed fix to solve low bit-rate frame boundaries issues