dsp: Add frame size control parameter for AAC encoder
BT sink devices have a limitation on the packet sizes they can receive and handle from BT sources. AAC encoder can produce output frames which can vary in size based on content being encoded. If frame size exceeds MTU size of BT sink device, it will lead to incorrect decoding of frames in BT sink. Add a frame configuration parameter (MTU/Peak bitrate) for AAC encoder to solve this problem. Change-Id: Ia7795049e982400b0b3657b0b3a8990fc6920e38 Signed-off-by: Aniket Kumar Lata <alata@codeaurora.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
@@ -3932,6 +3932,12 @@ struct aptx_channel_mode_param_t {
|
||||
*/
|
||||
#define AFE_SB_DATA_FORMAT_GENERIC_COMPRESSED 0x3
|
||||
|
||||
/*
|
||||
* Parameter to send frame control size
|
||||
* to DSP for AAC encoder in AFE.
|
||||
*/
|
||||
#define AFE_PARAM_ID_AAC_FRM_SIZE_CONTROL 0x000132EA
|
||||
|
||||
/*
|
||||
* ID for AFE port module. This will be used to define port properties.
|
||||
* This module supports following parameter IDs:
|
||||
@@ -4102,6 +4108,23 @@ struct asm_aac_enc_cfg_v2_t {
|
||||
uint32_t sample_rate;
|
||||
} __packed;
|
||||
|
||||
/* Structure to control frame size of AAC encoded frames. */
|
||||
struct asm_aac_frame_size_control_t {
|
||||
/* Type of frame size control: MTU_SIZE / PEAK_BIT_RATE*/
|
||||
uint32_t ctl_type;
|
||||
/*
|
||||
* Control value
|
||||
* MTU_SIZE: MTU size in bytes
|
||||
* PEAK_BIT_RATE: Peak bitrate in bits per second.
|
||||
*/
|
||||
uint32_t ctl_value;
|
||||
} __packed;
|
||||
|
||||
struct asm_aac_enc_cfg_t {
|
||||
struct asm_aac_enc_cfg_v2_t aac_cfg;
|
||||
struct asm_aac_frame_size_control_t frame_ctl;
|
||||
} __packed;
|
||||
|
||||
/* FMT ID for apt-X Classic */
|
||||
#define ASM_MEDIA_FMT_APTX 0x000131ff
|
||||
|
||||
@@ -4413,7 +4436,7 @@ struct asm_aac_dec_cfg_v2_t {
|
||||
|
||||
union afe_enc_config_data {
|
||||
struct asm_sbc_enc_cfg_t sbc_config;
|
||||
struct asm_aac_enc_cfg_v2_t aac_config;
|
||||
struct asm_aac_enc_cfg_t aac_config;
|
||||
struct asm_custom_enc_cfg_t custom_config;
|
||||
struct asm_celt_enc_cfg_t celt_config;
|
||||
struct asm_aptx_enc_cfg_t aptx_config;
|
||||
@@ -4642,6 +4665,7 @@ union afe_port_config {
|
||||
struct afe_param_id_tdm_cfg tdm;
|
||||
struct afe_param_id_usb_audio_cfg usb_audio;
|
||||
struct afe_param_id_aptx_sync_mode sync_mode_param;
|
||||
struct asm_aac_frame_size_control_t frame_ctl_param;
|
||||
struct afe_enc_fmt_id_param_t enc_fmt;
|
||||
struct afe_port_media_type_t media_type;
|
||||
struct afe_enc_cfg_blk_param_t enc_blk_param;
|
||||
|
Reference in New Issue
Block a user