61 lines
3.3 KiB
C
61 lines
3.3 KiB
C
#ifndef _AUDIO_DRC_PRO_H_
|
||
#define _AUDIO_DRC_PRO_H_
|
||
|
||
#include "typedef.h"
|
||
#include "media/sw_drc.h"
|
||
#include "media/audio_stream.h"
|
||
#include "system/init.h"
|
||
#include "audio_drc.h"
|
||
|
||
struct audio_drc_pro_filter_info {
|
||
CrossOverParam_TOOL_SET *crossover;
|
||
wdrc_pro_struct_TOOL_SET *wdrc_pro;
|
||
};
|
||
|
||
typedef int (*audio_drc_pro_filter_cb)(void *drc, struct audio_drc_pro_filter_info *info);
|
||
|
||
struct audio_drc_pro_param {
|
||
audio_drc_pro_filter_cb cb; //系数更新的回调函数,用户赋值
|
||
u32 sr; //数据采样率
|
||
u8 drc_pro_name; //在线调试标识
|
||
u8 out_32bit; //是否支持32bit 的输入数据处理 1:使能 0:不使能
|
||
u8 nband; //多带之后,再使能一次 全带处理
|
||
u8 channels; //通道数 (channels|(L_wdrc))或(channels|(R_wdrc))
|
||
u8 start_point; //声道数据起始点
|
||
u8 spilt; //声道效果独立使能
|
||
CrossOverParam_TOOL_SET *crossover;
|
||
wdrc_pro_struct_TOOL_SET *wdrc_pro; //[0]low [1]mid [2]high [3]whole
|
||
};
|
||
|
||
struct audio_drc_pro {
|
||
CrossOverParam_TOOL_SET *crossover_inside; //内部使用参数,用于判断某些参数的更新需要重新开关模块
|
||
wdrc_pro_struct_TOOL_SET *wdrc_pro_inside;
|
||
CrossOverParam_TOOL_SET *crossover; //外部传入参数
|
||
wdrc_pro_struct_TOOL_SET *wdrc_pro;
|
||
u32 sr; //采样率
|
||
u8 channels; //通道数
|
||
u8 updata; //系数更标志
|
||
u8 run32bit; //是否使能32bit位宽数据处理1:使能 0:不使能
|
||
u8 need_restart; //是否需要重更新系数 1:是 0:否
|
||
u8 other_band; //分带drc后的全带drc使能
|
||
u8 start_point; //声道数据起始点
|
||
u8 spilt; //声道效果独立使能
|
||
audio_drc_pro_filter_cb cb; //系数更新回调
|
||
void *hdl; //软件drc句柄
|
||
void *output_priv; //输出回调私有指针
|
||
int (*output)(void *priv, void *data, u32 len);//输出回调函数
|
||
u32 drc_pro_name; //drc标识,用于在线调试
|
||
struct list_head hentry; //多个drc使用链表管理
|
||
struct audio_stream_entry entry; //音频流入口
|
||
};
|
||
|
||
void cur_drc_pro_crossover_set_update(u32 drc_pro_name, CrossOverParam_TOOL_SET *crossover_parm);
|
||
void cur_drc_pro_set_bypass(u32 drc_pro_name, u8 tar, u8 bypass);
|
||
void cur_drc_pro_set_update(u32 drc_pro_name, u8 type, wdrc_pro_struct_TOOL_SET *wdrc_pro_parm);
|
||
int drc_pro_get_filter_info(struct audio_drc_pro *drc_pro, struct audio_drc_pro_filter_info *info);
|
||
struct audio_drc_pro *audio_dec_drc_pro_open(struct audio_drc_pro_param *parm);
|
||
void audio_dec_drc_pro_close(struct audio_drc_pro *drc_pro);
|
||
int audio_drc_pro_run(struct audio_drc_pro *drc_pro, s16 *data, u32 len);
|
||
#endif
|
||
|