From 26272dddb88b8a15defd8167d6786e05a2e752b7 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 5 Jun 2025 14:50:39 +0530 Subject: [PATCH] Fix for 3GPP issue 1726: Renderer crash with assert for OMASA to MONO (renderBufferChannelLerp_fx) Link #1726 --- lib_com/cnst.h | 18 ++++++++++-------- lib_rend/lib_rend_fx.c | 6 ++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index a2d051d87..17dbc31c4 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -45,20 +45,22 @@ #define MATRIX_CONSTANT (759250113) #define NUM_SAMPLES_960 (960) #define NUM_SAMPLES_720 (720) +#define NUM_SAMPLES_640 (640) #define NUM_SAMPLES_320 (320) #define NUM_SAMPLES_160 (160) #define L_SUBFRAME_48k (240) #define L_SUBFRAME_32k (180) #define L_SUBFRAME_16k (80) #define L_SUBFRAME_8k (40) -#define Q31_BY_NUM_SAMPLES_960 ( 2239294 ) -#define Q31_BY_NUM_SAMPLES_720 ( 2986764 ) -#define Q31_BY_NUM_SAMPLES_320 ( 6731924 ) -#define Q31_BY_NUM_SAMPLES_160 ( 13506186 ) -#define Q31_BY_SUB_FRAME_240 ( 8985287 ) -#define Q31_BY_SUB_FRAME_180 ( 11997115 ) -#define Q31_BY_SUB_FRAME_80 ( 27183337 ) -#define Q31_BY_SUB_FRAME_40 ( 55063683 ) +#define Q31_BY_NUM_SAMPLES_960 ( 2239294 ) /* 1/959 in Q31 */ +#define Q31_BY_NUM_SAMPLES_720 ( 2986764 ) /* 1/719 in Q31 */ +#define Q31_BY_NUM_SAMPLES_640 ( 3360694 ) /* 1/639 in Q31 */ +#define Q31_BY_NUM_SAMPLES_320 ( 6731924 ) /* 1/319 in Q31 */ +#define Q31_BY_NUM_SAMPLES_160 ( 13506186 ) /* 1/159 in Q31 */ +#define Q31_BY_SUB_FRAME_240 ( 8985287 ) /* 1/239 in Q31 */ +#define Q31_BY_SUB_FRAME_180 ( 11997115 ) /* 1/179 in Q31 */ +#define Q31_BY_SUB_FRAME_80 ( 27183337 ) /* 1/79 in Q31 */ +#define Q31_BY_SUB_FRAME_40 ( 55063683 ) /* 1/39 in Q31 */ /*----------------------------------------------------------------------------------* diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index e39b9a61e..2b70c2e21 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4579,6 +4579,12 @@ static void renderBufferChannelLerp_fx( move32(); move32(); BREAK; + case NUM_SAMPLES_640: + tmp = Q31_BY_NUM_SAMPLES_640; + tmp1 = 639; /* NUM_SAMPLES_640 - 1 */ + move32(); + move32(); + BREAK; case NUM_SAMPLES_320: tmp = Q31_BY_NUM_SAMPLES_320; tmp1 = 319; /* NUM_SAMPLES_320 - 1 */ -- GitLab