diff --git a/lib_com/options.h b/lib_com/options.h index ee8c6be3a9aa0af714ecc976f86e5934592bbd16..3e6e9f1cb209d362b1242b0b48a548c30659bf1f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 ########################### */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 9b42d17b211d0bd82cd8c0f9bea063ed767db637..061655e806aabaa0ccafa77b39ad0fce92f6dce0 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -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 } } }