blob: d0c94335971990edf5c8717448b65026903c2cd9 [file] [log] [blame]
/*
* sound/soc/amlogic/auge/effects_hw_v2_coeff.h
*
* Copyright (C) 2018 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#ifndef __EFFECTS_HW_V2_COEFF_H__
#define __EFFECTS_HW_V2_COEFF_H__
#define EQ_BAND (20)
#define FILTER_PARAM_SIZE (5)
#define DC_CUT_FILTER_RAM_ADD (0)
#define DC_CUT_FILTER_SIZE (5)
#define EQ_FILTER_RAM_ADD (5)
#define EQ_FILTER_SIZE_CH (100)
#define EQ_FILTER_SIZE (200)
#define CROSSOVER_FILTER_RAM_ADD (205)
#define CROSSOVER_FILTER_SIZE (20)
#define CROSSOVER_FILTER_BAND (4)
#define FILTER_PARAM_BYTE (66) /*"0x%8.8x "*/
/* 20Hz, highpass filter */
static unsigned int DC_CUT_COEFF[DC_CUT_FILTER_SIZE] = {
0x007fc365, 0x03007935, 0x007fc365, 0x03007952, 0x007f86e7
};
static unsigned int EQ_COEFF[EQ_FILTER_SIZE] = {
/*Ch1 EQ 0~19*/
/*0~9 band*/
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
/*10~19 band*/
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
/*Ch2 EQ 0~19*/
/*0~9 band*/
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
/*10~19 band*/
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
0x800000, 0x0, 0x0, 0x0, 0x0,
};
/*fiter1 fc: 150Hz; fiter2 fc: 5KHz*/
static unsigned int CROSSOVER_COEFF[CROSSOVER_FILTER_SIZE] = {
/*low-pass filter1*/
0x00000319, 0x00000632, 0x00000319, 0x0304fa54, 0x007b1210,
/*high-pass filter1*/
0x007d85ef, 0x0304f422, 0x007d85ef, 0x0304fa54, 0x007b1210,
/*low-pass filter2*/
0x0008388a, 0x00107113, 0x0008388a, 0x0381c139, 0x001f20ee,
/*high-pass filter2*/
0x004757ed, 0x03715025, 0x004757ed, 0x0381c139, 0x001f20ee,
};
#define AED_SINGLE_BAND_DRC_SIZE (10)
#define AED_MULTIBAND_DRC_BANDS (3)
#define AED_MULTIBAND_DRC_SIZE (30)
#define MULTIBAND_DRC_PARAM_BYTE (120) /*"0x%8.8x "*/
/*RMS:5ms, ATTACK:2ms, RELEASE:20ms*/
static unsigned int multiband_drc_coeff[AED_MULTIBAND_DRC_SIZE] = {
0x34ebb, /* Low RMS coeff0 */
0x7cb145, /* Low RMS coeff1 */
0x5188, /* Low RELEASE coeff0 */
0x7fae78, /* Low RELEASE coeff1 */
0x3263a, /* Low ATTACK coeff0 */
0x7cd9c6, /* Low ATTACK coeff1 */
0x0, /* Low THD0 coeff */
0x40000, /* Low K0 coeff */
0x40000, /* Low GAIN */
0x0, /* Low OFFSET coeff*/
0x34ebb, /* Mid RMS coeff0 */
0x7cb145, /* Mid RMS coeff1 */
0x5188, /* Mid RELEASE coeff0 */
0x7fae78, /* Mid RELEASE coeff1 */
0x3263a, /* Mid ATTACK coeff0 */
0x7cd9c6, /* Mid ATTACK coeff1 */
0x0, /* Mid THD0 coeff */
0x40000, /* Mid K0 coeff */
0x0, /* Mid OFFSET coeff*/
0x40000, /* Mid GAIN */
0x34ebb, /* High RMS coeff0 */
0x7cb145, /* High RMS coeff1 */
0x5188, /* High RELEASE coeff0 */
0x7fae78, /* High RELEASE coeff1 */
0x3263a, /* High ATTACK coeff0 */
0x7cd9c6, /* High ATTACK coeff1 */
0x0, /* High THD0 coeff */
0x40000, /* High K0 coeff */
0x0, /* High OFFSET coeff*/
0x40000, /* High GAIN */
};
#define AED_FULLBAND_DRC_SIZE (17)
#define AED_FULLBAND_DRC_BYTES (70)
#define AED_FULLBAND_DRC_OFFSET (6)
#define AED_FULLBAND_DRC_GROUP_SIZE (3)
/*K0 = 0dB; THD0 = 0; K1 = 3.0; THD1 = -70dB*/
/*RMS:5ms, ATTACK:2ms, RELEASE:20ms*/
/*delay: 144 sample max:255*/
static int fullband_drc_coeff[AED_FULLBAND_DRC_SIZE] = {
0x5188, /* RELEASE_COEF00 */
0x7fae78, /* RELEASE_COEF01 */
0x3263a, /* ATTACK_COEF00 */
0x7cd9c6, /* ATTACK_COEF01 */
0x0, /* THD0 */
0x0, /* K0 */
0x5188, /* RELEASE_COEF10 */
0x7fae78, /* RELEASE_COEF11 */
0x3263a, /* ATTACK_COEF10 */
0x7cd9c6, /* ATTACK_COEF11 */
0xdd000000, /* THD1 */
0xc0000, /* K2 */
0x34ebb, /* RMS coeff0 */
0x7cb145, /* RMS coeff1 */
0x90, /* Delay time*/
0xdd000000, /* THD_OUT0 */
0x40000, /* K1 */
};
#endif