Commit f57c1804 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

fix ISM MD delay round-off issue

parent d3508f9d
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT  /* Dolby: Issue 2250:  random vector generation in GenShapedSHBExcitation() */
#define FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE  /* VA: Precision improvement without increasing complexity, or complexity reduction that might be not BE on the LSB */
#define FIX_2252_LP_CNG_STARTS_SID                      /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */
#define FIX_2283_ISM_MD_DELAY                           /* Dolby: Fix ISM metadata delay round-off */

/* ##################### End NON-BE switches ########################### */

+5 −0
Original line number Diff line number Diff line
@@ -1678,8 +1678,13 @@ static ivas_error alignInputDelay(
                Word64 tmp;
                inputIsm = (input_ism *) inputBase;

#ifdef FIX_2283_ISM_MD_DELAY
                tmp = W_mult0_32_32( L_add( maxGlobalDelayNs, 500000 /* + 0.5ms for rounding */ ) /* Q0 */, 4295 /* (1 / 1e6f) in Q32 */ ); // Q32
                inputIsm->ism_metadata_delay_ms_fx = add( inputIsm->ism_metadata_delay_ms_fx, extract_l( W_extract_h( tmp ) ) );
#else
                tmp = W_mult0_32_32( L_add( maxGlobalDelayNs, 500000 /* + 0.5ms for rounding */ ) /* Q0 */, 2147 /* (1 / 1e6f) in Q31 */ ); // Q31
                inputIsm->ism_metadata_delay_ms_fx = add( inputIsm->ism_metadata_delay_ms_fx, extract_h( W_extract_h( tmp ) ) );
#endif
            }
        }
    }