Commit f95a1865 authored by Jiaquan Huo's avatar Jiaquan Huo
Browse files

Fix stack corruption in a2rc for LFE PLC

parent cc3b0977
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -563,6 +563,10 @@ enum

#define INT_FS_12k8                         12800                                                                                                            /* internal sampling frequency                */
#define M                                   16                                                                                                               /* order of the LP filter @ 12.8kHz           */
#ifdef NONE_BE_FIX_816_LFE_PLC_FLOAT
#define MAX_LP_FILTER_ORDER     (20)                                                                             /* Max order of an LP filter */
#endif

#define L_FRAME                             256                                                                                                              /* frame size at 12.8kHz                      */
#define NB_SUBFR                            4                                                                                                                /* number of subframes per frame              */
#define L_SUBFR                             ( L_FRAME / NB_SUBFR )                                                                                           /* subframe size                              */
+4 −0
Original line number Diff line number Diff line
@@ -969,7 +969,11 @@ uint16_t a2rc(
    const int16_t lpcorder /* i  : LPC order                   */
)
{
#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT
    float f[M];
#else
    float f[MAX_LP_FILTER_ORDER];
#endif
    int16_t m, j, n;
    float km, denom, x;

+4 −0
Original line number Diff line number Diff line
@@ -46,7 +46,11 @@
 *------------------------------------------------------------------------------------------*/

#define LFE_PLC_DSF        ( 48000 / LFE_PLC_FS )
#ifndef NONE_BE_FIX_816_LFE_PLC_FLOAT
#define LFE_PLC_LPCORD     ( 20 )
#else
#define LFE_PLC_LPCORD     ( MAX_LP_FILTER_ORDER )
#endif
#define POW_THR            ( 1.0e-8f )
#define LFE_PLC_RECLEN_48K ( ( IVAS_LFE_NUM_COEFFS_IN_SUBGRP + 1 ) * L_FRAME48k / IVAS_LFE_NUM_COEFFS_IN_SUBGRP + LFE_PLC_FDEL )
#define LFE_PLC_RECLEN     ( ( LFE_PLC_RECLEN_48K / LFE_PLC_DSF ) )