Formatting changes
am: b3226ce6f8
Change-Id: I6c76e505a44f1dba20bc8ae06e4cbece1c4efae2
This commit is contained in:
commit
dfdabaf9eb
152 changed files with 20984 additions and 21999 deletions
|
|
@ -134,7 +134,8 @@ VOID(*ixheaacd_harm_idx_zerotwolp)
|
||||||
|
|
||||||
VOID(*ixheaacd_tns_ar_filter_fixed)
|
VOID(*ixheaacd_tns_ar_filter_fixed)
|
||||||
(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD32 *lpc, WORD32 order,
|
(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD32 *lpc, WORD32 order,
|
||||||
WORD32 shift_value, WORD scale_spec) = &ixheaacd_tns_ar_filter_fixed_non_neon_armv7;
|
WORD32 shift_value,
|
||||||
|
WORD scale_spec) = &ixheaacd_tns_ar_filter_fixed_non_neon_armv7;
|
||||||
|
|
||||||
VOID(*ixheaacd_tns_ar_filter)
|
VOID(*ixheaacd_tns_ar_filter)
|
||||||
(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD16 *lpc, WORD32 order,
|
(WORD32 *spectrum, WORD32 size, WORD32 inc, WORD16 *lpc, WORD32 order,
|
||||||
|
|
|
||||||
|
|
@ -230,20 +230,20 @@ VOID(*ixheaacd_aac_ld_dec_rearrange)
|
||||||
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
||||||
UWORD8 *re_arr_tab) = &ia_aac_ld_dec_rearrange_armv7;
|
UWORD8 *re_arr_tab) = &ia_aac_ld_dec_rearrange_armv7;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld)
|
VOID(*ixheaacd_fft32x32_ld)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_armv7;
|
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_armv7;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld2)
|
VOID(*ixheaacd_fft32x32_ld2)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld2_armv7;
|
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld2_armv7;
|
||||||
|
|
||||||
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_arm;
|
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_arm;
|
||||||
|
|
||||||
VOID (*ixheaacd_inv_dit_fft_8pt)
|
VOID(*ixheaacd_inv_dit_fft_8pt)
|
||||||
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_armv7;
|
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_armv7;
|
||||||
|
|
||||||
VOID (*ixheaacd_scale_factor_process)
|
VOID(*ixheaacd_scale_factor_process)
|
||||||
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
||||||
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
||||||
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv7;
|
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv7;
|
||||||
|
|
|
||||||
|
|
@ -249,8 +249,8 @@ VOID ixheaacd_inv_modulation_lp(WORD32 *qmf_real, WORD16 *filter_states,
|
||||||
filter_states[3 * M] = 0;
|
filter_states[3 * M] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_inv_emodulation(
|
VOID ixheaacd_inv_emodulation(WORD32 *qmf_real,
|
||||||
WORD32 *qmf_real, ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
||||||
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
||||||
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, (WORD16 *)qmf_dec_tables_ptr->w1024,
|
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, (WORD16 *)qmf_dec_tables_ptr->w1024,
|
||||||
(WORD32 *)qmf_dec_tables_ptr->dig_rev_table2_128);
|
(WORD32 *)qmf_dec_tables_ptr->dig_rev_table2_128);
|
||||||
|
|
@ -352,4 +352,3 @@ VOID ixheaacd_esbr_cos_sin_mod(WORD32 *subband,
|
||||||
p_sin = qmf_bank->esbr_alt_sin_twiddle;
|
p_sin = qmf_bank->esbr_alt_sin_twiddle;
|
||||||
ixheaacd_esbr_cos_sin_mod_loop2(subband, p_sin, M);
|
ixheaacd_esbr_cos_sin_mod_loop2(subband, p_sin, M);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,28 +31,28 @@ ixheaacd_tns_ar_filter_fixed_armv7:
|
||||||
STMFD r13! , {r4 - r12, r14}
|
STMFD r13! , {r4 - r12, r14}
|
||||||
vpush {d8-d15}
|
vpush {d8-d15}
|
||||||
SUB sp, sp, #128 @ state[MaximumOrder] + one more
|
SUB sp, sp, #128 @ state[MaximumOrder] + one more
|
||||||
LDR r4, [sp,#232] @order
|
LDR r4, [sp, #232] @order
|
||||||
LDR r6, [sp,#236] @shift_value
|
LDR r6, [sp, #236] @shift_value
|
||||||
STR r1, [sp]
|
STR r1, [sp]
|
||||||
ADD r12, sp, #4 @ r12 = state
|
ADD r12, sp, #4 @ r12 = state
|
||||||
ANDS r5, r4, #3
|
ANDS r5, r4, #3
|
||||||
BEQ FILTER_LOOP
|
BEQ FILTER_LOOP
|
||||||
MOV r8, #0
|
MOV r8, #0
|
||||||
ADD r14, r3, r4,LSL #2
|
ADD r14, r3, r4, LSL #2
|
||||||
RSBS r7, r5, #3
|
RSBS r7, r5, #3
|
||||||
BEQ ORDER_LOOPEND
|
BEQ ORDER_LOOPEND
|
||||||
ORDER_LOOP:
|
ORDER_LOOP:
|
||||||
STR r8, [r14,#4]! @lpc[i] = 0
|
STR r8, [r14, #4]! @lpc[i] = 0
|
||||||
SUBS r7, r7, #1
|
SUBS r7, r7, #1
|
||||||
BGT ORDER_LOOP
|
BGT ORDER_LOOP
|
||||||
ORDER_LOOPEND:
|
ORDER_LOOPEND:
|
||||||
STR r8, [r14,#4] @lpc[i] = 0
|
STR r8, [r14, #4] @lpc[i] = 0
|
||||||
BIC r4, r4, #3
|
BIC r4, r4, #3
|
||||||
ADD r4, r4, #4 @order = ( (order & 0xfffffffc) +4 )
|
ADD r4, r4, #4 @order = ( (order & 0xfffffffc) +4 )
|
||||||
|
|
||||||
|
|
||||||
FILTER_LOOP:
|
FILTER_LOOP:
|
||||||
LDR r1, [sp,#240] @scaleSpec
|
LDR r1, [sp, #240] @scaleSpec
|
||||||
@filtering loop here
|
@filtering loop here
|
||||||
CMP r2, #1 @ inc =1 or -1
|
CMP r2, #1 @ inc =1 or -1
|
||||||
MOV r7, r4 @loop_count
|
MOV r7, r4 @loop_count
|
||||||
|
|
@ -62,18 +62,18 @@ FILTER_LOOP:
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
MOV r8, r8, lsl r1
|
MOV r8, r8, lsl r1
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
MOV r8 , r8 ,lsl r6
|
MOV r8 , r8 , lsl r6
|
||||||
STR r8 , [r12] @state[0] = sp[top]
|
STR r8 , [r12] @state[0] = sp[top]
|
||||||
STR r9, [r0], #4
|
STR r9, [r0], #4
|
||||||
BEQ FILTER_LOOP2
|
BEQ FILTER_LOOP2
|
||||||
FILTER_LOOP1: @siva 16 times loop run
|
FILTER_LOOP1: @siva 16 times loop run
|
||||||
LDR r8 , [r0] @r8 =*spectrum
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
SUB r5 , r4 , r7 @
|
SUB r5 , r4 , r7 @
|
||||||
MOV r5 , r5 ,lsl #2
|
MOV r5 , r5 , lsl #2
|
||||||
MOV r11 , #0 @accu = 0
|
MOV r11 , #0 @accu = 0
|
||||||
ADD r14, r12, r5 @state[j]
|
ADD r14, r12, r5 @state[j]
|
||||||
INNER_LOOP1:
|
INNER_LOOP1:
|
||||||
LDR r10 , [r14,#-4] @state[j-1]
|
LDR r10 , [r14, #-4] @state[j-1]
|
||||||
LDR r9 , [r3 , r5] @lpc[j]
|
LDR r9 , [r3 , r5] @lpc[j]
|
||||||
SUBS r5 , r5 , #4
|
SUBS r5 , r5 , #4
|
||||||
|
|
||||||
|
|
@ -83,11 +83,11 @@ INNER_LOOP1:
|
||||||
BGT INNER_LOOP1
|
BGT INNER_LOOP1
|
||||||
|
|
||||||
MOV r8, r8, lsl r1
|
MOV r8, r8, lsl r1
|
||||||
SUB r8 , r8 , r11,lsl #1
|
SUB r8 , r8 , r11, lsl #1
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
STR r9 , [r0], #4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
SUBS r7 , r7 , #1 @i--
|
SUBS r7 , r7 , #1 @i--
|
||||||
MOV r8 , r8 ,lsl r6
|
MOV r8 , r8 , lsl r6
|
||||||
STR r8 , [r12] @state[0]
|
STR r8 , [r12] @state[0]
|
||||||
BGT FILTER_LOOP1
|
BGT FILTER_LOOP1
|
||||||
|
|
||||||
|
|
@ -104,40 +104,40 @@ FILTER_LOOP2:
|
||||||
SUBS R7 , R1 , r4 @size-order
|
SUBS R7 , R1 , r4 @size-order
|
||||||
BEQ EXIT
|
BEQ EXIT
|
||||||
|
|
||||||
LDR R1, [sp,#240] @scaleSpec
|
LDR R1, [sp, #240] @scaleSpec
|
||||||
|
|
||||||
MOV R5 , R4 ,LSL #2 @count for inner loop = order
|
MOV R5 , R4 , LSL #2 @count for inner loop = order
|
||||||
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
||||||
MOV R14,#0
|
MOV R14, #0
|
||||||
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
||||||
|
|
||||||
CMP R4,#4
|
CMP R4, #4
|
||||||
VLD1.32 {D18, D19}, [R8]!
|
VLD1.32 {D18, D19}, [R8]!
|
||||||
BEQ ORDER4
|
BEQ ORDER4
|
||||||
VLD1.32 {D22, D23}, [R12]!
|
VLD1.32 {D22, D23}, [R12]!
|
||||||
|
|
||||||
CMP R4,#8
|
CMP R4, #8
|
||||||
VLD1.32 {D20, D21}, [R8]!
|
VLD1.32 {D20, D21}, [R8]!
|
||||||
BEQ ORDER8
|
BEQ ORDER8
|
||||||
CMP R4,#12
|
CMP R4, #12
|
||||||
VLD1.32 {D24, D25}, [R12]!
|
VLD1.32 {D24, D25}, [R12]!
|
||||||
BEQ ORDER12
|
BEQ ORDER12
|
||||||
|
|
||||||
VLD1.32 {D26, D27},[R8]!
|
VLD1.32 {D26, D27}, [R8]!
|
||||||
CMP R4,#16
|
CMP R4, #16
|
||||||
VLD1.32 {D28, D29},[R12]!
|
VLD1.32 {D28, D29}, [R12]!
|
||||||
BEQ ORDER16 @order16 added
|
BEQ ORDER16 @order16 added
|
||||||
|
|
||||||
VLD1.32 {D4, D5},[R8]!
|
VLD1.32 {D4, D5}, [R8]!
|
||||||
CMP R4,#20
|
CMP R4, #20
|
||||||
VLD1.32 {D8, D9},[R12]!
|
VLD1.32 {D8, D9}, [R12]!
|
||||||
BEQ ORDER20 @order20 added
|
BEQ ORDER20 @order20 added
|
||||||
|
|
||||||
ORDER4:
|
ORDER4:
|
||||||
LDR r8 , [r0] @r8 = y = *spectrum
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
OUTER_LOOP2_4:
|
OUTER_LOOP2_4:
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
VMLAL.S32 Q1, D10, D12
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
||||||
|
|
@ -146,22 +146,22 @@ OUTER_LOOP2_4:
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
|
|
||||||
VSHR.S64 D6,#32 @acc1=acc>>32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
VSHR.S64 D6, #32 @acc1=acc>>32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
|
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
BGT OUTER_LOOP2_4
|
BGT OUTER_LOOP2_4
|
||||||
|
|
@ -173,7 +173,7 @@ ORDER8:
|
||||||
|
|
||||||
OUTER_LOOP2_8:
|
OUTER_LOOP2_8:
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -183,24 +183,24 @@ OUTER_LOOP2_8:
|
||||||
VMLAL.S32 Q1, D23, D19
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q11,Q6,Q11,#3
|
VEXT.32 Q11, Q6, Q11, #3
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VSHR.S64 D6,#32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
VSHR.S64 D6, #32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
STR r9 , [r0],#4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -216,7 +216,7 @@ ORDER12:
|
||||||
OUTER_LOOP2_12:
|
OUTER_LOOP2_12:
|
||||||
|
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
VMLAL.S32 Q1, D10, D12
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
@ -227,27 +227,27 @@ OUTER_LOOP2_12:
|
||||||
VMLAL.S32 Q1, D25, D21
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q12,Q11,Q12,#3
|
VEXT.32 Q12, Q11, Q12, #3
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VEXT.32 Q11,Q6,Q11,#3
|
VEXT.32 Q11, Q6, Q11, #3
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
BGT OUTER_LOOP2_12
|
BGT OUTER_LOOP2_12
|
||||||
|
|
@ -260,7 +260,7 @@ ORDER16:
|
||||||
OUTER_LOOP2_16:
|
OUTER_LOOP2_16:
|
||||||
|
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
VMLAL.S32 Q1, D10, D12
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
@ -272,29 +272,29 @@ OUTER_LOOP2_16:
|
||||||
VMLAL.S32 Q1, D28, D26 @
|
VMLAL.S32 Q1, D28, D26 @
|
||||||
VMLAL.S32 Q1, D29, D27 @ @order16
|
VMLAL.S32 Q1, D29, D27 @ @order16
|
||||||
|
|
||||||
VEXT.32 Q14,Q12,Q14,#3
|
VEXT.32 Q14, Q12, Q14, #3
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q12,Q11,Q12,#3
|
VEXT.32 Q12, Q11, Q12, #3
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VEXT.32 Q11,Q6,Q11,#3
|
VEXT.32 Q11, Q6, Q11, #3
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
BGT OUTER_LOOP2_16
|
BGT OUTER_LOOP2_16
|
||||||
|
|
@ -306,7 +306,7 @@ ORDER20:
|
||||||
OUTER_LOOP2_20:
|
OUTER_LOOP2_20:
|
||||||
|
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
VMLAL.S32 Q1, D10, D12
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
@ -321,30 +321,30 @@ OUTER_LOOP2_20:
|
||||||
VMLAL.S32 Q1, D9, D5 @order20
|
VMLAL.S32 Q1, D9, D5 @order20
|
||||||
|
|
||||||
|
|
||||||
VEXT.32 Q4,Q14,Q4,#3 @ @for order20
|
VEXT.32 Q4, Q14, Q4, #3 @ @for order20
|
||||||
VEXT.32 Q14,Q12,Q14,#3 @ @for order16
|
VEXT.32 Q14, Q12, Q14, #3 @ @for order16
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q12,Q11,Q12,#3 @order12
|
VEXT.32 Q12, Q11, Q12, #3 @order12
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VEXT.32 Q11,Q6,Q11,#3 @order8
|
VEXT.32 Q11, Q6, Q11, #3 @order8
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#4 @*spectrum = y@
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
BGT OUTER_LOOP2_20
|
BGT OUTER_LOOP2_20
|
||||||
|
|
@ -358,18 +358,18 @@ NEG_INC:
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
MOV r8, r8, lsl r1
|
MOV r8, r8, lsl r1
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
MOV r8 , r8 ,lsl r6
|
MOV r8 , r8 , lsl r6
|
||||||
STR r8 , [r12] @state[0] = sp[top]
|
STR r8 , [r12] @state[0] = sp[top]
|
||||||
STR r9, [r0], #-4
|
STR r9, [r0], #-4
|
||||||
BEQ NEGFILTER_LOOP2
|
BEQ NEGFILTER_LOOP2
|
||||||
NEGFILTER_LOOP1:
|
NEGFILTER_LOOP1:
|
||||||
LDR r8 , [r0] @r8 =*spectrum
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
SUB r5 , r4 , r7 @
|
SUB r5 , r4 , r7 @
|
||||||
MOV r5 , r5 ,lsl #2
|
MOV r5 , r5 , lsl #2
|
||||||
MOV r11 , #0 @accu = 0
|
MOV r11 , #0 @accu = 0
|
||||||
ADD r14, r12, r5 @state[j]
|
ADD r14, r12, r5 @state[j]
|
||||||
NEGINNER_LOOP1:
|
NEGINNER_LOOP1:
|
||||||
LDR r10 , [r14,#-4] @state[j-1]
|
LDR r10 , [r14, #-4] @state[j-1]
|
||||||
LDR r9 , [r3 , r5] @lpc[j]
|
LDR r9 , [r3 , r5] @lpc[j]
|
||||||
SUBS r5 , r5 , #4
|
SUBS r5 , r5 , #4
|
||||||
|
|
||||||
|
|
@ -379,11 +379,11 @@ NEGINNER_LOOP1:
|
||||||
BGT NEGINNER_LOOP1
|
BGT NEGINNER_LOOP1
|
||||||
|
|
||||||
MOV r8, r8, lsl r1
|
MOV r8, r8, lsl r1
|
||||||
SUB r8 , r8 , r11,lsl #1
|
SUB r8 , r8 , r11, lsl #1
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
STR r9 , [r0], #-4 @*spectrum = y@
|
STR r9 , [r0], #-4 @*spectrum = y@
|
||||||
SUBS r7 , r7 , #1 @i--
|
SUBS r7 , r7 , #1 @i--
|
||||||
MOV r8 , r8 ,lsl r6
|
MOV r8 , r8 , lsl r6
|
||||||
STR r8 , [r12] @state[0]
|
STR r8 , [r12] @state[0]
|
||||||
BGT NEGFILTER_LOOP1
|
BGT NEGFILTER_LOOP1
|
||||||
|
|
||||||
|
|
@ -394,24 +394,24 @@ NEGFILTER_LOOP2:
|
||||||
|
|
||||||
ADD R8, R3, #4
|
ADD R8, R3, #4
|
||||||
|
|
||||||
MOV R14,#0
|
MOV R14, #0
|
||||||
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
||||||
MOV R5 , R4 ,LSL #2 @count for inner loop = order
|
MOV R5 , R4 , LSL #2 @count for inner loop = order
|
||||||
|
|
||||||
LDR R1, [sp,#240] @scaleSpec
|
LDR R1, [sp, #240] @scaleSpec
|
||||||
|
|
||||||
CMP R4,#4
|
CMP R4, #4
|
||||||
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
||||||
BEQ NEGORDER4
|
BEQ NEGORDER4
|
||||||
|
|
||||||
VLD1.32 {D18, D19}, [R8]!
|
VLD1.32 {D18, D19}, [R8]!
|
||||||
CMP R4,#8
|
CMP R4, #8
|
||||||
|
|
||||||
VLD1.32 {D22, D23}, [R12]!
|
VLD1.32 {D22, D23}, [R12]!
|
||||||
BEQ NEGORDER8
|
BEQ NEGORDER8
|
||||||
|
|
||||||
VLD1.32 {D20, D21}, [R8]!
|
VLD1.32 {D20, D21}, [R8]!
|
||||||
CMP R4,#12
|
CMP R4, #12
|
||||||
|
|
||||||
VLD1.32 {D24, D25}, [R12]!
|
VLD1.32 {D24, D25}, [R12]!
|
||||||
BEQ NEGORDER12
|
BEQ NEGORDER12
|
||||||
|
|
@ -425,7 +425,7 @@ NEGORDER4:
|
||||||
|
|
||||||
NEGOUTER_LOOP2_4:
|
NEGOUTER_LOOP2_4:
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
VMLAL.S32 Q1, D10, D12
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
@ -433,24 +433,24 @@ NEGOUTER_LOOP2_4:
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6
|
MOV r2 , r8 , lsl r6
|
||||||
|
|
||||||
VMOV.32 D15[1], R2
|
VMOV.32 D15[1], R2
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#-4 @*spectrum = y@
|
STR r9 , [r0], #-4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
BGT NEGOUTER_LOOP2_4
|
BGT NEGOUTER_LOOP2_4
|
||||||
|
|
@ -462,7 +462,7 @@ NEGORDER8:
|
||||||
|
|
||||||
NEGOUTER_LOOP2_8:
|
NEGOUTER_LOOP2_8:
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -472,26 +472,26 @@ NEGOUTER_LOOP2_8:
|
||||||
VMLAL.S32 Q1, D23, D19
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q11,Q6,Q11,#3
|
VEXT.32 Q11, Q6, Q11, #3
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
|
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#-4 @*spectrum = y@
|
STR r9 , [r0], #-4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -507,7 +507,7 @@ NEGORDER12:
|
||||||
|
|
||||||
NEGOUTER_LOOP2_12:
|
NEGOUTER_LOOP2_12:
|
||||||
|
|
||||||
VDUP.32 Q1,R14 @Q1= accu = 0
|
VDUP.32 Q1, R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -519,28 +519,28 @@ NEGOUTER_LOOP2_12:
|
||||||
VMLAL.S32 Q1, D25, D21
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
|
||||||
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
VEXT.32 Q12,Q11,Q12,#3
|
VEXT.32 Q12, Q11, Q12, #3
|
||||||
SUBS r7 , r7 , #1
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
VADD.I64 D6,D2,D3
|
VADD.I64 D6, D2, D3
|
||||||
VEXT.32 Q11,Q6,Q11,#3
|
VEXT.32 Q11, Q6, Q11, #3
|
||||||
VSHR.S64 D6,#32
|
VSHR.S64 D6, #32
|
||||||
|
|
||||||
|
|
||||||
@VMOV R11,D6[0]
|
@VMOV R11,D6[0]
|
||||||
VST1.32 D6[0],[SP]
|
VST1.32 D6[0], [SP]
|
||||||
LDR R11,[SP]
|
LDR R11, [SP]
|
||||||
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
SUB r8 , r8 , r11, lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
MOV r2 , r8 , lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
VMOV.32 D15[1], R2 @state[0]
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
MOV r9, r8, asr r1
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
STR r9 , [r0],#-4 @*spectrum = y@
|
STR r9 , [r0], #-4 @*spectrum = y@
|
||||||
VEXT.32 Q6,Q7,Q6,#3
|
VEXT.32 Q6, Q7, Q6, #3
|
||||||
LDRGT r8 , [r0] @r8 = y = *spectrum
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -548,6 +548,6 @@ NEGOUTER_LOOP2_12:
|
||||||
|
|
||||||
|
|
||||||
EXIT:
|
EXIT:
|
||||||
ADD sp, sp ,#128
|
ADD sp, sp , #128
|
||||||
vpop {d8-d15}
|
vpop {d8-d15}
|
||||||
LDMFD r13!, {r4 - r12, r15}
|
LDMFD r13!, {r4 - r12, r15}
|
||||||
|
|
|
||||||
|
|
@ -229,20 +229,20 @@ VOID(*ixheaacd_aac_ld_dec_rearrange)
|
||||||
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
||||||
UWORD8 *re_arr_tab) = &ixheaacd_rearrange_dec;
|
UWORD8 *re_arr_tab) = &ixheaacd_rearrange_dec;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld)
|
VOID(*ixheaacd_fft32x32_ld)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_armv8;
|
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_imdct_using_fft_armv8;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld2)
|
VOID(*ixheaacd_fft32x32_ld2)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld2_armv8;
|
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld2_armv8;
|
||||||
|
|
||||||
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_arm;
|
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_arm;
|
||||||
|
|
||||||
VOID (*ixheaacd_inv_dit_fft_8pt)
|
VOID(*ixheaacd_inv_dit_fft_8pt)
|
||||||
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_armv8;
|
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_armv8;
|
||||||
|
|
||||||
VOID (*ixheaacd_scale_factor_process)
|
VOID(*ixheaacd_scale_factor_process)
|
||||||
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
||||||
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
||||||
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv8;
|
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_armv8;
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -490,8 +490,8 @@ VOID ixheaacd_inv_modulation_lp(WORD32 *qmf_real, WORD16 *filter_states,
|
||||||
filter_states[3 * M] = 0;
|
filter_states[3 * M] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_inv_emodulation(
|
VOID ixheaacd_inv_emodulation(WORD32 *qmf_real,
|
||||||
WORD32 *qmf_real, ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
||||||
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
||||||
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, (WORD16 *)qmf_dec_tables_ptr->w1024,
|
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, (WORD16 *)qmf_dec_tables_ptr->w1024,
|
||||||
(WORD32 *)qmf_dec_tables_ptr->dig_rev_table2_128);
|
(WORD32 *)qmf_dec_tables_ptr->dig_rev_table2_128);
|
||||||
|
|
@ -1103,7 +1103,6 @@ VOID ixheaacd_esbr_cos_sin_mod(WORD32 *subband,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID ixheaacd_esbr_fwd_modulation(
|
VOID ixheaacd_esbr_fwd_modulation(
|
||||||
const WORD32 *time_sample_buf, WORD32 *real_subband, WORD32 *imag_subband,
|
const WORD32 *time_sample_buf, WORD32 *real_subband, WORD32 *imag_subband,
|
||||||
ia_sbr_qmf_filter_bank_struct *qmf_bank,
|
ia_sbr_qmf_filter_bank_struct *qmf_bank,
|
||||||
|
|
@ -1344,6 +1343,3 @@ VOID ixheaacd_radix4bfly(const WORD16 *w, WORD32 *x, WORD32 index1,
|
||||||
w_ptr = w_ptr - fft_jmp;
|
w_ptr = w_ptr - fft_jmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
#define IA_API_CMD_GET_OUTPUT_BYTES 0x000D
|
#define IA_API_CMD_GET_OUTPUT_BYTES 0x000D
|
||||||
#define IA_API_CMD_INPUT_OVER 0x000E
|
#define IA_API_CMD_INPUT_OVER 0x000E
|
||||||
|
|
||||||
|
|
||||||
#define IA_API_CMD_RESET 0x0010
|
#define IA_API_CMD_RESET 0x0010
|
||||||
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_SIZE 0x0011
|
#define IA_API_CMD_GET_MEM_INFO_SIZE 0x0011
|
||||||
|
|
@ -63,7 +62,6 @@
|
||||||
#define IA_API_CMD_SET_TABLE_PTR 0x001D
|
#define IA_API_CMD_SET_TABLE_PTR 0x001D
|
||||||
#define IA_API_CMD_GET_TABLE_PTR 0x001E
|
#define IA_API_CMD_GET_TABLE_PTR 0x001E
|
||||||
|
|
||||||
|
|
||||||
#define IA_API_CMD_INPUT_OVER_BS 0x0021
|
#define IA_API_CMD_INPUT_OVER_BS 0x0021
|
||||||
#define IA_API_CMD_INPUT_OVER_IC_BS 0x0022
|
#define IA_API_CMD_INPUT_OVER_IC_BS 0x0022
|
||||||
#define IA_API_CMD_INPUT_OVER_IG_BS 0x0023
|
#define IA_API_CMD_INPUT_OVER_IG_BS 0x0023
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
#include "impd_apicmd_standards.h"
|
#include "impd_apicmd_standards.h"
|
||||||
#include "impd_memory_standards.h"
|
#include "impd_memory_standards.h"
|
||||||
|
|
||||||
|
|
||||||
#include "impd_drc_bitbuffer.h"
|
#include "impd_drc_bitbuffer.h"
|
||||||
#include "impd_drc_extr_delta_coded_info.h"
|
#include "impd_drc_extr_delta_coded_info.h"
|
||||||
#include "impd_drc_common.h"
|
#include "impd_drc_common.h"
|
||||||
|
|
@ -52,15 +51,12 @@ WORD32 impd_init_process_audio_main_qmf(ia_drc_api_struct *p_obj_drc);
|
||||||
WORD32 impd_init_process_audio_main_stft(ia_drc_api_struct *p_obj_drc);
|
WORD32 impd_init_process_audio_main_stft(ia_drc_api_struct *p_obj_drc);
|
||||||
WORD32 impd_init_process_audio_main_td_qmf(ia_drc_api_struct *p_obj_drc);
|
WORD32 impd_init_process_audio_main_td_qmf(ia_drc_api_struct *p_obj_drc);
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc,
|
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc, WORD32 i_cmd,
|
||||||
WORD32 i_cmd, WORD32 i_idx, pVOID pv_value);
|
WORD32 i_idx, pVOID pv_value);
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc);
|
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc);
|
||||||
|
|
||||||
|
VOID impd_drc_set_default_config_params(ia_drc_config_struct *ptr_config);
|
||||||
|
|
||||||
VOID impd_drc_set_default_config_params(ia_drc_config_struct* ptr_config);
|
|
||||||
|
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_process_frame(ia_drc_api_struct *p_obj_drc);
|
IA_ERRORCODE impd_drc_process_frame(ia_drc_api_struct *p_obj_drc);
|
||||||
IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc);
|
IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc);
|
||||||
|
|
@ -69,17 +65,12 @@ IA_ERRORCODE impd_drc_set_struct_pointer(ia_drc_api_struct *p_obj_drc);
|
||||||
IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc);
|
IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc);
|
||||||
|
|
||||||
#define NUM_DRC_TABLES 4
|
#define NUM_DRC_TABLES 4
|
||||||
#define SCRATCH_MEM_SIZE 1024*256*64
|
#define SCRATCH_MEM_SIZE 1024 * 256 * 64
|
||||||
|
|
||||||
|
IA_ERRORCODE ia_drc_dec_api(pVOID p_ia_drc_dec_obj, WORD32 i_cmd, WORD32 i_idx,
|
||||||
|
pVOID pv_value) {
|
||||||
IA_ERRORCODE ia_drc_dec_api(pVOID p_ia_drc_dec_obj,
|
|
||||||
WORD32 i_cmd,
|
|
||||||
WORD32 i_idx,
|
|
||||||
pVOID pv_value)
|
|
||||||
{
|
|
||||||
ia_drc_api_struct *p_obj_drc = p_ia_drc_dec_obj;
|
ia_drc_api_struct *p_obj_drc = p_ia_drc_dec_obj;
|
||||||
IA_ERRORCODE error_code=IA_NO_ERROR;
|
IA_ERRORCODE error_code = IA_NO_ERROR;
|
||||||
LOOPIDX i;
|
LOOPIDX i;
|
||||||
|
|
||||||
pUWORD32 pui_value = pv_value;
|
pUWORD32 pui_value = pv_value;
|
||||||
|
|
@ -87,589 +78,477 @@ IA_ERRORCODE ia_drc_dec_api(pVOID p_ia_drc_dec_obj,
|
||||||
pWORD8 pb_value = pv_value;
|
pWORD8 pb_value = pv_value;
|
||||||
SIZE_T *ps_value = pv_value;
|
SIZE_T *ps_value = pv_value;
|
||||||
|
|
||||||
switch(i_cmd)
|
switch (i_cmd) {
|
||||||
{
|
|
||||||
case IA_API_CMD_GET_MEM_INFO_SIZE:
|
case IA_API_CMD_GET_MEM_INFO_SIZE:
|
||||||
case IA_API_CMD_GET_MEM_INFO_ALIGNMENT:
|
case IA_API_CMD_GET_MEM_INFO_ALIGNMENT:
|
||||||
case IA_API_CMD_GET_MEM_INFO_TYPE:
|
case IA_API_CMD_GET_MEM_INFO_TYPE:
|
||||||
case IA_API_CMD_GET_MEM_INFO_PLACEMENT:
|
case IA_API_CMD_GET_MEM_INFO_PLACEMENT:
|
||||||
case IA_API_CMD_GET_MEM_INFO_PRIORITY:
|
case IA_API_CMD_GET_MEM_INFO_PRIORITY:
|
||||||
case IA_API_CMD_SET_MEM_PTR:
|
case IA_API_CMD_SET_MEM_PTR:
|
||||||
case IA_API_CMD_SET_MEM_PLACEMENT:
|
case IA_API_CMD_SET_MEM_PLACEMENT: {
|
||||||
{
|
|
||||||
return impd_drc_mem_api(p_ia_drc_dec_obj, i_cmd, i_idx, pv_value);
|
return impd_drc_mem_api(p_ia_drc_dec_obj, i_cmd, i_idx, pv_value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switch(i_cmd)
|
switch (i_cmd) {
|
||||||
{
|
case IA_API_CMD_GET_LIB_ID_STRINGS: {
|
||||||
case IA_API_CMD_GET_LIB_ID_STRINGS:
|
switch (i_idx) {
|
||||||
{
|
case IA_CMD_TYPE_LIB_NAME: {
|
||||||
switch(i_idx)
|
|
||||||
{
|
|
||||||
case IA_CMD_TYPE_LIB_NAME:
|
|
||||||
{
|
|
||||||
WORD8 lib_name[] = LIBNAME;
|
WORD8 lib_name[] = LIBNAME;
|
||||||
for(i = 0; i < IA_API_STR_LEN && lib_name[i -1] != 0; i++)
|
for (i = 0; i < IA_API_STR_LEN && lib_name[i - 1] != 0; i++) {
|
||||||
{
|
|
||||||
pb_value[i] = lib_name[i];
|
pb_value[i] = lib_name[i];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_LIB_VERSION:
|
case IA_CMD_TYPE_LIB_VERSION: {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_CMD_TYPE_API_VERSION:
|
case IA_CMD_TYPE_API_VERSION: {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
default: { return -1; }
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_API_SIZE:
|
case IA_API_CMD_GET_API_SIZE: {
|
||||||
{
|
*pui_value = sizeof(ia_drc_api_struct) +
|
||||||
*pui_value = sizeof(ia_drc_api_struct)+(sizeof(ia_drc_state_struct)+8)+8080*1024;
|
(sizeof(ia_drc_state_struct) + 8) + 8080 * 1024;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INIT:
|
case IA_API_CMD_INIT: {
|
||||||
{
|
switch (i_idx) {
|
||||||
switch(i_idx)
|
case IA_CMD_TYPE_INIT_SET_BUFF_PTR: {
|
||||||
{
|
p_obj_drc->p_state->persistant_ptr =
|
||||||
case IA_CMD_TYPE_INIT_SET_BUFF_PTR:
|
p_obj_drc->pp_mem[IA_DRC_PERSIST_IDX];
|
||||||
{
|
|
||||||
p_obj_drc->p_state->persistant_ptr=p_obj_drc->pp_mem[IA_DRC_PERSIST_IDX];
|
|
||||||
impd_drc_set_struct_pointer(p_obj_drc);
|
impd_drc_set_struct_pointer(p_obj_drc);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS:
|
case IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS: {
|
||||||
{
|
|
||||||
impd_drc_set_default_config(p_obj_drc);
|
impd_drc_set_default_config(p_obj_drc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS:
|
case IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS: {
|
||||||
{
|
p_obj_drc->p_state =
|
||||||
p_obj_drc->p_state=(ia_drc_state_struct *)((SIZE_T)p_obj_drc+8000*1024);
|
(ia_drc_state_struct *)((SIZE_T)p_obj_drc + 8000 * 1024);
|
||||||
p_obj_drc->p_mem_info=(ia_mem_info_struct *)((SIZE_T)p_obj_drc+8002*1024);
|
p_obj_drc->p_mem_info =
|
||||||
p_obj_drc->pp_mem=(pVOID)((SIZE_T)p_obj_drc+8006*1024);
|
(ia_mem_info_struct *)((SIZE_T)p_obj_drc + 8002 * 1024);
|
||||||
|
p_obj_drc->pp_mem = (pVOID)((SIZE_T)p_obj_drc + 8006 * 1024);
|
||||||
impd_drc_fill_mem_tables(p_obj_drc);
|
impd_drc_fill_mem_tables(p_obj_drc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_PROCESS:
|
case IA_CMD_TYPE_INIT_PROCESS: {
|
||||||
{
|
IA_ERRORCODE Error = 0;
|
||||||
IA_ERRORCODE Error=0;
|
|
||||||
|
|
||||||
if(p_obj_drc->pp_mem[IA_DRC_PERSIST_IDX] == 0)
|
if (p_obj_drc->pp_mem[IA_DRC_PERSIST_IDX] == 0) {
|
||||||
{
|
return (-1);
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Error = impd_drc_init(p_obj_drc);
|
Error = impd_drc_init(p_obj_drc);
|
||||||
if(Error)
|
if (Error) return Error;
|
||||||
return Error;
|
|
||||||
p_obj_drc->p_state->ui_init_done = 1;
|
p_obj_drc->p_state->ui_init_done = 1;
|
||||||
return Error;
|
return Error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_DONE_QUERY:
|
case IA_CMD_TYPE_INIT_DONE_QUERY: {
|
||||||
{
|
if (p_obj_drc->p_state->ui_init_done == 1) {
|
||||||
|
|
||||||
if(p_obj_drc->p_state->ui_init_done == 1)
|
|
||||||
{
|
|
||||||
*pui_value = 1;
|
*pui_value = 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
*pui_value = 0;
|
*pui_value = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_CMD_TYPE_INIT_CPY_BSF_BUFF_OVER_QUERY:
|
case IA_CMD_TYPE_INIT_CPY_BSF_BUFF_OVER_QUERY: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->str_bit_handler.cpy_over;
|
*pui_value = p_obj_drc->str_bit_handler.cpy_over;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF_OVER_QUERY:
|
case IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF_OVER_QUERY: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->str_bit_handler.cpy_over_ic;
|
*pui_value = p_obj_drc->str_bit_handler.cpy_over_ic;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF_OVER_QUERY:
|
case IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF_OVER_QUERY: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->str_bit_handler.cpy_over_il;
|
*pui_value = p_obj_drc->str_bit_handler.cpy_over_il;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF_OVER_QUERY:
|
case IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF_OVER_QUERY: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->str_bit_handler.cpy_over_in;
|
*pui_value = p_obj_drc->str_bit_handler.cpy_over_in;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_BSF_BUFF:
|
case IA_CMD_TYPE_INIT_CPY_BSF_BUFF: {
|
||||||
{
|
memcpy(p_obj_drc->str_bit_handler.it_bit_buf +
|
||||||
memcpy(p_obj_drc->str_bit_handler.it_bit_buf+p_obj_drc->str_bit_handler.num_bytes_bs, p_obj_drc->pp_mem[2],p_obj_drc->str_bit_handler.num_byts_cur);
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs=p_obj_drc->str_bit_handler.num_bytes_bs+p_obj_drc->str_bit_handler.num_byts_cur;
|
p_obj_drc->pp_mem[2], p_obj_drc->str_bit_handler.num_byts_cur);
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs +
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF:
|
case IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF: {
|
||||||
{
|
memcpy(p_obj_drc->str_bit_handler.bitstream_drc_config +
|
||||||
memcpy(p_obj_drc->str_bit_handler.bitstream_drc_config+p_obj_drc->str_bit_handler.num_bytes_bs_drc_config, p_obj_drc->pp_mem[2],p_obj_drc->str_bit_handler.num_byts_cur_ic);
|
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config,
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config=p_obj_drc->str_bit_handler.num_bytes_bs_drc_config+p_obj_drc->str_bit_handler.num_byts_cur_ic;
|
p_obj_drc->pp_mem[2],
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_ic);
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config +
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_ic;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF:
|
case IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF: {
|
||||||
{
|
memcpy(p_obj_drc->str_bit_handler.bitstream_loudness_info +
|
||||||
memcpy(p_obj_drc->str_bit_handler.bitstream_loudness_info+p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info, p_obj_drc->pp_mem[2],p_obj_drc->str_bit_handler.num_byts_cur_il);
|
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info,
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info=p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info+p_obj_drc->str_bit_handler.num_byts_cur_il;
|
p_obj_drc->pp_mem[2],
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_il);
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info +
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_il;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF:
|
case IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF: {
|
||||||
{
|
memcpy(p_obj_drc->str_bit_handler.bitstream_unidrc_interface +
|
||||||
memcpy(p_obj_drc->str_bit_handler.bitstream_unidrc_interface+p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface, p_obj_drc->pp_mem[2],p_obj_drc->str_bit_handler.num_byts_cur_in);
|
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface,
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface=p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface+p_obj_drc->str_bit_handler.num_byts_cur_in;
|
p_obj_drc->pp_mem[2],
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_in);
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface +
|
||||||
|
p_obj_drc->str_bit_handler.num_byts_cur_in;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
default: { return -1; }
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_CONFIG_PARAM:
|
case IA_API_CMD_GET_CONFIG_PARAM: {
|
||||||
{
|
switch (i_idx) {
|
||||||
switch(i_idx)
|
case IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ: {
|
||||||
{
|
*pus_value = p_obj_drc->str_config.sampling_rate;
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ:
|
|
||||||
{
|
|
||||||
|
|
||||||
*pus_value=p_obj_drc->str_config.sampling_rate;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS:
|
case IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS: {
|
||||||
{
|
*pus_value = p_obj_drc->str_config.num_ch_out;
|
||||||
|
|
||||||
*pus_value=p_obj_drc->str_config.num_ch_out;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PROC_OUT_PTR:
|
case IA_DRC_DEC_CONFIG_PROC_OUT_PTR: {
|
||||||
{
|
*ps_value = (SIZE_T)p_obj_drc->str_payload.pstr_drc_sel_proc_output;
|
||||||
|
|
||||||
*ps_value=(SIZE_T)p_obj_drc->str_payload.pstr_drc_sel_proc_output;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_CONFIG_PARAM:
|
case IA_API_CMD_SET_CONFIG_PARAM: {
|
||||||
{
|
switch (i_idx) {
|
||||||
switch(i_idx)
|
case IA_DRC_DEC_CONFIG_PARAM_DEC_TYPE: {
|
||||||
{
|
if (*pus_value == 1) {
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_DEC_TYPE:
|
|
||||||
{
|
|
||||||
if(*pus_value==1){
|
|
||||||
p_obj_drc->str_config.dec_type = DEC_TYPE_TD_QMF64;
|
p_obj_drc->str_config.dec_type = DEC_TYPE_TD_QMF64;
|
||||||
p_obj_drc->str_config.sub_band_domain_mode = SUBBAND_DOMAIN_MODE_QMF64;
|
p_obj_drc->str_config.sub_band_domain_mode =
|
||||||
p_obj_drc->str_config.sub_band_down_sampling_factor = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
SUBBAND_DOMAIN_MODE_QMF64;
|
||||||
p_obj_drc->str_config.sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
p_obj_drc->str_config.sub_band_down_sampling_factor =
|
||||||
}
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
else if(*pus_value==2){
|
p_obj_drc->str_config.sub_band_count =
|
||||||
|
AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
||||||
|
} else if (*pus_value == 2) {
|
||||||
p_obj_drc->str_config.dec_type = DEC_TYPE_QMF64;
|
p_obj_drc->str_config.dec_type = DEC_TYPE_QMF64;
|
||||||
p_obj_drc->str_config.sub_band_domain_mode = SUBBAND_DOMAIN_MODE_QMF64;
|
p_obj_drc->str_config.sub_band_domain_mode =
|
||||||
p_obj_drc->str_config.sub_band_down_sampling_factor = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
SUBBAND_DOMAIN_MODE_QMF64;
|
||||||
p_obj_drc->str_config.sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
p_obj_drc->str_config.sub_band_down_sampling_factor =
|
||||||
}
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
else if(*pus_value==3){
|
p_obj_drc->str_config.sub_band_count =
|
||||||
|
AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
||||||
|
} else if (*pus_value == 3) {
|
||||||
p_obj_drc->str_config.dec_type = DEC_TYPE_STFT256;
|
p_obj_drc->str_config.dec_type = DEC_TYPE_STFT256;
|
||||||
p_obj_drc->str_config.sub_band_domain_mode = SUBBAND_DOMAIN_MODE_STFT256;
|
p_obj_drc->str_config.sub_band_domain_mode =
|
||||||
p_obj_drc->str_config.sub_band_down_sampling_factor = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
SUBBAND_DOMAIN_MODE_STFT256;
|
||||||
p_obj_drc->str_config.sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_STFT256;
|
p_obj_drc->str_config.sub_band_down_sampling_factor =
|
||||||
}
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
||||||
else{
|
p_obj_drc->str_config.sub_band_count =
|
||||||
|
AUDIO_CODEC_SUBBAND_COUNT_STFT256;
|
||||||
|
} else {
|
||||||
p_obj_drc->str_config.dec_type = DEC_TYPE_TD;
|
p_obj_drc->str_config.dec_type = DEC_TYPE_TD;
|
||||||
p_obj_drc->str_config.sub_band_domain_mode = SUBBAND_DOMAIN_MODE_OFF;
|
p_obj_drc->str_config.sub_band_domain_mode =
|
||||||
|
SUBBAND_DOMAIN_MODE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*pus_value<0 || *pus_value >3)
|
if (*pus_value < 0 || *pus_value > 3) {
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_CTRL_PARAM:
|
case IA_DRC_DEC_CONFIG_PARAM_CTRL_PARAM: {
|
||||||
{
|
if (*pus_value < 1 || *pus_value > 39) {
|
||||||
if(*pus_value<1 || *pus_value>39)
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.control_parameter_index = *pus_value;
|
p_obj_drc->str_config.control_parameter_index = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_PEAK_LIMITER:
|
case IA_DRC_DEC_CONFIG_PARAM_PEAK_LIMITER: {
|
||||||
{
|
if (*pus_value < 0 || *pus_value > 1) {
|
||||||
if(*pus_value<0 || *pus_value>1)
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.peak_limiter = *pus_value;
|
p_obj_drc->str_config.peak_limiter = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_VER_MODE:
|
case IA_DRC_DEC_CONFIG_PARAM_VER_MODE: {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ:
|
case IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ: {
|
||||||
{
|
if (*pus_value < 8000 || *pus_value > 96000) {
|
||||||
if(*pus_value<8000 || *pus_value>96000)
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_SAMP_FREQ;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_SAMP_FREQ;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.sampling_rate = *pus_value;
|
p_obj_drc->str_config.sampling_rate = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS:
|
case IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.num_ch_in = *pus_value;
|
p_obj_drc->str_config.num_ch_in = *pus_value;
|
||||||
if(*pus_value < 1 || *pus_value > MAX_CHANNEL_COUNT)
|
if (*pus_value < 1 || *pus_value > MAX_CHANNEL_COUNT) {
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_NUM_OF_CHANNELS;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_NUM_OF_CHANNELS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ:
|
case IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ: {
|
||||||
{
|
if ((*pus_value != 16) && (*pus_value != 32)) {
|
||||||
if((*pus_value!=16) && (*pus_value!=32))
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PCM_SIZE;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PCM_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_obj_drc->str_config.pcm_size = *pus_value;
|
p_obj_drc->str_config.pcm_size = *pus_value;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT:
|
case IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT: {
|
||||||
{
|
if ((*pus_value != 1) && (*pus_value != 0)) {
|
||||||
if((*pus_value!=1)&&(*pus_value!=0))
|
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.bitstream_file_format = *pus_value;
|
p_obj_drc->str_config.bitstream_file_format = *pus_value;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT:
|
case IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT: {
|
||||||
{
|
if ((*pus_value != 1) && (*pus_value != 0)) {
|
||||||
if((*pus_value!=1)&&(*pus_value!=0))
|
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.interface_bitstream_present = *pus_value;
|
p_obj_drc->str_config.interface_bitstream_present = *pus_value;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_DELAY_MODE:
|
case IA_DRC_DEC_CONFIG_PARAM_DELAY_MODE: {
|
||||||
{
|
if ((*pus_value != 1) && (*pus_value != 0)) {
|
||||||
if((*pus_value!=1)&&(*pus_value!=0))
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.delay_mode = *pus_value;
|
p_obj_drc->str_config.delay_mode = *pus_value;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_GAIN_DELAY:
|
case IA_DRC_DEC_CONFIG_PARAM_GAIN_DELAY: {
|
||||||
{
|
if ((*pus_value > MAX_SIGNAL_DELAY) || (*pus_value < 0)) {
|
||||||
if ((*pus_value > MAX_SIGNAL_DELAY) || (*pus_value < 0))
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_obj_drc->str_config.gain_delay_samples = *pus_value;
|
p_obj_drc->str_config.gain_delay_samples = *pus_value;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Sujith: introduce error*/
|
/*Sujith: introduce error*/
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_AUDIO_DELAY:
|
case IA_DRC_DEC_CONFIG_PARAM_AUDIO_DELAY: {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE:
|
case IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE: {
|
||||||
{
|
if (*pus_value < 0 || *pus_value > 1) {
|
||||||
if(*pus_value<0 || *pus_value>1)
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE;
|
return IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE;
|
||||||
}
|
}
|
||||||
p_obj_drc->str_config.constant_delay_on = *pus_value;
|
p_obj_drc->str_config.constant_delay_on = *pus_value;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_ABSO_DELAY_OFF:
|
case IA_DRC_DEC_CONFIG_PARAM_ABSO_DELAY_OFF: {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.absorb_delay_on = *pus_value;
|
p_obj_drc->str_config.absorb_delay_on = *pus_value;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE:
|
case IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE: {
|
||||||
{
|
if (*pus_value < 1 || *pus_value > 4096) {
|
||||||
if(*pus_value<1 || *pus_value>4096)
|
|
||||||
{
|
|
||||||
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_FRAME_SIZE;
|
return IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_FRAME_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_obj_drc->str_config.frame_size = *pus_value;
|
p_obj_drc->str_config.frame_size = *pus_value;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_GAIN_STREAM_FLAG:
|
case IA_DRC_DEC_CONFIG_GAIN_STREAM_FLAG: {
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.gain_stream_flag = *pus_value;
|
p_obj_drc->str_bit_handler.gain_stream_flag = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_DRC_DEC_CONFIG_DRC_EFFECT_TYPE:
|
case IA_DRC_DEC_CONFIG_DRC_EFFECT_TYPE: {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.effect_type = *pus_value;
|
p_obj_drc->str_config.effect_type = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS:
|
case IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.target_loudness = *pus_value;
|
p_obj_drc->str_config.target_loudness = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_DRC_DEC_CONFIG_DRC_LOUD_NORM:
|
case IA_DRC_DEC_CONFIG_DRC_LOUD_NORM: {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.loud_norm_flag = *pus_value;
|
p_obj_drc->str_config.loud_norm_flag = *pus_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default: { return -1; }
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_MEMTABS_SIZE:
|
case IA_API_CMD_GET_MEMTABS_SIZE: {
|
||||||
{
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_MEMTABS_PTR:
|
case IA_API_CMD_SET_MEMTABS_PTR: {
|
||||||
{
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_N_MEMTABS:
|
case IA_API_CMD_GET_N_MEMTABS: {
|
||||||
{
|
|
||||||
|
|
||||||
*pui_value = NUM_DRC_TABLES;
|
*pui_value = NUM_DRC_TABLES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_N_TABLES:
|
case IA_API_CMD_GET_N_TABLES: {
|
||||||
{
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_API_CMD_EXECUTE:
|
case IA_API_CMD_EXECUTE: {
|
||||||
{
|
switch (i_idx) {
|
||||||
switch(i_idx)
|
case IA_CMD_TYPE_DO_EXECUTE: {
|
||||||
{
|
if (p_obj_drc->str_config.dec_type == DEC_TYPE_TD) {
|
||||||
case IA_CMD_TYPE_DO_EXECUTE:
|
error_code = impd_process_time_domain(p_obj_drc);
|
||||||
{
|
} else if (p_obj_drc->str_config.dec_type == DEC_TYPE_QMF64) {
|
||||||
if(p_obj_drc->str_config.dec_type==DEC_TYPE_TD){
|
error_code = impd_init_process_audio_main_qmf(p_obj_drc);
|
||||||
error_code=impd_process_time_domain(p_obj_drc);}
|
} else if (p_obj_drc->str_config.dec_type == DEC_TYPE_STFT256) {
|
||||||
else if(p_obj_drc->str_config.dec_type==DEC_TYPE_QMF64){
|
error_code = impd_init_process_audio_main_stft(p_obj_drc);
|
||||||
error_code=impd_init_process_audio_main_qmf(p_obj_drc);
|
} else if (p_obj_drc->str_config.dec_type == DEC_TYPE_TD_QMF64) {
|
||||||
}
|
error_code = impd_init_process_audio_main_td_qmf(p_obj_drc);
|
||||||
else if(p_obj_drc->str_config.dec_type==DEC_TYPE_STFT256){
|
|
||||||
error_code=impd_init_process_audio_main_stft(p_obj_drc);
|
|
||||||
}
|
|
||||||
else if(p_obj_drc->str_config.dec_type==DEC_TYPE_TD_QMF64){
|
|
||||||
error_code=impd_init_process_audio_main_td_qmf(p_obj_drc);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_CMD_TYPE_DONE_QUERY:
|
case IA_CMD_TYPE_DONE_QUERY: {
|
||||||
{
|
|
||||||
|
|
||||||
*pui_value = p_obj_drc->p_state->ui_exe_done;
|
*pui_value = p_obj_drc->p_state->ui_exe_done;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: { return -1; }
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_PUT_INPUT_QUERY:
|
case IA_API_CMD_PUT_INPUT_QUERY: {
|
||||||
{
|
|
||||||
*pui_value = 1;
|
*pui_value = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_CURIDX_INPUT_BUF:
|
case IA_API_CMD_GET_CURIDX_INPUT_BUF: {
|
||||||
{
|
UWORD32 ui_in_buf_size = p_obj_drc->p_mem_info[IA_DRC_INPUT_IDX].ui_size;
|
||||||
UWORD32 ui_in_buf_size =
|
|
||||||
p_obj_drc->p_mem_info[IA_DRC_INPUT_IDX].ui_size;
|
|
||||||
UWORD32 ui_in_bytes = p_obj_drc->p_state->ui_in_bytes;
|
UWORD32 ui_in_bytes = p_obj_drc->p_state->ui_in_bytes;
|
||||||
*pui_value = ui_in_buf_size > ui_in_bytes ? ui_in_bytes : ui_in_buf_size;
|
*pui_value = ui_in_buf_size > ui_in_bytes ? ui_in_bytes : ui_in_buf_size;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_INPUT_BYTES:
|
case IA_API_CMD_SET_INPUT_BYTES: {
|
||||||
{
|
|
||||||
p_obj_drc->p_state->ui_in_bytes = *pui_value;
|
p_obj_drc->p_state->ui_in_bytes = *pui_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_API_CMD_GET_OUTPUT_BYTES:
|
case IA_API_CMD_GET_OUTPUT_BYTES: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_state->ui_out_bytes;
|
*pui_value = p_obj_drc->p_state->ui_out_bytes;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INPUT_OVER:
|
case IA_API_CMD_INPUT_OVER: {
|
||||||
{
|
p_obj_drc->p_state->ui_exe_done = 1;
|
||||||
p_obj_drc->p_state->ui_exe_done=1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INPUT_OVER_BS:
|
case IA_API_CMD_INPUT_OVER_BS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.cpy_over = 1;
|
p_obj_drc->str_bit_handler.cpy_over = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INPUT_OVER_IC_BS:
|
case IA_API_CMD_INPUT_OVER_IC_BS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.cpy_over_ic = 1;
|
p_obj_drc->str_bit_handler.cpy_over_ic = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INPUT_OVER_IL_BS:
|
case IA_API_CMD_INPUT_OVER_IL_BS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.cpy_over_il = 1;
|
p_obj_drc->str_bit_handler.cpy_over_il = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_INPUT_OVER_IN_BS:
|
case IA_API_CMD_INPUT_OVER_IN_BS: {
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.cpy_over_in = 1;
|
p_obj_drc->str_bit_handler.cpy_over_in = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_INPUT_BYTES_BS:
|
case IA_API_CMD_SET_INPUT_BYTES_BS: {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_byts_cur = *pus_value;
|
||||||
p_obj_drc->str_bit_handler.num_byts_cur=*pus_value;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_INPUT_BYTES_IC_BS:
|
case IA_API_CMD_SET_INPUT_BYTES_IC_BS: {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_byts_cur_ic = *pus_value;
|
||||||
p_obj_drc->str_bit_handler.num_byts_cur_ic=*pus_value;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_INPUT_BYTES_IL_BS:
|
case IA_API_CMD_SET_INPUT_BYTES_IL_BS: {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_byts_cur_il = *pus_value;
|
||||||
p_obj_drc->str_bit_handler.num_byts_cur_il=*pus_value;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_INPUT_BYTES_IN_BS:
|
case IA_API_CMD_SET_INPUT_BYTES_IN_BS: {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_byts_cur_in = *pus_value;
|
||||||
p_obj_drc->str_bit_handler.num_byts_cur_in=*pus_value;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: { return -1; }
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
return error_code;
|
return error_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc, WORD32 i_cmd,
|
||||||
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc,
|
WORD32 i_idx, pVOID pv_value) {
|
||||||
WORD32 i_cmd, WORD32 i_idx, pVOID pv_value)
|
|
||||||
{
|
|
||||||
pUWORD32 pui_value = pv_value;
|
pUWORD32 pui_value = pv_value;
|
||||||
|
|
||||||
switch(i_cmd)
|
switch (i_cmd) {
|
||||||
{
|
case IA_API_CMD_GET_MEM_INFO_SIZE: {
|
||||||
case IA_API_CMD_GET_MEM_INFO_SIZE:
|
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_size;
|
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_size;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_MEM_INFO_ALIGNMENT:
|
case IA_API_CMD_GET_MEM_INFO_ALIGNMENT: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_alignment;
|
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_alignment;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_MEM_INFO_TYPE:
|
case IA_API_CMD_GET_MEM_INFO_TYPE: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_type;
|
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_type;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_MEM_INFO_PLACEMENT:
|
case IA_API_CMD_GET_MEM_INFO_PLACEMENT: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_placement[0];
|
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_placement[0];
|
||||||
*(pui_value + 1) = p_obj_drc->p_mem_info[i_idx].ui_placement[1];
|
*(pui_value + 1) = p_obj_drc->p_mem_info[i_idx].ui_placement[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_GET_MEM_INFO_PRIORITY:
|
case IA_API_CMD_GET_MEM_INFO_PRIORITY: {
|
||||||
{
|
|
||||||
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_priority;
|
*pui_value = p_obj_drc->p_mem_info[i_idx].ui_priority;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_MEM_PTR:
|
case IA_API_CMD_SET_MEM_PTR: {
|
||||||
{
|
|
||||||
|
|
||||||
pWORD8 pbtemp;
|
pWORD8 pbtemp;
|
||||||
UWORD32 sz;
|
UWORD32 sz;
|
||||||
if(pv_value == 0)
|
if (pv_value == 0) {
|
||||||
{
|
return (-1);
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
if(((SIZE_T)pv_value % p_obj_drc->p_mem_info[i_idx].ui_alignment) != 0)
|
if (((SIZE_T)pv_value % p_obj_drc->p_mem_info[i_idx].ui_alignment) != 0) {
|
||||||
{
|
return (-1);
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
p_obj_drc->pp_mem[i_idx] = pv_value;
|
p_obj_drc->pp_mem[i_idx] = pv_value;
|
||||||
pbtemp = p_obj_drc->pp_mem[i_idx];
|
pbtemp = p_obj_drc->pp_mem[i_idx];
|
||||||
sz = p_obj_drc->p_mem_info[i_idx].ui_size;
|
sz = p_obj_drc->p_mem_info[i_idx].ui_size;
|
||||||
|
|
||||||
memset(pbtemp,0,sz);
|
memset(pbtemp, 0, sz);
|
||||||
}
|
}
|
||||||
case IA_API_CMD_SET_MEM_PLACEMENT:
|
case IA_API_CMD_SET_MEM_PLACEMENT: {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc)
|
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc) {
|
||||||
{
|
|
||||||
ia_mem_info_struct *p_mem_info;
|
ia_mem_info_struct *p_mem_info;
|
||||||
{
|
{
|
||||||
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_PERSIST_IDX];
|
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_PERSIST_IDX];
|
||||||
p_mem_info->ui_size = 64*1024*1024;
|
p_mem_info->ui_size = 64 * 1024 * 1024;
|
||||||
p_mem_info->ui_alignment = 8;
|
p_mem_info->ui_alignment = 8;
|
||||||
p_mem_info->ui_type = IA_MEMTYPE_PERSIST;
|
p_mem_info->ui_type = IA_MEMTYPE_PERSIST;
|
||||||
p_mem_info->ui_placement[0] = 0;
|
p_mem_info->ui_placement[0] = 0;
|
||||||
|
|
@ -680,7 +559,9 @@ IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_INPUT_IDX];
|
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_INPUT_IDX];
|
||||||
p_mem_info->ui_size = p_obj_drc->str_config.frame_size*(p_obj_drc->str_config.pcm_size>>3)*p_obj_drc->str_config.num_ch_in;
|
p_mem_info->ui_size = p_obj_drc->str_config.frame_size *
|
||||||
|
(p_obj_drc->str_config.pcm_size >> 3) *
|
||||||
|
p_obj_drc->str_config.num_ch_in;
|
||||||
p_mem_info->ui_alignment = 4;
|
p_mem_info->ui_alignment = 4;
|
||||||
p_mem_info->ui_type = IA_MEMTYPE_INPUT;
|
p_mem_info->ui_type = IA_MEMTYPE_INPUT;
|
||||||
p_mem_info->ui_placement[0] = 0;
|
p_mem_info->ui_placement[0] = 0;
|
||||||
|
|
@ -691,7 +572,9 @@ IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_OUTPUT_IDX];
|
p_mem_info = &p_obj_drc->p_mem_info[IA_DRC_OUTPUT_IDX];
|
||||||
p_mem_info->ui_size = p_obj_drc->str_config.frame_size*(p_obj_drc->str_config.pcm_size>>3)*p_obj_drc->str_config.num_ch_in;
|
p_mem_info->ui_size = p_obj_drc->str_config.frame_size *
|
||||||
|
(p_obj_drc->str_config.pcm_size >> 3) *
|
||||||
|
p_obj_drc->str_config.num_ch_in;
|
||||||
p_mem_info->ui_alignment = 4;
|
p_mem_info->ui_alignment = 4;
|
||||||
p_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
|
p_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
|
||||||
p_mem_info->ui_placement[0] = 0;
|
p_mem_info->ui_placement[0] = 0;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IMPD_API_DEFS_H
|
#ifndef IMPD_API_DEFS_H
|
||||||
#define IMPD_API_DEFS_H
|
#define IMPD_API_DEFS_H
|
||||||
|
|
||||||
|
|
@ -40,12 +39,11 @@
|
||||||
|
|
||||||
#define IA_STR(str) #str
|
#define IA_STR(str) #str
|
||||||
#define IA_MAKE_VERSION_STR(maj, min) IA_STR(maj) "." IA_STR(min)
|
#define IA_MAKE_VERSION_STR(maj, min) IA_STR(maj) "." IA_STR(min)
|
||||||
#define IA_APIVERSION IA_MAKE_VERSION_STR(\
|
#define IA_APIVERSION \
|
||||||
IA_APIVERSION_MAJOR, \
|
IA_MAKE_VERSION_STR(IA_APIVERSION_MAJOR, IA_APIVERSION_MINOR)
|
||||||
IA_APIVERSION_MINOR)
|
|
||||||
|
|
||||||
#define IA_LAST_COMP_APIVERSION IA_MAKE_VERSION_STR(\
|
#define IA_LAST_COMP_APIVERSION \
|
||||||
IA_LASTCOMP_APIVERSION_MAJOR, \
|
IA_MAKE_VERSION_STR(IA_LASTCOMP_APIVERSION_MAJOR, \
|
||||||
IA_LASTCOMP_APIVERSION_MINOR)
|
IA_LASTCOMP_APIVERSION_MINOR)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,7 @@
|
||||||
/* structure definitions */
|
/* structure definitions */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* DRC Configuration */
|
/* DRC Configuration */
|
||||||
typedef struct ia_drc_config_struct
|
typedef struct ia_drc_config_struct {
|
||||||
{
|
|
||||||
WORD32 bitstream_file_format;
|
WORD32 bitstream_file_format;
|
||||||
WORD32 dec_type;
|
WORD32 dec_type;
|
||||||
WORD32 sub_band_domain_mode;
|
WORD32 sub_band_domain_mode;
|
||||||
|
|
@ -43,7 +42,7 @@ typedef struct ia_drc_config_struct
|
||||||
WORD32 peak_limiter;
|
WORD32 peak_limiter;
|
||||||
WORD32 interface_bitstream_present;
|
WORD32 interface_bitstream_present;
|
||||||
WORD32 pcm_size;
|
WORD32 pcm_size;
|
||||||
WORD32 parametric_drc_delay_gain_dec_instance ;
|
WORD32 parametric_drc_delay_gain_dec_instance;
|
||||||
WORD32 parametric_drc_delay;
|
WORD32 parametric_drc_delay;
|
||||||
WORD32 parametric_drc_delay_max;
|
WORD32 parametric_drc_delay_max;
|
||||||
WORD32 eq_delay_gain_dec_instance;
|
WORD32 eq_delay_gain_dec_instance;
|
||||||
|
|
@ -57,15 +56,14 @@ typedef struct ia_drc_config_struct
|
||||||
WORD32 target_loudness;
|
WORD32 target_loudness;
|
||||||
WORD32 loud_norm_flag;
|
WORD32 loud_norm_flag;
|
||||||
|
|
||||||
}ia_drc_config_struct;
|
} ia_drc_config_struct;
|
||||||
|
|
||||||
/* DRC bitsteam handler */
|
/* DRC bitsteam handler */
|
||||||
typedef struct bits_handler
|
typedef struct bits_handler {
|
||||||
{
|
UWORD8 *bitstream_drc_config;
|
||||||
UWORD8* bitstream_drc_config;
|
UWORD8 *bitstream_loudness_info;
|
||||||
UWORD8* bitstream_loudness_info ;
|
UWORD8 *bitstream_unidrc_interface;
|
||||||
UWORD8* bitstream_unidrc_interface ;
|
UWORD8 *it_bit_buf;
|
||||||
UWORD8* it_bit_buf;
|
|
||||||
WORD32 num_bytes_bs_drc_config;
|
WORD32 num_bytes_bs_drc_config;
|
||||||
WORD32 num_bytes_bs_loudness_info;
|
WORD32 num_bytes_bs_loudness_info;
|
||||||
WORD32 num_bits_read_bs_unidrc_interface;
|
WORD32 num_bits_read_bs_unidrc_interface;
|
||||||
|
|
@ -84,10 +82,9 @@ typedef struct bits_handler
|
||||||
WORD32 cpy_over_il;
|
WORD32 cpy_over_il;
|
||||||
WORD32 cpy_over_in;
|
WORD32 cpy_over_in;
|
||||||
WORD32 gain_stream_flag;
|
WORD32 gain_stream_flag;
|
||||||
}ia_drc_bits_handler_struct;
|
} ia_drc_bits_handler_struct;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
ia_drc_bits_dec_struct *pstr_bitstream_dec;
|
ia_drc_bits_dec_struct *pstr_bitstream_dec;
|
||||||
ia_drc_gain_dec_struct *pstr_gain_dec[2];
|
ia_drc_gain_dec_struct *pstr_gain_dec[2];
|
||||||
ia_drc_sel_pro_struct *pstr_selection_proc;
|
ia_drc_sel_pro_struct *pstr_selection_proc;
|
||||||
|
|
@ -101,10 +98,9 @@ typedef struct
|
||||||
ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params;
|
ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params;
|
||||||
ia_drc_sel_proc_output_struct *pstr_drc_sel_proc_output;
|
ia_drc_sel_proc_output_struct *pstr_drc_sel_proc_output;
|
||||||
|
|
||||||
}ia_drc_payload_struct;
|
} ia_drc_payload_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_state_struct
|
typedef struct ia_drc_state_struct {
|
||||||
{
|
|
||||||
UWORD32 ui_out_bytes;
|
UWORD32 ui_out_bytes;
|
||||||
UWORD32 ui_in_bytes;
|
UWORD32 ui_in_bytes;
|
||||||
UWORD32 ui_ir_bytes;
|
UWORD32 ui_ir_bytes;
|
||||||
|
|
@ -117,10 +113,9 @@ typedef struct ia_drc_state_struct
|
||||||
WORD32 delay_in_output;
|
WORD32 delay_in_output;
|
||||||
WORD32 delay_adjust_samples;
|
WORD32 delay_adjust_samples;
|
||||||
pVOID persistant_ptr;
|
pVOID persistant_ptr;
|
||||||
}ia_drc_state_struct;
|
} ia_drc_state_struct;
|
||||||
|
|
||||||
typedef struct IA_PSM_API_Struct
|
typedef struct IA_PSM_API_Struct {
|
||||||
{
|
|
||||||
ia_drc_state_struct *p_state;
|
ia_drc_state_struct *p_state;
|
||||||
ia_drc_config_struct str_config;
|
ia_drc_config_struct str_config;
|
||||||
ia_drc_payload_struct str_payload;
|
ia_drc_payload_struct str_payload;
|
||||||
|
|
|
||||||
|
|
@ -30,23 +30,18 @@
|
||||||
#include "impd_drc_struct.h"
|
#include "impd_drc_struct.h"
|
||||||
#include "impd_drc_parser.h"
|
#include "impd_drc_parser.h"
|
||||||
|
|
||||||
|
WORD32 impd_read_bits_buf(ia_bit_buf_struct* it_bit_buff, WORD no_of_bits) {
|
||||||
WORD32 impd_read_bits_buf(ia_bit_buf_struct* it_bit_buff,
|
|
||||||
WORD no_of_bits)
|
|
||||||
{
|
|
||||||
|
|
||||||
UWORD32 ret_val;
|
UWORD32 ret_val;
|
||||||
UWORD8 *ptr_read_next = it_bit_buff->ptr_read_next;
|
UWORD8* ptr_read_next = it_bit_buff->ptr_read_next;
|
||||||
WORD bit_pos = it_bit_buff->bit_pos;
|
WORD bit_pos = it_bit_buff->bit_pos;
|
||||||
it_bit_buff->error = 0;
|
it_bit_buff->error = 0;
|
||||||
|
|
||||||
if(it_bit_buff->cnt_bits <= 0)
|
if (it_bit_buff->cnt_bits <= 0) {
|
||||||
{
|
|
||||||
it_bit_buff->error = 1;
|
it_bit_buff->error = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (no_of_bits==0){
|
if (no_of_bits == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +53,7 @@ WORD32 impd_read_bits_buf(ia_bit_buf_struct* it_bit_buff,
|
||||||
bit_pos += 8;
|
bit_pos += 8;
|
||||||
ptr_read_next++;
|
ptr_read_next++;
|
||||||
|
|
||||||
if(ptr_read_next > it_bit_buff->ptr_bit_buf_end) {
|
if (ptr_read_next > it_bit_buff->ptr_bit_buf_end) {
|
||||||
ptr_read_next = it_bit_buff->ptr_bit_buf_base;
|
ptr_read_next = it_bit_buff->ptr_bit_buf_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,10 +69,8 @@ WORD32 impd_read_bits_buf(ia_bit_buf_struct* it_bit_buff,
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_bit_buf_struct* impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
ia_bit_buf_struct* impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
||||||
UWORD8 *ptr_bit_buf_base,
|
UWORD8* ptr_bit_buf_base,
|
||||||
WORD32 bit_buf_size)
|
WORD32 bit_buf_size) {
|
||||||
{
|
|
||||||
|
|
||||||
it_bit_buff->ptr_bit_buf_base = ptr_bit_buf_base;
|
it_bit_buff->ptr_bit_buf_base = ptr_bit_buf_base;
|
||||||
it_bit_buff->ptr_bit_buf_end = ptr_bit_buf_base + bit_buf_size - 1;
|
it_bit_buff->ptr_bit_buf_end = ptr_bit_buf_base + bit_buf_size - 1;
|
||||||
|
|
||||||
|
|
@ -91,123 +84,104 @@ ia_bit_buf_struct* impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_bit_buf_struct* impd_create_init_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
ia_bit_buf_struct* impd_create_init_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
||||||
UWORD8 *ptr_bit_buf_base,
|
UWORD8* ptr_bit_buf_base,
|
||||||
WORD32 bit_buf_size)
|
WORD32 bit_buf_size) {
|
||||||
{
|
impd_create_bit_buf(it_bit_buff, ptr_bit_buf_base, bit_buf_size);
|
||||||
impd_create_bit_buf(it_bit_buff,ptr_bit_buf_base,bit_buf_size);
|
|
||||||
it_bit_buff->cnt_bits = (bit_buf_size << 3);
|
it_bit_buff->cnt_bits = (bit_buf_size << 3);
|
||||||
return (it_bit_buff);
|
return (it_bit_buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
||||||
WORD32 sample_rate,
|
WORD32 sample_rate, WORD32 frame_size,
|
||||||
WORD32 frame_size,
|
|
||||||
WORD32 delay_mode,
|
WORD32 delay_mode,
|
||||||
WORD32 lfe_channel_map_count,
|
WORD32 lfe_channel_map_count,
|
||||||
WORD32* lfe_channel_map)
|
WORD32* lfe_channel_map) {
|
||||||
{
|
|
||||||
WORD32 i, err_code = 0;
|
WORD32 i, err_code = 0;
|
||||||
|
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct = &p_drc_bs_dec_struct->ia_drc_params_struct;
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct =
|
||||||
|
&p_drc_bs_dec_struct->ia_drc_params_struct;
|
||||||
ia_drc_params_struct->drc_frame_size = frame_size;
|
ia_drc_params_struct->drc_frame_size = frame_size;
|
||||||
ia_drc_params_struct->delta_tmin_default = impd_get_delta_tmin(sample_rate);
|
ia_drc_params_struct->delta_tmin_default = impd_get_delta_tmin(sample_rate);
|
||||||
ia_drc_params_struct->num_gain_values_max_default = ia_drc_params_struct->drc_frame_size / ia_drc_params_struct->delta_tmin_default;
|
ia_drc_params_struct->num_gain_values_max_default =
|
||||||
|
ia_drc_params_struct->drc_frame_size /
|
||||||
|
ia_drc_params_struct->delta_tmin_default;
|
||||||
ia_drc_params_struct->delay_mode = delay_mode;
|
ia_drc_params_struct->delay_mode = delay_mode;
|
||||||
|
|
||||||
if ((frame_size < 1)||(frame_size > AUDIO_CODEC_FRAME_SIZE_MAX)||(ia_drc_params_struct->drc_frame_size < 0.001f * sample_rate))
|
if ((frame_size < 1) || (frame_size > AUDIO_CODEC_FRAME_SIZE_MAX) ||
|
||||||
{
|
(ia_drc_params_struct->drc_frame_size < 0.001f * sample_rate)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (sample_rate < 1000)
|
if (sample_rate < 1000) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ia_drc_params_struct->delta_tmin_default > ia_drc_params_struct->drc_frame_size)
|
if (ia_drc_params_struct->delta_tmin_default >
|
||||||
{
|
ia_drc_params_struct->drc_frame_size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lfe_channel_map_count >= 0)
|
if (lfe_channel_map_count >= 0) {
|
||||||
{
|
if ((lfe_channel_map == NULL) ||
|
||||||
if ((lfe_channel_map == NULL) || (lfe_channel_map_count > MAX_CHANNEL_COUNT))
|
(lfe_channel_map_count > MAX_CHANNEL_COUNT)) {
|
||||||
{
|
return (-1);
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_drc_params_struct->lfe_channel_map_count = lfe_channel_map_count;
|
ia_drc_params_struct->lfe_channel_map_count = lfe_channel_map_count;
|
||||||
|
|
||||||
for (i=0; i<lfe_channel_map_count; i++)
|
for (i = 0; i < lfe_channel_map_count; i++) {
|
||||||
{
|
|
||||||
ia_drc_params_struct->lfe_channel_map[i] = lfe_channel_map[i];
|
ia_drc_params_struct->lfe_channel_map[i] = lfe_channel_map[i];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
ia_drc_params_struct->lfe_channel_map_count = -1;
|
ia_drc_params_struct->lfe_channel_map_count = -1;
|
||||||
|
|
||||||
for (i=0; i<MAX_CHANNEL_COUNT; i++)
|
for (i = 0; i < MAX_CHANNEL_COUNT; i++) {
|
||||||
{
|
|
||||||
ia_drc_params_struct->lfe_channel_map[i] = 0;
|
ia_drc_params_struct->lfe_channel_map[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_init_tbls(ia_drc_params_struct->num_gain_values_max_default, &p_drc_bs_dec_struct->tables_default);
|
err_code = impd_init_tbls(ia_drc_params_struct->num_gain_values_max_default,
|
||||||
|
&p_drc_bs_dec_struct->tables_default);
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_process_drc_bitstream_dec(
|
||||||
WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
ia_drc_bits_dec_struct* p_drc_bs_dec_struct, ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_config *pstr_drc_config,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_loudness_info_set_struct *pstr_loudness_info,
|
UWORD8* bitstream_config, WORD32 num_bytes, WORD32 num_bits_offset,
|
||||||
UWORD8* bitstream_config,
|
WORD32* num_bits_read) {
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read)
|
|
||||||
{
|
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
WORD32 loudness_info_set_present, drc_config_present, dummy;
|
WORD32 loudness_info_set_present, drc_config_present, dummy;
|
||||||
|
|
||||||
|
if (bitstream_config == NULL) {
|
||||||
if (bitstream_config == NULL)
|
|
||||||
{
|
|
||||||
*num_bits_read = 0;
|
*num_bits_read = 0;
|
||||||
}
|
} else {
|
||||||
else
|
it_bit_buff =
|
||||||
{
|
impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
|
||||||
|
|
||||||
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
|
|
||||||
|
|
||||||
dummy = impd_read_bits_buf(it_bit_buff, num_bits_offset);
|
dummy = impd_read_bits_buf(it_bit_buff, num_bits_offset);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
loudness_info_set_present = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_info_set_present = impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
if (loudness_info_set_present)
|
if (loudness_info_set_present) {
|
||||||
{
|
|
||||||
drc_config_present = impd_read_bits_buf(it_bit_buff, 1);
|
drc_config_present = impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
if (drc_config_present)
|
if (drc_config_present) {
|
||||||
{
|
err_code = impd_parse_drc_config(
|
||||||
err_code = impd_parse_drc_config(it_bit_buff, &p_drc_bs_dec_struct->ia_drc_params_struct, pstr_drc_config);
|
it_bit_buff, &p_drc_bs_dec_struct->ia_drc_params_struct,
|
||||||
|
pstr_drc_config);
|
||||||
if (err_code)
|
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
|
if (err_code) return (err_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_parse_loudness_info_set(it_bit_buff, pstr_loudness_info);
|
err_code = impd_parse_loudness_info_set(it_bit_buff, pstr_loudness_info);
|
||||||
|
|
||||||
if (err_code)
|
if (err_code) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*num_bits_read = it_bit_buff->size - it_bit_buff->cnt_bits;
|
*num_bits_read = it_bit_buff->size - it_bit_buff->cnt_bits;
|
||||||
|
|
@ -216,76 +190,62 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struc
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_process_drc_bitstream_dec_config(
|
||||||
WORD32 impd_process_drc_bitstream_dec_config(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
ia_drc_bits_dec_struct* p_drc_bs_dec_struct, ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_config* pstr_drc_config, UWORD8* bitstream_config,
|
||||||
ia_drc_config *pstr_drc_config,
|
WORD32 num_bytes) {
|
||||||
UWORD8* bitstream_config,
|
|
||||||
WORD32 num_bytes)
|
|
||||||
{
|
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
|
it_bit_buff =
|
||||||
|
impd_create_init_bit_buf(it_bit_buff, bitstream_config, num_bytes);
|
||||||
|
|
||||||
err_code = impd_parse_drc_config( it_bit_buff, &p_drc_bs_dec_struct->ia_drc_params_struct, pstr_drc_config);
|
err_code = impd_parse_drc_config(
|
||||||
|
it_bit_buff, &p_drc_bs_dec_struct->ia_drc_params_struct, pstr_drc_config);
|
||||||
if (err_code) return (err_code);
|
if (err_code) return (err_code);
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_process_drc_bitstream_dec_gain(
|
||||||
WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
ia_drc_bits_dec_struct* p_drc_bs_dec_struct, ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
|
||||||
ia_drc_config *pstr_drc_config,
|
UWORD8* bitstream_gain, WORD32 num_bytes, WORD32 num_bits_offset,
|
||||||
ia_drc_gain_struct *pstr_drc_gain,
|
WORD32* num_bits_read) {
|
||||||
UWORD8* bitstream_gain,
|
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read)
|
|
||||||
{
|
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
WORD32 dummy;
|
WORD32 dummy;
|
||||||
|
|
||||||
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bitstream_gain, num_bytes);
|
it_bit_buff =
|
||||||
|
impd_create_init_bit_buf(it_bit_buff, bitstream_gain, num_bytes);
|
||||||
|
|
||||||
dummy = impd_read_bits_buf(it_bit_buff, num_bits_offset);
|
dummy = impd_read_bits_buf(it_bit_buff, num_bits_offset);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
err_code = impd_drc_uni_gain_read(
|
err_code = impd_drc_uni_gain_read(it_bit_buff, p_drc_bs_dec_struct,
|
||||||
it_bit_buff,
|
pstr_drc_config, pstr_drc_gain);
|
||||||
p_drc_bs_dec_struct,
|
|
||||||
pstr_drc_config,
|
|
||||||
pstr_drc_gain);
|
|
||||||
|
|
||||||
if (err_code > PROC_COMPLETE)
|
if (err_code > PROC_COMPLETE) return (err_code);
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
*num_bits_read = (it_bit_buff->size) - it_bit_buff->cnt_bits;
|
*num_bits_read = (it_bit_buff->size) - it_bit_buff->cnt_bits;
|
||||||
|
|
||||||
if (err_code == PROC_COMPLETE)
|
if (err_code == PROC_COMPLETE) {
|
||||||
{
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(
|
||||||
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct *pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
UWORD8* bit_stream_loudness,
|
UWORD8* bit_stream_loudness, WORD32 num_bytes_loudness) {
|
||||||
WORD32 num_bytes_loudness)
|
|
||||||
{
|
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bit_stream_loudness, num_bytes_loudness);
|
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, bit_stream_loudness,
|
||||||
|
num_bytes_loudness);
|
||||||
|
|
||||||
err_code = impd_parse_loudness_info_set(it_bit_buff, pstr_loudness_info);
|
err_code = impd_parse_loudness_info_set(it_bit_buff, pstr_loudness_info);
|
||||||
if (err_code)
|
if (err_code) return (err_code);
|
||||||
return(err_code);
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@
|
||||||
#ifndef IMPD_DRC_BITBUFFER_H
|
#ifndef IMPD_DRC_BITBUFFER_H
|
||||||
#define IMPD_DRC_BITBUFFER_H
|
#define IMPD_DRC_BITBUFFER_H
|
||||||
|
|
||||||
|
typedef struct ia_bit_buf_struct {
|
||||||
typedef struct ia_bit_buf_struct
|
|
||||||
{
|
|
||||||
UWORD8 *ptr_bit_buf_base;
|
UWORD8 *ptr_bit_buf_base;
|
||||||
UWORD8 *ptr_bit_buf_end;
|
UWORD8 *ptr_bit_buf_end;
|
||||||
|
|
||||||
|
|
@ -34,20 +32,16 @@ typedef struct ia_bit_buf_struct
|
||||||
WORD32 size;
|
WORD32 size;
|
||||||
WORD32 error;
|
WORD32 error;
|
||||||
|
|
||||||
|
} ia_bit_buf_struct;
|
||||||
|
|
||||||
}ia_bit_buf_struct;
|
ia_bit_buf_struct *impd_create_bit_buf(ia_bit_buf_struct *it_bit_buff,
|
||||||
|
|
||||||
|
|
||||||
ia_bit_buf_struct * impd_create_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
|
||||||
UWORD8 *ptr_bit_buf_base,
|
UWORD8 *ptr_bit_buf_base,
|
||||||
WORD32 bit_buf_size);
|
WORD32 bit_buf_size);
|
||||||
|
|
||||||
ia_bit_buf_struct * impd_create_init_bit_buf(ia_bit_buf_struct* it_bit_buff,
|
ia_bit_buf_struct *impd_create_init_bit_buf(ia_bit_buf_struct *it_bit_buff,
|
||||||
UWORD8 *ptr_bit_buf_base,
|
UWORD8 *ptr_bit_buf_base,
|
||||||
WORD32 bit_buf_size);
|
WORD32 bit_buf_size);
|
||||||
|
|
||||||
WORD32 impd_read_bits_buf(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_read_bits_buf(ia_bit_buf_struct *it_bit_buff, WORD no_of_bits);
|
||||||
WORD no_of_bits);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,44 +20,31 @@
|
||||||
#ifndef IMPD_DRC_BITSTREAM_DEC_API_H
|
#ifndef IMPD_DRC_BITSTREAM_DEC_API_H
|
||||||
#define IMPD_DRC_BITSTREAM_DEC_API_H
|
#define IMPD_DRC_BITSTREAM_DEC_API_H
|
||||||
|
|
||||||
|
WORD32 impd_init_drc_bitstream_dec(
|
||||||
WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct, WORD32 sample_rate,
|
||||||
WORD32 sample_rate,
|
WORD32 frame_size, WORD32 delay_mode, WORD32 lfe_channel_map_count,
|
||||||
WORD32 frame_size,
|
|
||||||
WORD32 delay_mode,
|
|
||||||
WORD32 lfe_channel_map_count,
|
|
||||||
WORD32* lfe_channel_map);
|
WORD32* lfe_channel_map);
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
UWORD8* bitstream_config,
|
UWORD8* bitstream_config, WORD32 num_bytes, WORD32 num_bits_offset,
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read);
|
WORD32* num_bits_read);
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_config(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_config(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
UWORD8* bitstream_config,
|
UWORD8* bitstream_config, WORD32 num_bytes);
|
||||||
WORD32 num_bytes);
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_gain(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_gain_struct* pstr_drc_gain, UWORD8* bitstream_gain, WORD32 num_bytes,
|
||||||
UWORD8* bitstream_gain,
|
WORD32 num_bits_offset, WORD32* num_bits_read);
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read);
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
UWORD8* bitstream_loudness,
|
UWORD8* bitstream_loudness, WORD32 num_bytes_loudness);
|
||||||
WORD32 num_bytes_loudness
|
|
||||||
);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,9 @@
|
||||||
#define IMPD_DRC_COMMON_H
|
#define IMPD_DRC_COMMON_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define EQ_IS_SUPPORTED 1
|
#define EQ_IS_SUPPORTED 1
|
||||||
|
|
||||||
#define MEASURE_AVERAGE_BITRATE 0
|
#define MEASURE_AVERAGE_BITRATE 0
|
||||||
|
|
@ -33,7 +31,7 @@ extern "C"
|
||||||
#define ENABLE_ADDITIONAL_TESTS 1
|
#define ENABLE_ADDITIONAL_TESTS 1
|
||||||
|
|
||||||
#define SPEAKER_POS_COUNT_MAX 128
|
#define SPEAKER_POS_COUNT_MAX 128
|
||||||
#define DOWNMIX_COEFF_COUNT_MAX 32*32
|
#define DOWNMIX_COEFF_COUNT_MAX 32 * 32
|
||||||
#define MAX_CHANNEL_COUNT 128
|
#define MAX_CHANNEL_COUNT 128
|
||||||
#define BAND_COUNT_MAX 8
|
#define BAND_COUNT_MAX 8
|
||||||
#define SEQUENCE_COUNT_MAX 24
|
#define SEQUENCE_COUNT_MAX 24
|
||||||
|
|
@ -44,7 +42,7 @@ extern "C"
|
||||||
#define DRC_INSTRUCTIONS_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
#define DRC_INSTRUCTIONS_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
||||||
#define LOUDNESS_INFO_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
#define LOUDNESS_INFO_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
||||||
#define AUDIO_CODEC_FRAME_SIZE_MAX 4096
|
#define AUDIO_CODEC_FRAME_SIZE_MAX 4096
|
||||||
#define DRC_CODEC_FRAME_SIZE_MAX (AUDIO_CODEC_FRAME_SIZE_MAX/8)
|
#define DRC_CODEC_FRAME_SIZE_MAX (AUDIO_CODEC_FRAME_SIZE_MAX / 8)
|
||||||
#define NODE_COUNT_MAX DRC_CODEC_FRAME_SIZE_MAX
|
#define NODE_COUNT_MAX DRC_CODEC_FRAME_SIZE_MAX
|
||||||
#define CHANNEL_GROUP_COUNT_MAX SEQUENCE_COUNT_MAX
|
#define CHANNEL_GROUP_COUNT_MAX SEQUENCE_COUNT_MAX
|
||||||
#define SUB_DRC_COUNT 4
|
#define SUB_DRC_COUNT 4
|
||||||
|
|
@ -120,7 +118,7 @@ extern "C"
|
||||||
|
|
||||||
#define AUDIO_CODEC_SUBBAND_COUNT_QMF71 71
|
#define AUDIO_CODEC_SUBBAND_COUNT_QMF71 71
|
||||||
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71 64
|
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71 64
|
||||||
#define AUDIO_CODEC_SUBBAND_ANALYSE_DELAY_QMF71 320+384
|
#define AUDIO_CODEC_SUBBAND_ANALYSE_DELAY_QMF71 320 + 384
|
||||||
|
|
||||||
#define AUDIO_CODEC_SUBBAND_COUNT_STFT256 256
|
#define AUDIO_CODEC_SUBBAND_COUNT_STFT256 256
|
||||||
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256 256
|
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256 256
|
||||||
|
|
@ -137,7 +135,6 @@ extern "C"
|
||||||
#define UNIDRCCONFEXT_TERM 0x0
|
#define UNIDRCCONFEXT_TERM 0x0
|
||||||
#define UNIDRCINTERFACEEXT_TERM 0x0
|
#define UNIDRCINTERFACEEXT_TERM 0x0
|
||||||
|
|
||||||
|
|
||||||
#define UNIDRCCONFEXT_PARAM_DRC 0x1
|
#define UNIDRCCONFEXT_PARAM_DRC 0x1
|
||||||
|
|
||||||
#define PARAM_DRC_INSTRUCTIONS_COUNT_MAX 8
|
#define PARAM_DRC_INSTRUCTIONS_COUNT_MAX 8
|
||||||
|
|
@ -152,7 +149,6 @@ extern "C"
|
||||||
#define PARAM_DRC_TYPE_LIM_ATTACK_DEFAULT 5
|
#define PARAM_DRC_TYPE_LIM_ATTACK_DEFAULT 5
|
||||||
#define PARAM_DRC_TYPE_LIM_RELEASE_DEFAULT 50
|
#define PARAM_DRC_TYPE_LIM_RELEASE_DEFAULT 50
|
||||||
|
|
||||||
|
|
||||||
#define UNIDRCCONFEXT_V1 0x2
|
#define UNIDRCCONFEXT_V1 0x2
|
||||||
#define UNIDRCLOUDEXT_EQ 0x1
|
#define UNIDRCLOUDEXT_EQ 0x1
|
||||||
#define UNIDRCINTERFACEEXT_EQ 0x1
|
#define UNIDRCINTERFACEEXT_EQ 0x1
|
||||||
|
|
@ -163,15 +159,13 @@ extern "C"
|
||||||
#define LOUD_EQ_REQUEST_HEAVY 0x3
|
#define LOUD_EQ_REQUEST_HEAVY 0x3
|
||||||
|
|
||||||
#define EQ_PURPOSE_EQ_OFF 0
|
#define EQ_PURPOSE_EQ_OFF 0
|
||||||
#define EQ_PURPOSE_DEFAULT (1<<0)
|
#define EQ_PURPOSE_DEFAULT (1 << 0)
|
||||||
#define EQ_PURPOSE_LARGE_ROOM (1<<1)
|
#define EQ_PURPOSE_LARGE_ROOM (1 << 1)
|
||||||
#define EQ_PURPOSE_SMALL_SPACE (1<<2)
|
#define EQ_PURPOSE_SMALL_SPACE (1 << 2)
|
||||||
#define EQ_PURPOSE_AVERAGE_ROOM (1<<3)
|
#define EQ_PURPOSE_AVERAGE_ROOM (1 << 3)
|
||||||
#define EQ_PURPOSE_CAR_CABIN (1<<4)
|
#define EQ_PURPOSE_CAR_CABIN (1 << 4)
|
||||||
#define EQ_PURPOSE_HEADPHONES (1<<5)
|
#define EQ_PURPOSE_HEADPHONES (1 << 5)
|
||||||
#define EQ_PURPOSE_LATE_NIGHT (1<<6)
|
#define EQ_PURPOSE_LATE_NIGHT (1 << 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MAXPACKETLOSSTIME 2.5f
|
#define MAXPACKETLOSSTIME 2.5f
|
||||||
|
|
||||||
|
|
@ -188,8 +182,7 @@ extern "C"
|
||||||
#define bool WORD32
|
#define bool WORD32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct ia_drc_sel_proc_output_struct
|
typedef struct ia_drc_sel_proc_output_struct {
|
||||||
{
|
|
||||||
FLOAT32 output_peak_level_db;
|
FLOAT32 output_peak_level_db;
|
||||||
FLOAT32 loudness_normalization_gain_db;
|
FLOAT32 loudness_normalization_gain_db;
|
||||||
FLOAT32 output_loudness;
|
FLOAT32 output_loudness;
|
||||||
|
|
@ -209,7 +202,6 @@ typedef struct ia_drc_sel_proc_output_struct
|
||||||
FLOAT32 compress;
|
FLOAT32 compress;
|
||||||
WORD32 drc_characteristic_target;
|
WORD32 drc_characteristic_target;
|
||||||
|
|
||||||
|
|
||||||
FLOAT32 mixing_level;
|
FLOAT32 mixing_level;
|
||||||
WORD32 sel_eq_set_ids[SELECTED_EQ_SET_COUNT_MAX];
|
WORD32 sel_eq_set_ids[SELECTED_EQ_SET_COUNT_MAX];
|
||||||
WORD32 sel_loud_eq_id;
|
WORD32 sel_loud_eq_id;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
#ifndef IMPD_DRC_CONFIG_PARAMS_H
|
#ifndef IMPD_DRC_CONFIG_PARAMS_H
|
||||||
#define IMPD_DRC_CONFIG_PARAMS_H
|
#define IMPD_DRC_CONFIG_PARAMS_H
|
||||||
|
|
||||||
|
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ 0x0000
|
#define IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ 0x0000
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ 0x0001
|
#define IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ 0x0001
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS 0x0002
|
#define IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS 0x0002
|
||||||
|
|
|
||||||
|
|
@ -27,29 +27,22 @@
|
||||||
#include "impd_drc_filter_bank.h"
|
#include "impd_drc_filter_bank.h"
|
||||||
#include "impd_drc_multi_band.h"
|
#include "impd_drc_multi_band.h"
|
||||||
|
|
||||||
|
WORD32 impd_init_drc_params(WORD32 frame_size, WORD32 sample_rate,
|
||||||
WORD32 impd_init_drc_params(WORD32 frame_size,
|
WORD32 gain_delay_samples, WORD32 delay_mode,
|
||||||
WORD32 sample_rate,
|
|
||||||
WORD32 gain_delay_samples,
|
|
||||||
WORD32 delay_mode,
|
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_drc_params_struct* ia_drc_params_struct)
|
ia_drc_params_struct* ia_drc_params_struct) {
|
||||||
{
|
|
||||||
WORD32 k;
|
WORD32 k;
|
||||||
if (frame_size < 1|| frame_size > AUDIO_CODEC_FRAME_SIZE_MAX)
|
if (frame_size < 1 || frame_size > AUDIO_CODEC_FRAME_SIZE_MAX) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sample_rate < 1000)
|
if (sample_rate < 1000) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_drc_params_struct->drc_frame_size = frame_size;
|
ia_drc_params_struct->drc_frame_size = frame_size;
|
||||||
|
|
||||||
if (ia_drc_params_struct->drc_frame_size < 0.001f * sample_rate)
|
if (ia_drc_params_struct->drc_frame_size < 0.001f * sample_rate) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,13 +50,13 @@ WORD32 impd_init_drc_params(WORD32 frame_size,
|
||||||
|
|
||||||
ia_drc_params_struct->delta_tmin_default = impd_get_delta_tmin(sample_rate);
|
ia_drc_params_struct->delta_tmin_default = impd_get_delta_tmin(sample_rate);
|
||||||
|
|
||||||
if (ia_drc_params_struct->delta_tmin_default > ia_drc_params_struct->drc_frame_size)
|
if (ia_drc_params_struct->delta_tmin_default >
|
||||||
{
|
ia_drc_params_struct->drc_frame_size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((delay_mode != DELAY_MODE_REGULAR_DELAY) && (delay_mode != DELAY_MODE_LOW_DELAY))
|
if ((delay_mode != DELAY_MODE_REGULAR_DELAY) &&
|
||||||
{
|
(delay_mode != DELAY_MODE_LOW_DELAY)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,24 +65,19 @@ WORD32 impd_init_drc_params(WORD32 frame_size,
|
||||||
ia_drc_params_struct->drc_set_counter = 0;
|
ia_drc_params_struct->drc_set_counter = 0;
|
||||||
ia_drc_params_struct->multiband_sel_drc_idx = -1;
|
ia_drc_params_struct->multiband_sel_drc_idx = -1;
|
||||||
|
|
||||||
for (k = 0; k < SEL_DRC_COUNT; k++)
|
for (k = 0; k < SEL_DRC_COUNT; k++) {
|
||||||
{
|
|
||||||
ia_drc_params_struct->sel_drc_array[k].drc_instructions_index = -1;
|
ia_drc_params_struct->sel_drc_array[k].drc_instructions_index = -1;
|
||||||
ia_drc_params_struct->sel_drc_array[k].dwnmix_instructions_index = -1;
|
ia_drc_params_struct->sel_drc_array[k].dwnmix_instructions_index = -1;
|
||||||
ia_drc_params_struct->sel_drc_array[k].drc_coeff_idx = -1;
|
ia_drc_params_struct->sel_drc_array[k].drc_coeff_idx = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gain_delay_samples > MAX_SIGNAL_DELAY) || (gain_delay_samples < 0))
|
if ((gain_delay_samples > MAX_SIGNAL_DELAY) || (gain_delay_samples < 0)) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
ia_drc_params_struct->gain_delay_samples = gain_delay_samples;
|
ia_drc_params_struct->gain_delay_samples = gain_delay_samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sub_band_domain_mode)
|
switch (sub_band_domain_mode) {
|
||||||
{
|
|
||||||
case SUBBAND_DOMAIN_MODE_OFF:
|
case SUBBAND_DOMAIN_MODE_OFF:
|
||||||
case SUBBAND_DOMAIN_MODE_QMF64:
|
case SUBBAND_DOMAIN_MODE_QMF64:
|
||||||
case SUBBAND_DOMAIN_MODE_QMF71:
|
case SUBBAND_DOMAIN_MODE_QMF71:
|
||||||
|
|
@ -107,59 +95,46 @@ WORD32 impd_init_drc_params(WORD32 frame_size,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_select_drc_coefficients(
|
||||||
WORD32 impd_select_drc_coefficients(ia_drc_config* drc_config,
|
ia_drc_config* drc_config, ia_uni_drc_coeffs_struct** drc_coefficients_drc,
|
||||||
ia_uni_drc_coeffs_struct** drc_coefficients_drc,
|
WORD32* drc_coefficients_selected) {
|
||||||
WORD32* drc_coefficients_selected)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
WORD32 cof1 = -1;
|
WORD32 cof1 = -1;
|
||||||
WORD32 cof0 = -1;
|
WORD32 cof0 = -1;
|
||||||
for(i=0; i<drc_config->drc_coefficients_drc_count; i++)
|
for (i = 0; i < drc_config->drc_coefficients_drc_count; i++) {
|
||||||
{
|
if (drc_config->str_p_loc_drc_coefficients_uni_drc[i].drc_location == 1) {
|
||||||
if (drc_config->str_p_loc_drc_coefficients_uni_drc[i].drc_location == 1)
|
if (drc_config->str_p_loc_drc_coefficients_uni_drc[i].version == 0) {
|
||||||
{
|
|
||||||
if (drc_config->str_p_loc_drc_coefficients_uni_drc[i].version == 0)
|
|
||||||
{
|
|
||||||
cof0 = i;
|
cof0 = i;
|
||||||
*drc_coefficients_selected = cof0;
|
*drc_coefficients_selected = cof0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
cof1 = i;
|
cof1 = i;
|
||||||
*drc_coefficients_selected = cof1;
|
*drc_coefficients_selected = cof1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (cof1 >= 0) {
|
if (cof1 >= 0) {
|
||||||
*drc_coefficients_drc = &(drc_config->str_p_loc_drc_coefficients_uni_drc[cof1]);
|
*drc_coefficients_drc =
|
||||||
}
|
&(drc_config->str_p_loc_drc_coefficients_uni_drc[cof1]);
|
||||||
else if (cof0 >= 0) {
|
} else if (cof0 >= 0) {
|
||||||
*drc_coefficients_drc = &(drc_config->str_p_loc_drc_coefficients_uni_drc[cof0]);
|
*drc_coefficients_drc =
|
||||||
}
|
&(drc_config->str_p_loc_drc_coefficients_uni_drc[cof0]);
|
||||||
else {
|
} else {
|
||||||
*drc_coefficients_drc = NULL;
|
*drc_coefficients_drc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_init_selected_drc_set(
|
||||||
WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
ia_drc_config* drc_config, ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
|
||||||
ia_parametric_drc_params_struct* p_parametric_drc_params,
|
ia_parametric_drc_params_struct* p_parametric_drc_params,
|
||||||
WORD32 audio_num_chan,
|
WORD32 audio_num_chan, WORD32 drc_set_id_selected,
|
||||||
WORD32 drc_set_id_selected,
|
WORD32 downmix_id_selected, ia_filter_banks_struct* ia_filter_banks_struct,
|
||||||
WORD32 downmix_id_selected,
|
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
|
||||||
ia_overlap_params_struct* pstr_overlap_params
|
ia_overlap_params_struct* pstr_overlap_params
|
||||||
|
|
||||||
, shape_filter_block* shape_filter_block
|
,
|
||||||
)
|
shape_filter_block* shape_filter_block) {
|
||||||
{
|
|
||||||
WORD32 g, n, c, err = 0;
|
WORD32 g, n, c, err = 0;
|
||||||
WORD32 channel_count = 0;
|
WORD32 channel_count = 0;
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
@ -172,44 +147,36 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
WORD32 drc_coefficients_selected = -1;
|
WORD32 drc_coefficients_selected = -1;
|
||||||
p_parametric_drc_params->parametric_drc_instance_count = 0;
|
p_parametric_drc_params->parametric_drc_instance_count = 0;
|
||||||
|
|
||||||
if (drc_config->drc_coefficients_drc_count && drc_config->str_p_loc_drc_coefficients_uni_drc->drc_frame_size_present)
|
if (drc_config->drc_coefficients_drc_count &&
|
||||||
{
|
drc_config->str_p_loc_drc_coefficients_uni_drc->drc_frame_size_present) {
|
||||||
if (drc_config->str_p_loc_drc_coefficients_uni_drc->drc_frame_size != ia_drc_params_struct->drc_frame_size)
|
if (drc_config->str_p_loc_drc_coefficients_uni_drc->drc_frame_size !=
|
||||||
{
|
ia_drc_params_struct->drc_frame_size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (n = 0; n < drc_config->drc_instructions_count_plus; n++) {
|
||||||
for(n=0; n<drc_config->drc_instructions_count_plus; n++)
|
if (drc_config->str_drc_instruction_str[n].drc_set_id ==
|
||||||
{
|
drc_set_id_selected)
|
||||||
if (drc_config->str_drc_instruction_str[n].drc_set_id == drc_set_id_selected)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (n == drc_config->drc_instructions_count_plus)
|
if (n == drc_config->drc_instructions_count_plus) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
drc_instructions_selected = n;
|
drc_instructions_selected = n;
|
||||||
drc_instructions_uni_drc = &(drc_config->str_drc_instruction_str[drc_instructions_selected]);
|
drc_instructions_uni_drc =
|
||||||
|
&(drc_config->str_drc_instruction_str[drc_instructions_selected]);
|
||||||
|
|
||||||
if (downmix_id_selected == ID_FOR_BASE_LAYOUT)
|
if (downmix_id_selected == ID_FOR_BASE_LAYOUT) {
|
||||||
{
|
|
||||||
channel_count = drc_config->channel_layout.base_channel_count;
|
channel_count = drc_config->channel_layout.base_channel_count;
|
||||||
}
|
} else if (downmix_id_selected == ID_FOR_ANY_DOWNMIX) {
|
||||||
else if (downmix_id_selected == ID_FOR_ANY_DOWNMIX)
|
|
||||||
{
|
|
||||||
channel_count = audio_num_chan;
|
channel_count = audio_num_chan;
|
||||||
}
|
} else {
|
||||||
else
|
for (n = 0; n < drc_config->dwnmix_instructions_count; n++) {
|
||||||
{
|
|
||||||
for(n=0; n<drc_config->dwnmix_instructions_count; n++)
|
|
||||||
{
|
|
||||||
if (drc_config->dwnmix_instructions[n].downmix_id == downmix_id_selected)
|
if (drc_config->dwnmix_instructions[n].downmix_id == downmix_id_selected)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (n == drc_config->dwnmix_instructions_count)
|
if (n == drc_config->dwnmix_instructions_count) {
|
||||||
{
|
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
channel_count = drc_config->dwnmix_instructions[n].target_channel_count;
|
channel_count = drc_config->dwnmix_instructions[n].target_channel_count;
|
||||||
|
|
@ -218,155 +185,177 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
}
|
}
|
||||||
drc_instructions_uni_drc->audio_num_chan = channel_count;
|
drc_instructions_uni_drc->audio_num_chan = channel_count;
|
||||||
|
|
||||||
if (drc_instructions_uni_drc->drc_set_id <= 0)
|
if (drc_instructions_uni_drc->drc_set_id <= 0) {
|
||||||
{
|
|
||||||
drc_coefficients_selected = 0;
|
drc_coefficients_selected = 0;
|
||||||
}
|
} else {
|
||||||
else
|
err = impd_select_drc_coefficients(drc_config, &drc_coefficients_uni_drc,
|
||||||
{
|
&drc_coefficients_selected);
|
||||||
err = impd_select_drc_coefficients(drc_config, &drc_coefficients_uni_drc, &drc_coefficients_selected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter].drc_instructions_index = drc_instructions_selected;
|
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter]
|
||||||
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter].dwnmix_instructions_index = downmix_instructions_selected;
|
.drc_instructions_index = drc_instructions_selected;
|
||||||
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter].drc_coeff_idx = drc_coefficients_selected;
|
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter]
|
||||||
|
.dwnmix_instructions_index = downmix_instructions_selected;
|
||||||
|
ia_drc_params_struct->sel_drc_array[ia_drc_params_struct->drc_set_counter]
|
||||||
|
.drc_coeff_idx = drc_coefficients_selected;
|
||||||
|
|
||||||
if ((drc_instructions_uni_drc->downmix_id[0] == ID_FOR_ANY_DOWNMIX) || (drc_instructions_uni_drc->dwnmix_id_count > 1))
|
if ((drc_instructions_uni_drc->downmix_id[0] == ID_FOR_ANY_DOWNMIX) ||
|
||||||
{
|
(drc_instructions_uni_drc->dwnmix_id_count > 1)) {
|
||||||
WORD32 idx = drc_instructions_uni_drc->gain_set_index[0];
|
WORD32 idx = drc_instructions_uni_drc->gain_set_index[0];
|
||||||
for (c=0; c<drc_instructions_uni_drc->audio_num_chan; c++)
|
for (c = 0; c < drc_instructions_uni_drc->audio_num_chan; c++) {
|
||||||
{
|
|
||||||
drc_instructions_uni_drc->channel_group_of_ch[c] = (idx >= 0) ? 0 : -1;
|
drc_instructions_uni_drc->channel_group_of_ch[c] = (idx >= 0) ? 0 : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<drc_instructions_uni_drc->num_drc_ch_groups; g++) {
|
for (g = 0; g < drc_instructions_uni_drc->num_drc_ch_groups; g++) {
|
||||||
drc_instructions_uni_drc->num_chan_per_ch_group[g] = 0;
|
drc_instructions_uni_drc->num_chan_per_ch_group[g] = 0;
|
||||||
for (c=0; c<drc_instructions_uni_drc->audio_num_chan; c++) {
|
for (c = 0; c < drc_instructions_uni_drc->audio_num_chan; c++) {
|
||||||
if (drc_instructions_uni_drc->channel_group_of_ch[c] == g) {
|
if (drc_instructions_uni_drc->channel_group_of_ch[c] == g) {
|
||||||
drc_instructions_uni_drc->num_chan_per_ch_group[g]++;
|
drc_instructions_uni_drc->num_chan_per_ch_group[g]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drc_instructions_uni_drc->drc_set_effect & (EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) {
|
if (drc_instructions_uni_drc->drc_set_effect &
|
||||||
drc_instructions_uni_drc->multiband_audio_sig_count = drc_instructions_uni_drc->audio_num_chan;
|
(EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) {
|
||||||
|
drc_instructions_uni_drc->multiband_audio_sig_count =
|
||||||
|
drc_instructions_uni_drc->audio_num_chan;
|
||||||
} else {
|
} else {
|
||||||
drc_instructions_uni_drc->multiband_audio_sig_count = 0;
|
drc_instructions_uni_drc->multiband_audio_sig_count = 0;
|
||||||
for (c=0; c<drc_instructions_uni_drc->audio_num_chan; c++) {
|
for (c = 0; c < drc_instructions_uni_drc->audio_num_chan; c++) {
|
||||||
g = drc_instructions_uni_drc->channel_group_of_ch[c];
|
g = drc_instructions_uni_drc->channel_group_of_ch[c];
|
||||||
if (g < 0) {
|
if (g < 0) {
|
||||||
drc_instructions_uni_drc->multiband_audio_sig_count++;
|
drc_instructions_uni_drc->multiband_audio_sig_count++;
|
||||||
} else {
|
} else {
|
||||||
drc_instructions_uni_drc->multiband_audio_sig_count += drc_instructions_uni_drc->band_count_of_ch_group[g];
|
drc_instructions_uni_drc->multiband_audio_sig_count +=
|
||||||
|
drc_instructions_uni_drc->band_count_of_ch_group[g];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<drc_instructions_uni_drc->num_drc_ch_groups; g++)
|
for (g = 0; g < drc_instructions_uni_drc->num_drc_ch_groups; g++) {
|
||||||
{
|
if (g == 0) {
|
||||||
if (g==0) {
|
|
||||||
drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max = 0;
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max = 0;
|
||||||
}
|
}
|
||||||
if (drc_instructions_uni_drc->ch_group_parametric_drc_flag[g] == 0) {
|
if (drc_instructions_uni_drc->ch_group_parametric_drc_flag[g] == 0) {
|
||||||
if (drc_instructions_uni_drc->band_count_of_ch_group[g] > 1)
|
if (drc_instructions_uni_drc->band_count_of_ch_group[g] > 1) {
|
||||||
{
|
if (ia_drc_params_struct->multiband_sel_drc_idx != -1) {
|
||||||
if (ia_drc_params_struct->multiband_sel_drc_idx != -1)
|
|
||||||
{
|
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
selected_drc_is_multiband = 1;
|
selected_drc_is_multiband = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WORD32 gain_set_index = drc_instructions_uni_drc->gain_set_idx_of_ch_group_parametric_drc[g];
|
WORD32 gain_set_index =
|
||||||
WORD32 parametric_drc_id = drc_config->str_drc_config_ext.str_drc_coeff_param_drc.str_parametric_drc_gain_set_params[gain_set_index].parametric_drc_id;
|
drc_instructions_uni_drc->gain_set_idx_of_ch_group_parametric_drc[g];
|
||||||
|
WORD32 parametric_drc_id =
|
||||||
|
drc_config->str_drc_config_ext.str_drc_coeff_param_drc
|
||||||
|
.str_parametric_drc_gain_set_params[gain_set_index]
|
||||||
|
.parametric_drc_id;
|
||||||
WORD32 parametric_drc_look_ahead_samples = 0;
|
WORD32 parametric_drc_look_ahead_samples = 0;
|
||||||
ia_parametric_drc_instructions_struct* str_parametric_drc_instructions;
|
ia_parametric_drc_instructions_struct* str_parametric_drc_instructions;
|
||||||
|
|
||||||
for(i=0; i<drc_config->str_drc_config_ext.parametric_drc_instructions_count; i++)
|
for (i = 0;
|
||||||
{
|
i < drc_config->str_drc_config_ext.parametric_drc_instructions_count;
|
||||||
if (parametric_drc_id == drc_config->str_drc_config_ext.str_parametric_drc_instructions[i].parametric_drc_id) break;
|
i++) {
|
||||||
|
if (parametric_drc_id ==
|
||||||
|
drc_config->str_drc_config_ext.str_parametric_drc_instructions[i]
|
||||||
|
.parametric_drc_id)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (i == drc_config->str_drc_config_ext.parametric_drc_instructions_count)
|
if (i ==
|
||||||
{
|
drc_config->str_drc_config_ext.parametric_drc_instructions_count) {
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
str_parametric_drc_instructions = &drc_config->str_drc_config_ext.str_parametric_drc_instructions[i];
|
str_parametric_drc_instructions =
|
||||||
|
&drc_config->str_drc_config_ext.str_parametric_drc_instructions[i];
|
||||||
|
|
||||||
p_parametric_drc_params->parametric_drc_idx[p_parametric_drc_params->parametric_drc_instance_count] = i;
|
p_parametric_drc_params->parametric_drc_idx
|
||||||
p_parametric_drc_params->gain_set_index[p_parametric_drc_params->parametric_drc_instance_count] = gain_set_index;
|
[p_parametric_drc_params->parametric_drc_instance_count] = i;
|
||||||
|
p_parametric_drc_params->gain_set_index
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count] =
|
||||||
|
gain_set_index;
|
||||||
if (drc_instructions_uni_drc->drc_apply_to_dwnmix == 0) {
|
if (drc_instructions_uni_drc->drc_apply_to_dwnmix == 0) {
|
||||||
p_parametric_drc_params->dwnmix_id_from_drc_instructions[p_parametric_drc_params->parametric_drc_instance_count] = ID_FOR_BASE_LAYOUT;
|
p_parametric_drc_params->dwnmix_id_from_drc_instructions
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count] =
|
||||||
|
ID_FOR_BASE_LAYOUT;
|
||||||
} else {
|
} else {
|
||||||
if (drc_instructions_uni_drc->dwnmix_id_count > 1) {
|
if (drc_instructions_uni_drc->dwnmix_id_count > 1) {
|
||||||
p_parametric_drc_params->dwnmix_id_from_drc_instructions[p_parametric_drc_params->parametric_drc_instance_count] = ID_FOR_ANY_DOWNMIX;
|
p_parametric_drc_params->dwnmix_id_from_drc_instructions
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count] =
|
||||||
|
ID_FOR_ANY_DOWNMIX;
|
||||||
} else {
|
} else {
|
||||||
p_parametric_drc_params->dwnmix_id_from_drc_instructions[p_parametric_drc_params->parametric_drc_instance_count] = drc_instructions_uni_drc->downmix_id[0];
|
p_parametric_drc_params->dwnmix_id_from_drc_instructions
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count] =
|
||||||
|
drc_instructions_uni_drc->downmix_id[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p_parametric_drc_params->audio_num_chan = channel_count;
|
p_parametric_drc_params->audio_num_chan = channel_count;
|
||||||
for (i=0; i<p_parametric_drc_params->audio_num_chan;i++) {
|
for (i = 0; i < p_parametric_drc_params->audio_num_chan; i++) {
|
||||||
if (drc_instructions_uni_drc->channel_group_of_ch[i] == g) {
|
if (drc_instructions_uni_drc->channel_group_of_ch[i] == g) {
|
||||||
p_parametric_drc_params->channel_map[p_parametric_drc_params->parametric_drc_instance_count][i] = 1;
|
p_parametric_drc_params->channel_map
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count][i] = 1;
|
||||||
} else {
|
} else {
|
||||||
p_parametric_drc_params->channel_map[p_parametric_drc_params->parametric_drc_instance_count][i] = 0;
|
p_parametric_drc_params->channel_map
|
||||||
|
[p_parametric_drc_params->parametric_drc_instance_count][i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g] = 0;
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g] = 0;
|
||||||
if (str_parametric_drc_instructions->parametric_drc_look_ahead_flag) {
|
if (str_parametric_drc_instructions->parametric_drc_look_ahead_flag) {
|
||||||
parametric_drc_look_ahead_samples = (WORD32)((FLOAT32)str_parametric_drc_instructions->parametric_drc_look_ahead*(FLOAT32)p_parametric_drc_params->sampling_rate*0.001f);
|
parametric_drc_look_ahead_samples = (WORD32)(
|
||||||
|
(FLOAT32)
|
||||||
|
str_parametric_drc_instructions->parametric_drc_look_ahead *
|
||||||
|
(FLOAT32)p_parametric_drc_params->sampling_rate * 0.001f);
|
||||||
|
} else {
|
||||||
|
if (str_parametric_drc_instructions->parametric_drc_type ==
|
||||||
|
PARAM_DRC_TYPE_FF) {
|
||||||
|
parametric_drc_look_ahead_samples = (WORD32)(
|
||||||
|
10.0f * (FLOAT32)p_parametric_drc_params->sampling_rate * 0.001f);
|
||||||
|
} else if (str_parametric_drc_instructions->parametric_drc_type ==
|
||||||
|
PARAM_DRC_TYPE_LIM) {
|
||||||
|
parametric_drc_look_ahead_samples = (WORD32)(
|
||||||
|
5.0f * (FLOAT32)p_parametric_drc_params->sampling_rate * 0.001f);
|
||||||
} else {
|
} else {
|
||||||
if (str_parametric_drc_instructions->parametric_drc_type == PARAM_DRC_TYPE_FF)
|
|
||||||
{
|
|
||||||
parametric_drc_look_ahead_samples = (WORD32)(10.0f*(FLOAT32)p_parametric_drc_params->sampling_rate*0.001f);
|
|
||||||
}
|
|
||||||
else if (str_parametric_drc_instructions->parametric_drc_type == PARAM_DRC_TYPE_LIM)
|
|
||||||
{
|
|
||||||
parametric_drc_look_ahead_samples = (WORD32)(5.0f*(FLOAT32)p_parametric_drc_params->sampling_rate*0.001f);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g] = parametric_drc_look_ahead_samples;
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g] =
|
||||||
if (drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max < drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g])
|
parametric_drc_look_ahead_samples;
|
||||||
{
|
if (drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max <
|
||||||
drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max = drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g];
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g]) {
|
||||||
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max =
|
||||||
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples[g];
|
||||||
}
|
}
|
||||||
p_parametric_drc_params->parametric_drc_instance_count += 1;
|
p_parametric_drc_params->parametric_drc_instance_count += 1;
|
||||||
selected_drc_is_multiband = 0;
|
selected_drc_is_multiband = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ia_drc_params_struct->parametric_drc_delay += drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max;
|
ia_drc_params_struct->parametric_drc_delay +=
|
||||||
|
drc_instructions_uni_drc->parametric_drc_look_ahead_samples_max;
|
||||||
|
|
||||||
if (selected_drc_is_multiband == 1)
|
if (selected_drc_is_multiband == 1) {
|
||||||
{
|
ia_drc_params_struct->multiband_sel_drc_idx =
|
||||||
ia_drc_params_struct->multiband_sel_drc_idx = ia_drc_params_struct->drc_set_counter;
|
ia_drc_params_struct->drc_set_counter;
|
||||||
err = impd_init_all_filter_banks(drc_coefficients_uni_drc,
|
err = impd_init_all_filter_banks(
|
||||||
|
drc_coefficients_uni_drc,
|
||||||
&(drc_config->str_drc_instruction_str[drc_instructions_selected]),
|
&(drc_config->str_drc_instruction_str[drc_instructions_selected]),
|
||||||
ia_filter_banks_struct);
|
ia_filter_banks_struct);
|
||||||
if (err)
|
if (err) return (err);
|
||||||
return (err);
|
|
||||||
|
|
||||||
err = impd_init_overlap_weight (drc_coefficients_uni_drc,
|
err = impd_init_overlap_weight(
|
||||||
|
drc_coefficients_uni_drc,
|
||||||
&(drc_config->str_drc_instruction_str[drc_instructions_selected]),
|
&(drc_config->str_drc_instruction_str[drc_instructions_selected]),
|
||||||
ia_drc_params_struct->sub_band_domain_mode,
|
ia_drc_params_struct->sub_band_domain_mode, pstr_overlap_params);
|
||||||
pstr_overlap_params);
|
if (err) return (err);
|
||||||
if (err)
|
} else {
|
||||||
return (err);
|
ia_gain_modifiers_struct* gain_modifiers =
|
||||||
}
|
drc_config->str_drc_instruction_str->str_gain_modifiers_of_ch_group;
|
||||||
else
|
for (g = 0; g < drc_instructions_uni_drc->num_drc_ch_groups; g++) {
|
||||||
{
|
if (gain_modifiers[g].shape_filter_flag == 1) {
|
||||||
ia_gain_modifiers_struct* gain_modifiers = drc_config->str_drc_instruction_str->str_gain_modifiers_of_ch_group;
|
impd_shape_filt_block_init(
|
||||||
for (g=0; g<drc_instructions_uni_drc->num_drc_ch_groups; g++)
|
&drc_coefficients_uni_drc->str_shape_filter_block_params
|
||||||
{
|
[gain_modifiers[g].shape_filter_idx],
|
||||||
if (gain_modifiers[g].shape_filter_flag == 1)
|
|
||||||
{
|
|
||||||
impd_shape_filt_block_init(&drc_coefficients_uni_drc->str_shape_filter_block_params[gain_modifiers[g].shape_filter_idx],
|
|
||||||
&shape_filter_block[g]);
|
&shape_filter_block[g]);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
shape_filter_block[g].shape_flter_block_flag = 0;
|
shape_filter_block[g].shape_flter_block_flag = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,35 +20,28 @@
|
||||||
#ifndef IMPD_DRC_DEC_H
|
#ifndef IMPD_DRC_DEC_H
|
||||||
#define IMPD_DRC_DEC_H
|
#define IMPD_DRC_DEC_H
|
||||||
|
|
||||||
WORD32 impd_init_drc_params(WORD32 frame_size,
|
WORD32 impd_init_drc_params(WORD32 frame_size, WORD32 sample_rate,
|
||||||
WORD32 sample_rate,
|
WORD32 gain_delay_samples, WORD32 delay_mode,
|
||||||
WORD32 gain_delay_samples,
|
|
||||||
WORD32 delay_mode,
|
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_drc_params_struct* ia_drc_params_struct);
|
ia_drc_params_struct* ia_drc_params_struct);
|
||||||
|
|
||||||
|
WORD32 impd_init_selected_drc_set(
|
||||||
WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
ia_drc_config* drc_config, ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
|
||||||
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
||||||
WORD32 audio_num_chan,
|
WORD32 audio_num_chan, WORD32 drc_set_id_selected,
|
||||||
WORD32 drc_set_id_selected,
|
WORD32 downmix_id_selected, ia_filter_banks_struct* ia_filter_banks_struct,
|
||||||
WORD32 downmix_id_selected,
|
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
|
||||||
ia_overlap_params_struct* pstr_overlap_params
|
ia_overlap_params_struct* pstr_overlap_params
|
||||||
|
|
||||||
, shape_filter_block* shape_filter_block
|
,
|
||||||
);
|
shape_filter_block* shape_filter_block);
|
||||||
|
|
||||||
WORD32 impd_apply_gains_and_add(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
WORD32 impd_apply_gains_and_add(
|
||||||
|
ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_gain_buffer_struct* pstr_gain_buf,
|
ia_gain_buffer_struct* pstr_gain_buf,
|
||||||
shape_filter_block shape_filter_block[],
|
shape_filter_block shape_filter_block[], FLOAT32* deinterleaved_audio[],
|
||||||
FLOAT32* deinterleaved_audio[],
|
|
||||||
|
|
||||||
FLOAT32* channel_audio[],
|
|
||||||
WORD32 impd_apply_gains);
|
|
||||||
|
|
||||||
|
FLOAT32* channel_audio[], WORD32 impd_apply_gains);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,12 @@
|
||||||
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IMPD_DRC_DEFINITIONS_H
|
#ifndef IMPD_DRC_DEFINITIONS_H
|
||||||
#define IMPD_DRC_DEFINITIONS_H
|
#define IMPD_DRC_DEFINITIONS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define LIBNAME "IA_DRC"
|
#define LIBNAME "IA_DRC"
|
||||||
#define LIB_APIVERSION 1
|
#define LIB_APIVERSION 1
|
||||||
|
|
||||||
|
|
||||||
#define IA_DRC_PERSIST_IDX (0)
|
#define IA_DRC_PERSIST_IDX (0)
|
||||||
#define IA_DRC_SCRATCH_IDX (1)
|
#define IA_DRC_SCRATCH_IDX (1)
|
||||||
#define IA_DRC_INPUT_IDX (2)
|
#define IA_DRC_INPUT_IDX (2)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -35,16 +35,13 @@
|
||||||
#define MATCHING_PHASE_FILTER_COUNT_MAX 32
|
#define MATCHING_PHASE_FILTER_COUNT_MAX 32
|
||||||
|
|
||||||
#define EQ_FILTER_DOMAIN_NONE 0
|
#define EQ_FILTER_DOMAIN_NONE 0
|
||||||
#define EQ_FILTER_DOMAIN_TIME (1<<0)
|
#define EQ_FILTER_DOMAIN_TIME (1 << 0)
|
||||||
#define EQ_FILTER_DOMAIN_SUBBAND (1<<1)
|
#define EQ_FILTER_DOMAIN_SUBBAND (1 << 1)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 delay;
|
WORD32 delay;
|
||||||
FLOAT32 state[EQ_CHANNEL_COUNT_MAX][EQ_AUDIO_DELAY_MAX];
|
FLOAT32 state[EQ_CHANNEL_COUNT_MAX][EQ_AUDIO_DELAY_MAX];
|
||||||
|
|
@ -70,16 +67,19 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 filter_format;
|
WORD32 filter_format;
|
||||||
WORD32 filter_param_count_of_zeros;
|
WORD32 filter_param_count_of_zeros;
|
||||||
ia_2nd_order_filt_params_struct ord_2_filt_params_of_zeros[EQ_INTERMEDIATE_2ND_ORDER_PARAMS_COUNT_MAX];
|
ia_2nd_order_filt_params_struct
|
||||||
|
ord_2_filt_params_of_zeros[EQ_INTERMEDIATE_2ND_ORDER_PARAMS_COUNT_MAX];
|
||||||
WORD32 filter_param_count_of_poles;
|
WORD32 filter_param_count_of_poles;
|
||||||
ia_2nd_order_filt_params_struct ord_2_filt_params_of_poles[EQ_INTERMEDIATE_2ND_ORDER_PARAMS_COUNT_MAX];
|
ia_2nd_order_filt_params_struct
|
||||||
|
ord_2_filt_params_of_poles[EQ_INTERMEDIATE_2ND_ORDER_PARAMS_COUNT_MAX];
|
||||||
WORD32 filter_param_count_of_fir;
|
WORD32 filter_param_count_of_fir;
|
||||||
ia_fir_filter_struct fir_filter;
|
ia_fir_filter_struct fir_filter;
|
||||||
} ia_interm_filt_params_struct;
|
} ia_interm_filt_params_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 interm_filt_param_count;
|
WORD32 interm_filt_param_count;
|
||||||
ia_interm_filt_params_struct interm_filt_params[EQ_INTERMEDIATE_PARAMETER_COUNT_MAX];
|
ia_interm_filt_params_struct
|
||||||
|
interm_filt_params[EQ_INTERMEDIATE_PARAMETER_COUNT_MAX];
|
||||||
} IntermediateParams;
|
} IntermediateParams;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -148,7 +148,8 @@ typedef struct {
|
||||||
WORD32 block_count;
|
WORD32 block_count;
|
||||||
ia_eq_filt_block_struct pstr_eq_filt_block[EQ_FILTER_BLOCK_COUNT_MAX];
|
ia_eq_filt_block_struct pstr_eq_filt_block[EQ_FILTER_BLOCK_COUNT_MAX];
|
||||||
WORD32 num_ph_align_filt;
|
WORD32 num_ph_align_filt;
|
||||||
ia_ph_alignment_filt_struct ph_alignment_filt[EQ_FILTER_BLOCK_COUNT_MAX * EQ_FILTER_BLOCK_COUNT_MAX];
|
ia_ph_alignment_filt_struct
|
||||||
|
ph_alignment_filt[EQ_FILTER_BLOCK_COUNT_MAX * EQ_FILTER_BLOCK_COUNT_MAX];
|
||||||
} ia_filt_cascade_td_struct;
|
} ia_filt_cascade_td_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -160,36 +161,25 @@ typedef struct {
|
||||||
ia_subband_filt_struct subband_filt[EQ_CHANNEL_GROUP_COUNT_MAX];
|
ia_subband_filt_struct subband_filt[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
} ia_eq_set_struct;
|
} ia_eq_set_struct;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_derive_eq_set (ia_eq_coeff_struct* str_eq_coeff,
|
impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
ia_eq_instructions_struct* str_eq_instructions,
|
ia_eq_instructions_struct* str_eq_instructions,
|
||||||
FLOAT32 sample_rate,
|
FLOAT32 sample_rate, WORD32 drc_frame_size,
|
||||||
WORD32 drc_frame_size,
|
WORD32 sub_band_domain_mode, ia_eq_set_struct* eq_set);
|
||||||
WORD32 sub_band_domain_mode,
|
|
||||||
ia_eq_set_struct* eq_set);
|
|
||||||
|
|
||||||
VOID impd_get_eq_set_delay (ia_eq_set_struct* eq_set,
|
VOID impd_get_eq_set_delay(ia_eq_set_struct* eq_set, WORD32* cascade_delay);
|
||||||
WORD32* cascade_delay);
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_process_eq_set_td(ia_eq_set_struct* eq_set,
|
impd_process_eq_set_td(ia_eq_set_struct* eq_set, WORD32 channel,
|
||||||
WORD32 channel,
|
FLOAT32 audio_in, FLOAT32* audio_out);
|
||||||
FLOAT32 audio_in,
|
|
||||||
FLOAT32* audio_out);
|
|
||||||
|
|
||||||
WORD32 impd_process_eq_set_time_domain(ia_eq_set_struct* eq_set,
|
WORD32 impd_process_eq_set_time_domain(ia_eq_set_struct* eq_set, WORD32 channel,
|
||||||
WORD32 channel,
|
FLOAT32* audio_in, FLOAT32* audio_out,
|
||||||
FLOAT32 *audio_in,
|
|
||||||
FLOAT32 *audio_out,
|
|
||||||
WORD32 frame_size);
|
WORD32 frame_size);
|
||||||
WORD32
|
WORD32
|
||||||
impd_process_eq_set_subband_domain(ia_eq_set_struct* eq_set,
|
impd_process_eq_set_subband_domain(ia_eq_set_struct* eq_set, WORD32 channel,
|
||||||
WORD32 channel,
|
|
||||||
FLOAT32* subbandSampleIn,
|
FLOAT32* subbandSampleIn,
|
||||||
FLOAT32* subbandSampleOut);
|
FLOAT32* subbandSampleOut);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IMPD_DRC_ERROR_CODES_H
|
#ifndef IMPD_DRC_ERROR_CODES_H
|
||||||
#define IMPD_DRC_ERROR_CODES_H
|
#define IMPD_DRC_ERROR_CODES_H
|
||||||
|
|
||||||
|
|
@ -30,7 +29,6 @@
|
||||||
#define IA_DRC_DEC_API_NONFATAL_CMD_NOT_SUPPORTED 0x00000001
|
#define IA_DRC_DEC_API_NONFATAL_CMD_NOT_SUPPORTED 0x00000001
|
||||||
#define IA_DRC_DEC_API_NONFATAL_CMD_TYPE_NOT_SUPPORTED 0x00000002
|
#define IA_DRC_DEC_API_NONFATAL_CMD_TYPE_NOT_SUPPORTED 0x00000002
|
||||||
|
|
||||||
|
|
||||||
/*API Fatal Errors */
|
/*API Fatal Errors */
|
||||||
#define IA_DRC_DEC_API_FATAL_INVALID_MEMTAB_INDEX 0xFFFF8000
|
#define IA_DRC_DEC_API_FATAL_INVALID_MEMTAB_INDEX 0xFFFF8000
|
||||||
#define IA_DRC_DEC_API_FATAL_INVALID_LIB_ID_STRINGS_IDX 0xFFFF8001
|
#define IA_DRC_DEC_API_FATAL_INVALID_LIB_ID_STRINGS_IDX 0xFFFF8001
|
||||||
|
|
@ -43,7 +41,6 @@
|
||||||
/* Class 1: Configuration Errors */
|
/* Class 1: Configuration Errors */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Non Fatal Errors */
|
/* Non Fatal Errors */
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_NUM_OF_CHANNELS 0x00000800
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_NUM_OF_CHANNELS 0x00000800
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_SAMP_FREQ 0x00000801
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_SAMP_FREQ 0x00000801
|
||||||
|
|
|
||||||
|
|
@ -28,40 +28,32 @@
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
WORD32 impd_init_tbls(const WORD32 num_gain_max_values,
|
WORD32 impd_init_tbls(const WORD32 num_gain_max_values,
|
||||||
ia_tables_struct* str_tables)
|
ia_tables_struct* str_tables) {
|
||||||
{
|
impd_gen_delta_time_code_tbl(num_gain_max_values,
|
||||||
impd_gen_delta_time_code_tbl (num_gain_max_values,
|
|
||||||
str_tables->delta_time_code_table);
|
str_tables->delta_time_code_table);
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void impd_get_delta_gain_code_tbl(
|
||||||
void
|
const WORD32 gain_coding_profile,
|
||||||
impd_get_delta_gain_code_tbl(const WORD32 gain_coding_profile,
|
|
||||||
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
||||||
WORD32 *num_entries)
|
WORD32* num_entries) {
|
||||||
{
|
if (gain_coding_profile == GAIN_CODING_PROFILE_CLIPPING) {
|
||||||
if (gain_coding_profile==GAIN_CODING_PROFILE_CLIPPING)
|
|
||||||
{
|
|
||||||
*delta_time_code_tbl = ia_drc_gain_tbls_prof_2;
|
*delta_time_code_tbl = ia_drc_gain_tbls_prof_2;
|
||||||
*num_entries = NUM_GAIN_TBL_PROF_2_ENTRIES;
|
*num_entries = NUM_GAIN_TBL_PROF_2_ENTRIES;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
*delta_time_code_tbl = ia_drc_gain_tbls_prof_0_1;
|
*delta_time_code_tbl = ia_drc_gain_tbls_prof_0_1;
|
||||||
*num_entries = NUM_GAIN_TBL_PROF_0_1_ENTRIES;
|
*num_entries = NUM_GAIN_TBL_PROF_0_1_ENTRIES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void impd_gen_delta_time_code_tbl(
|
||||||
impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
const WORD32 num_gain_max_values,
|
||||||
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item)
|
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item) {
|
||||||
{
|
|
||||||
WORD32 n, k;
|
WORD32 n, k;
|
||||||
|
|
||||||
WORD32 Z = 1;
|
WORD32 Z = 1;
|
||||||
while((1<<Z)<2*num_gain_max_values)
|
while ((1 << Z) < 2 * num_gain_max_values) {
|
||||||
{
|
|
||||||
Z++;
|
Z++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,42 +64,32 @@ impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
||||||
delta_time_code_tbl_item[1].size = 2;
|
delta_time_code_tbl_item[1].size = 2;
|
||||||
delta_time_code_tbl_item[1].code = 0x0;
|
delta_time_code_tbl_item[1].code = 0x0;
|
||||||
delta_time_code_tbl_item[1].value = 1;
|
delta_time_code_tbl_item[1].value = 1;
|
||||||
for (n=0; n<4; n++)
|
for (n = 0; n < 4; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 2].size = 4;
|
||||||
delta_time_code_tbl_item[n+2].size = 4;
|
delta_time_code_tbl_item[n + 2].code = 0x4 + n;
|
||||||
delta_time_code_tbl_item[n+2].code = 0x4 + n;
|
delta_time_code_tbl_item[n + 2].value = n + 2;
|
||||||
delta_time_code_tbl_item[n+2].value = n+2;
|
|
||||||
}
|
}
|
||||||
for (n=0; n<8; n++)
|
for (n = 0; n < 8; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 6].size = 5;
|
||||||
delta_time_code_tbl_item[n+6].size = 5;
|
delta_time_code_tbl_item[n + 6].code = 0x10 + n;
|
||||||
delta_time_code_tbl_item[n+6].code = 0x10 + n;
|
delta_time_code_tbl_item[n + 6].value = n + 6;
|
||||||
delta_time_code_tbl_item[n+6].value = n+6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
k = 2*num_gain_max_values-14+1;
|
k = 2 * num_gain_max_values - 14 + 1;
|
||||||
for (n=0; n<k; n++)
|
for (n = 0; n < k; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 14].size = 2 + Z;
|
||||||
delta_time_code_tbl_item[n+14].size = 2+Z;
|
delta_time_code_tbl_item[n + 14].code = (0x3 << Z) + n;
|
||||||
delta_time_code_tbl_item[n+14].code = (0x3<<Z) + n;
|
delta_time_code_tbl_item[n + 14].value = n + 14;
|
||||||
delta_time_code_tbl_item[n+14].value = n+14;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_delta_tmin (const WORD32 sampling_rate)
|
impd_get_delta_tmin(const WORD32 sampling_rate) {
|
||||||
{
|
WORD32 lowerBound = (WORD32)(0.5f + 0.0005f * sampling_rate);
|
||||||
WORD32 lowerBound = (WORD32) (0.5f + 0.0005f * sampling_rate);
|
|
||||||
WORD32 result = 1;
|
WORD32 result = 1;
|
||||||
if (sampling_rate < 1000)
|
if (sampling_rate < 1000) {
|
||||||
{
|
return (UNEXPECTED_ERROR);
|
||||||
return(UNEXPECTED_ERROR);
|
|
||||||
}
|
}
|
||||||
while (result <= lowerBound) result = result << 1;
|
while (result <= lowerBound) result = result << 1;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,10 @@
|
||||||
#define IMPD_DRC_TABLES_H
|
#define IMPD_DRC_TABLES_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX (512+14)
|
#define N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX (512 + 14)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 size;
|
WORD32 size;
|
||||||
|
|
@ -47,7 +46,8 @@ typedef struct {
|
||||||
} ia_delta_gain_code_table_struct;
|
} ia_delta_gain_code_table_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_delta_time_code_table_entry_struct delta_time_code_table[N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX];
|
ia_delta_time_code_table_entry_struct
|
||||||
|
delta_time_code_table[N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX];
|
||||||
} ia_tables_struct;
|
} ia_tables_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -67,20 +67,19 @@ typedef struct {
|
||||||
} ia_cicp_node_characteristic_param;
|
} ia_cicp_node_characteristic_param;
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_tbls(const WORD32 num_gain_max_values,
|
impd_init_tbls(const WORD32 num_gain_max_values, ia_tables_struct* str_tables);
|
||||||
ia_tables_struct* str_tables);
|
|
||||||
|
|
||||||
void
|
void impd_gen_delta_time_code_tbl(
|
||||||
impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
const WORD32 num_gain_max_values,
|
||||||
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item);
|
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item);
|
||||||
|
|
||||||
void
|
void impd_get_delta_gain_code_tbl(
|
||||||
impd_get_delta_gain_code_tbl(const WORD32 gain_coding_profile,
|
const WORD32 gain_coding_profile,
|
||||||
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
||||||
WORD32 *num_entries);
|
WORD32* num_entries);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_delta_tmin (const WORD32 sampling_rate);
|
impd_get_delta_tmin(const WORD32 sampling_rate);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,11 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff,
|
ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_ap_filt_coeff,
|
ia_iir_filter_struct* pstr_ap_filt_coeff,
|
||||||
WORD32 filter_type)
|
WORD32 filter_type) {
|
||||||
{
|
|
||||||
FLOAT32 gamma = normal_cross_freq[crossover_freq_idx].gamma;
|
FLOAT32 gamma = normal_cross_freq[crossover_freq_idx].gamma;
|
||||||
FLOAT32 delta = normal_cross_freq[crossover_freq_idx].delta;
|
FLOAT32 delta = normal_cross_freq[crossover_freq_idx].delta;
|
||||||
|
|
||||||
if(filter_type==0||filter_type==2){
|
if (filter_type == 0 || filter_type == 2) {
|
||||||
pstr_lp_filt_coeff->a0 = 1.0f;
|
pstr_lp_filt_coeff->a0 = 1.0f;
|
||||||
pstr_lp_filt_coeff->a1 = 2.0f * (gamma - delta);
|
pstr_lp_filt_coeff->a1 = 2.0f * (gamma - delta);
|
||||||
pstr_lp_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
pstr_lp_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
||||||
|
|
@ -49,14 +48,16 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
pstr_hp_filt_coeff->a1 = pstr_lp_filt_coeff->a1;
|
pstr_hp_filt_coeff->a1 = pstr_lp_filt_coeff->a1;
|
||||||
pstr_hp_filt_coeff->a2 = pstr_lp_filt_coeff->a2;
|
pstr_hp_filt_coeff->a2 = pstr_lp_filt_coeff->a2;
|
||||||
pstr_hp_filt_coeff->b0 = delta;
|
pstr_hp_filt_coeff->b0 = delta;
|
||||||
pstr_hp_filt_coeff->b1 = - 2.0f * delta;
|
pstr_hp_filt_coeff->b1 = -2.0f * delta;
|
||||||
pstr_hp_filt_coeff->b2 = delta;
|
pstr_hp_filt_coeff->b2 = delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(filter_type==1||filter_type==2){
|
if (filter_type == 1 || filter_type == 2) {
|
||||||
pstr_ap_filt_coeff->a0 = 1.0f;
|
pstr_ap_filt_coeff->a0 = 1.0f;
|
||||||
pstr_ap_filt_coeff->a1 = 2.0f * (gamma - delta);;
|
pstr_ap_filt_coeff->a1 = 2.0f * (gamma - delta);
|
||||||
pstr_ap_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;;
|
;
|
||||||
|
pstr_ap_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
||||||
|
;
|
||||||
pstr_ap_filt_coeff->b0 = pstr_ap_filt_coeff->a2;
|
pstr_ap_filt_coeff->b0 = pstr_ap_filt_coeff->a2;
|
||||||
pstr_ap_filt_coeff->b1 = pstr_ap_filt_coeff->a1;
|
pstr_ap_filt_coeff->b1 = pstr_ap_filt_coeff->a1;
|
||||||
pstr_ap_filt_coeff->b2 = pstr_ap_filt_coeff->a0;
|
pstr_ap_filt_coeff->b2 = pstr_ap_filt_coeff->a0;
|
||||||
|
|
@ -67,42 +68,34 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
|
|
||||||
WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
||||||
ia_gain_params_struct* gain_params,
|
ia_gain_params_struct* gain_params,
|
||||||
ia_drc_filter_bank_struct* drc_filter_bank)
|
ia_drc_filter_bank_struct* drc_filter_bank) {
|
||||||
{
|
|
||||||
ia_two_band_filt_struct* str_two_band_bank;
|
ia_two_band_filt_struct* str_two_band_bank;
|
||||||
ia_three_band_filt_struct* str_three_band_bank;
|
ia_three_band_filt_struct* str_three_band_bank;
|
||||||
ia_four_band_filt_struct* str_four_band_bank;
|
ia_four_band_filt_struct* str_four_band_bank;
|
||||||
drc_filter_bank->complexity = 0;
|
drc_filter_bank->complexity = 0;
|
||||||
drc_filter_bank->num_bands = num_sub_bands;
|
drc_filter_bank->num_bands = num_sub_bands;
|
||||||
|
|
||||||
|
if (num_sub_bands == 1) {
|
||||||
if(num_sub_bands==1){
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (num_sub_bands == 2) {
|
||||||
else if(num_sub_bands==2){
|
|
||||||
str_two_band_bank = &drc_filter_bank->str_two_band_bank;
|
str_two_band_bank = &drc_filter_bank->str_two_band_bank;
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
&(str_two_band_bank->low_pass),
|
&(str_two_band_bank->low_pass),
|
||||||
&(str_two_band_bank->high_pass),
|
&(str_two_band_bank->high_pass), NULL, 0);
|
||||||
NULL,
|
} else if (num_sub_bands == 3) {
|
||||||
0);
|
|
||||||
}
|
|
||||||
else if(num_sub_bands==3){
|
|
||||||
str_three_band_bank = &drc_filter_bank->str_three_band_bank;
|
str_three_band_bank = &drc_filter_bank->str_three_band_bank;
|
||||||
|
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
&(str_three_band_bank->str_low_pass_stage_2),
|
&(str_three_band_bank->str_low_pass_stage_2),
|
||||||
&(str_three_band_bank->str_high_pass_stage_2),
|
&(str_three_band_bank->str_high_pass_stage_2),
|
||||||
&(str_three_band_bank->str_all_pass_stage_2),
|
&(str_three_band_bank->str_all_pass_stage_2), 2);
|
||||||
2);
|
|
||||||
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
||||||
&(str_three_band_bank->str_low_pass_stage_1),
|
&(str_three_band_bank->str_low_pass_stage_1),
|
||||||
&(str_three_band_bank->str_high_pass_stage_1),
|
&(str_three_band_bank->str_high_pass_stage_1), NULL,
|
||||||
NULL,
|
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(num_sub_bands==4){
|
else if (num_sub_bands == 4) {
|
||||||
str_four_band_bank = &drc_filter_bank->str_four_band_bank;
|
str_four_band_bank = &drc_filter_bank->str_four_band_bank;
|
||||||
|
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
|
|
@ -112,119 +105,112 @@ WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
||||||
2);
|
2);
|
||||||
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
||||||
&(str_four_band_bank->str_low_pass_stage_1),
|
&(str_four_band_bank->str_low_pass_stage_1),
|
||||||
&(str_four_band_bank->str_high_pass_stage_1),
|
&(str_four_band_bank->str_high_pass_stage_1), NULL,
|
||||||
NULL,
|
|
||||||
0);
|
0);
|
||||||
impd_compute_filt_coeff(gain_params[3].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[3].crossover_freq_idx,
|
||||||
&(str_four_band_bank->str_low_pass_stage_3_high),
|
&(str_four_band_bank->str_low_pass_stage_3_high),
|
||||||
&(str_four_band_bank->str_high_pass_stage_3_high),
|
&(str_four_band_bank->str_high_pass_stage_3_high),
|
||||||
&(str_four_band_bank->str_all_pass_stage_2_low),
|
&(str_four_band_bank->str_all_pass_stage_2_low), 2);
|
||||||
2);
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
WORD32 impd_init_all_filter_banks(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct)
|
ia_filter_banks_struct* ia_filter_banks_struct) {
|
||||||
{
|
WORD32 err_code = 0;
|
||||||
WORD32 err_code=0;
|
WORD32 b, g, i, k, m, s, crossover_freq_idx, num_ch_in_groups,
|
||||||
WORD32 b, g, i, k, m, s , crossover_freq_idx, num_ch_in_groups, num_ph_align_ch_groups;
|
num_ph_align_ch_groups;
|
||||||
WORD32 match_found = 0, num_filter;
|
WORD32 match_found = 0, num_filter;
|
||||||
WORD32 cascade_cross_idx[CHANNEL_GROUP_COUNT_MAX+1][CHANNEL_GROUP_COUNT_MAX * 3];
|
WORD32 cascade_cross_idx[CHANNEL_GROUP_COUNT_MAX + 1]
|
||||||
|
[CHANNEL_GROUP_COUNT_MAX * 3];
|
||||||
WORD32 count[CHANNEL_GROUP_COUNT_MAX + 1];
|
WORD32 count[CHANNEL_GROUP_COUNT_MAX + 1];
|
||||||
|
|
||||||
num_ch_in_groups = 0;
|
num_ch_in_groups = 0;
|
||||||
num_ph_align_ch_groups = str_drc_instruction_str->num_drc_ch_groups;
|
num_ph_align_ch_groups = str_drc_instruction_str->num_drc_ch_groups;
|
||||||
|
|
||||||
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
|
||||||
{
|
|
||||||
num_ch_in_groups += str_drc_instruction_str->num_chan_per_ch_group[g];
|
num_ch_in_groups += str_drc_instruction_str->num_chan_per_ch_group[g];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_ch_in_groups < str_drc_instruction_str->audio_num_chan)
|
if (num_ch_in_groups < str_drc_instruction_str->audio_num_chan) {
|
||||||
{
|
|
||||||
num_ph_align_ch_groups++;
|
num_ph_align_ch_groups++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_filter_banks_struct->nfilter_banks = str_drc_instruction_str->num_drc_ch_groups;
|
ia_filter_banks_struct->nfilter_banks =
|
||||||
|
str_drc_instruction_str->num_drc_ch_groups;
|
||||||
ia_filter_banks_struct->num_ph_align_ch_groups = num_ph_align_ch_groups;
|
ia_filter_banks_struct->num_ph_align_ch_groups = num_ph_align_ch_groups;
|
||||||
|
|
||||||
if (str_p_loc_drc_coefficients_uni_drc == NULL)
|
if (str_p_loc_drc_coefficients_uni_drc == NULL) {
|
||||||
{
|
|
||||||
ia_filter_banks_struct->str_drc_filter_bank->num_bands = 1;
|
ia_filter_banks_struct->str_drc_filter_bank->num_bands = 1;
|
||||||
}
|
} else {
|
||||||
else
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
err_code = impd_initialize_filt_bank(
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
{
|
->gain_set_params[str_drc_instruction_str
|
||||||
err_code = impd_initialize_filt_bank(str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].band_count,
|
->gain_set_index_for_channel_group[g]]
|
||||||
str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].gain_params,
|
.band_count,
|
||||||
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
|
->gain_set_params[str_drc_instruction_str
|
||||||
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.gain_params,
|
||||||
&(ia_filter_banks_struct->str_drc_filter_bank[g]));
|
&(ia_filter_banks_struct->str_drc_filter_bank[g]));
|
||||||
if (err_code!=0)
|
if (err_code != 0) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<CHANNEL_GROUP_COUNT_MAX + 1; g++)
|
for (g = 0; g < CHANNEL_GROUP_COUNT_MAX + 1; g++) {
|
||||||
{
|
|
||||||
count[g] = 0;
|
count[g] = 0;
|
||||||
}
|
}
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
for (b = 1;
|
||||||
for (b=1; b<str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].band_count; b++)
|
b < str_p_loc_drc_coefficients_uni_drc
|
||||||
{
|
->gain_set_params[str_drc_instruction_str
|
||||||
crossover_freq_idx = str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].gain_params[b].crossover_freq_idx;
|
->gain_set_index_for_channel_group[g]]
|
||||||
for (k=0; k<num_ph_align_ch_groups; k++)
|
.band_count;
|
||||||
{
|
b++) {
|
||||||
if (k!=g)
|
crossover_freq_idx =
|
||||||
{
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
|
->gain_set_params[str_drc_instruction_str
|
||||||
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.gain_params[b]
|
||||||
|
.crossover_freq_idx;
|
||||||
|
for (k = 0; k < num_ph_align_ch_groups; k++) {
|
||||||
|
if (k != g) {
|
||||||
cascade_cross_idx[k][count[k]] = crossover_freq_idx;
|
cascade_cross_idx[k][count[k]] = crossover_freq_idx;
|
||||||
count[k]++;
|
count[k]++;
|
||||||
if (count[k] > CHANNEL_GROUP_COUNT_MAX * 3)
|
if (count[k] > CHANNEL_GROUP_COUNT_MAX * 3) {
|
||||||
{
|
return -1;
|
||||||
return -1 ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i=0;
|
i = 0;
|
||||||
while (i<count[0])
|
while (i < count[0]) {
|
||||||
{
|
|
||||||
crossover_freq_idx = cascade_cross_idx[0][i];
|
crossover_freq_idx = cascade_cross_idx[0][i];
|
||||||
match_found = 0;
|
match_found = 0;
|
||||||
for (g=1; g<num_ph_align_ch_groups; g++)
|
for (g = 1; g < num_ph_align_ch_groups; g++) {
|
||||||
{
|
|
||||||
match_found = 0;
|
match_found = 0;
|
||||||
for (k=0; k<count[g]; k++)
|
for (k = 0; k < count[g]; k++) {
|
||||||
{
|
if (cascade_cross_idx[g][k] == crossover_freq_idx) {
|
||||||
if (cascade_cross_idx[g][k] == crossover_freq_idx)
|
|
||||||
{
|
|
||||||
match_found = 1;
|
match_found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match_found == 0)
|
if (match_found == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (match_found == 1)
|
if (match_found == 1) {
|
||||||
{
|
for (g = 0; g < num_ph_align_ch_groups; g++) {
|
||||||
for (g=0; g<num_ph_align_ch_groups; g++)
|
for (m = 0; m < count[g]; m++) {
|
||||||
{
|
if (cascade_cross_idx[g][m] == crossover_freq_idx) {
|
||||||
for (m=0; m<count[g]; m++)
|
for (s = m + 1; s < count[g]; s++) {
|
||||||
{
|
cascade_cross_idx[g][s - 1] = cascade_cross_idx[g][s];
|
||||||
if (cascade_cross_idx[g][m] == crossover_freq_idx)
|
|
||||||
{
|
|
||||||
for (s=m+1; s<count[g]; s++)
|
|
||||||
{
|
|
||||||
cascade_cross_idx[g][s-1] = cascade_cross_idx[g][s];
|
|
||||||
}
|
}
|
||||||
count[g]--;
|
count[g]--;
|
||||||
break;
|
break;
|
||||||
|
|
@ -232,41 +218,35 @@ WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coeff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<num_ph_align_ch_groups; g++)
|
for (g = 0; g < num_ph_align_ch_groups; g++) {
|
||||||
{
|
|
||||||
num_filter = count[g];
|
num_filter = count[g];
|
||||||
if(num_filter>0){
|
if (num_filter > 0) {
|
||||||
for(i=0;i<num_filter;i++){
|
for (i = 0; i < num_filter; i++) {
|
||||||
impd_compute_filt_coeff(cascade_cross_idx[g][i],
|
impd_compute_filt_coeff(
|
||||||
NULL,
|
cascade_cross_idx[g][i], NULL, NULL,
|
||||||
NULL,
|
&(ia_filter_banks_struct->str_drc_filter_bank[g]
|
||||||
&(ia_filter_banks_struct->str_drc_filter_bank[g].str_all_pass_cascade.str_all_pass_cascade_filter[i].str_all_pass_stage),
|
.str_all_pass_cascade.str_all_pass_cascade_filter[i]
|
||||||
|
.str_all_pass_stage),
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
ia_filter_banks_struct->str_drc_filter_bank[g].str_all_pass_cascade.num_filter = num_filter;
|
ia_filter_banks_struct->str_drc_filter_bank[g]
|
||||||
|
.str_all_pass_cascade.num_filter = num_filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err_code!=0)
|
if (err_code != 0) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output) {
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 tmp;
|
FLOAT32 tmp;
|
||||||
FLOAT32 a1 = filter->a1;
|
FLOAT32 a1 = filter->a1;
|
||||||
|
|
@ -275,29 +255,25 @@ VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
||||||
FLOAT32 b1 = filter->b1;
|
FLOAT32 b1 = filter->b1;
|
||||||
FLOAT32 b2 = filter->b2;
|
FLOAT32 b2 = filter->b2;
|
||||||
|
|
||||||
FLOAT32 st1 = filter->x_p[chan_idx*2];
|
FLOAT32 st1 = filter->x_p[chan_idx * 2];
|
||||||
FLOAT32 st2 = filter->y_p[chan_idx*2];
|
FLOAT32 st2 = filter->y_p[chan_idx * 2];
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++)
|
for (i = 0; i < frame_len; i++) {
|
||||||
{
|
|
||||||
tmp = input[i];
|
tmp = input[i];
|
||||||
output[i] = b0 * tmp + st1;
|
output[i] = b0 * tmp + st1;
|
||||||
st1 = b1 * tmp - a1 * output[i] + st2;
|
st1 = b1 * tmp - a1 * output[i] + st2;
|
||||||
st2 = b2 * tmp - a2 * output[i];
|
st2 = b2 * tmp - a2 * output[i];
|
||||||
}
|
}
|
||||||
filter->x_p[chan_idx*2] = st1;
|
filter->x_p[chan_idx * 2] = st1;
|
||||||
filter->y_p[chan_idx*2] = st2;
|
filter->y_p[chan_idx * 2] = st2;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 tmp, tmp1;
|
FLOAT32 tmp, tmp1;
|
||||||
FLOAT32 a1_l = pstr_lp_filt_coeff->a1;
|
FLOAT32 a1_l = pstr_lp_filt_coeff->a1;
|
||||||
|
|
@ -306,10 +282,10 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
FLOAT32 b1_l = pstr_lp_filt_coeff->b1;
|
FLOAT32 b1_l = pstr_lp_filt_coeff->b1;
|
||||||
FLOAT32 b2_l = pstr_lp_filt_coeff->b2;
|
FLOAT32 b2_l = pstr_lp_filt_coeff->b2;
|
||||||
|
|
||||||
FLOAT32 st1_l = pstr_lp_filt_coeff->x_p[chan_idx*2+0];
|
FLOAT32 st1_l = pstr_lp_filt_coeff->x_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st2_l = pstr_lp_filt_coeff->x_p[chan_idx*2+1];
|
FLOAT32 st2_l = pstr_lp_filt_coeff->x_p[chan_idx * 2 + 1];
|
||||||
FLOAT32 st3_l = pstr_lp_filt_coeff->y_p[chan_idx*2+0];
|
FLOAT32 st3_l = pstr_lp_filt_coeff->y_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st4_l = pstr_lp_filt_coeff->y_p[chan_idx*2+1];
|
FLOAT32 st4_l = pstr_lp_filt_coeff->y_p[chan_idx * 2 + 1];
|
||||||
|
|
||||||
FLOAT32 a1_h = pstr_hp_filt_coeff->a1;
|
FLOAT32 a1_h = pstr_hp_filt_coeff->a1;
|
||||||
FLOAT32 a2_h = pstr_hp_filt_coeff->a2;
|
FLOAT32 a2_h = pstr_hp_filt_coeff->a2;
|
||||||
|
|
@ -317,16 +293,15 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
FLOAT32 b1_h = pstr_hp_filt_coeff->b1;
|
FLOAT32 b1_h = pstr_hp_filt_coeff->b1;
|
||||||
FLOAT32 b2_h = pstr_hp_filt_coeff->b2;
|
FLOAT32 b2_h = pstr_hp_filt_coeff->b2;
|
||||||
|
|
||||||
FLOAT32 st1_h = pstr_hp_filt_coeff->x_p[chan_idx*2+0];
|
FLOAT32 st1_h = pstr_hp_filt_coeff->x_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st2_h = pstr_hp_filt_coeff->x_p[chan_idx*2+1];
|
FLOAT32 st2_h = pstr_hp_filt_coeff->x_p[chan_idx * 2 + 1];
|
||||||
FLOAT32 st3_h = pstr_hp_filt_coeff->y_p[chan_idx*2+0];
|
FLOAT32 st3_h = pstr_hp_filt_coeff->y_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st4_h = pstr_hp_filt_coeff->y_p[chan_idx*2+1];
|
FLOAT32 st4_h = pstr_hp_filt_coeff->y_p[chan_idx * 2 + 1];
|
||||||
|
|
||||||
FLOAT32* output_low = output[0];
|
FLOAT32* output_low = output[0];
|
||||||
FLOAT32* output_high = output[1];
|
FLOAT32* output_high = output[1];
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++)
|
for (i = 0; i < frame_len; i++) {
|
||||||
{
|
|
||||||
tmp1 = input[i];
|
tmp1 = input[i];
|
||||||
tmp = b0_l * tmp1 + st1_l;
|
tmp = b0_l * tmp1 + st1_l;
|
||||||
st1_l = b1_l * tmp1 - a1_l * tmp + st2_l;
|
st1_l = b1_l * tmp1 - a1_l * tmp + st2_l;
|
||||||
|
|
@ -344,161 +319,112 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
st3_h = b1_h * tmp - a1_h * output_high[i] + st4_h;
|
st3_h = b1_h * tmp - a1_h * output_high[i] + st4_h;
|
||||||
st4_h = b2_h * tmp - a2_h * output_high[i];
|
st4_h = b2_h * tmp - a2_h * output_high[i];
|
||||||
}
|
}
|
||||||
pstr_lp_filt_coeff->x_p[chan_idx*2+0] = st1_l;
|
pstr_lp_filt_coeff->x_p[chan_idx * 2 + 0] = st1_l;
|
||||||
pstr_lp_filt_coeff->x_p[chan_idx*2+1] = st2_l;
|
pstr_lp_filt_coeff->x_p[chan_idx * 2 + 1] = st2_l;
|
||||||
pstr_lp_filt_coeff->y_p[chan_idx*2+0] = st3_l;
|
pstr_lp_filt_coeff->y_p[chan_idx * 2 + 0] = st3_l;
|
||||||
pstr_lp_filt_coeff->y_p[chan_idx*2+1] = st4_l;
|
pstr_lp_filt_coeff->y_p[chan_idx * 2 + 1] = st4_l;
|
||||||
|
|
||||||
pstr_hp_filt_coeff->x_p[chan_idx*2+0] = st1_h;
|
pstr_hp_filt_coeff->x_p[chan_idx * 2 + 0] = st1_h;
|
||||||
pstr_hp_filt_coeff->x_p[chan_idx*2+1] = st2_h;
|
pstr_hp_filt_coeff->x_p[chan_idx * 2 + 1] = st2_h;
|
||||||
pstr_hp_filt_coeff->y_p[chan_idx*2+0] = st3_h;
|
pstr_hp_filt_coeff->y_p[chan_idx * 2 + 0] = st3_h;
|
||||||
pstr_hp_filt_coeff->y_p[chan_idx*2+1] = st4_h;
|
pstr_hp_filt_coeff->y_p[chan_idx * 2 + 1] = st4_h;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
ia_iir_filter_struct* pstr_lp_filt_coeff = &str_two_band_bank->low_pass;
|
||||||
FLOAT32* output[])
|
ia_iir_filter_struct* pstr_hp_filt_coeff = &str_two_band_bank->high_pass;
|
||||||
{
|
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_two_band_bank->low_pass;
|
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_two_band_bank->high_pass;
|
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, chan_idx,
|
||||||
pstr_hp_filt_coeff,
|
frame_len, input, output);
|
||||||
chan_idx,
|
|
||||||
frame_len,
|
|
||||||
input,
|
|
||||||
output);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID impd_three_band_filter_process(
|
||||||
|
ia_three_band_filt_struct* str_three_band_bank, WORD32 c, WORD32 size,
|
||||||
VOID impd_three_band_filter_process(ia_three_band_filt_struct* str_three_band_bank,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
WORD32 c,
|
WORD32 err_code = 0;
|
||||||
WORD32 size,
|
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
WORD32 err_code=0;
|
|
||||||
ia_iir_filter_struct* all_pass_filter;
|
ia_iir_filter_struct* all_pass_filter;
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_three_band_bank->str_low_pass_stage_1;
|
ia_iir_filter_struct* pstr_lp_filt_coeff =
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_three_band_bank->str_high_pass_stage_1;
|
&str_three_band_bank->str_low_pass_stage_1;
|
||||||
|
ia_iir_filter_struct* pstr_hp_filt_coeff =
|
||||||
|
&str_three_band_bank->str_high_pass_stage_1;
|
||||||
FLOAT32* output1[2];
|
FLOAT32* output1[2];
|
||||||
output1[0]=output[0];
|
output1[0] = output[0];
|
||||||
output1[1]=output[1];
|
output1[1] = output[1];
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, c, size,
|
||||||
pstr_hp_filt_coeff,
|
input, output1);
|
||||||
c,
|
|
||||||
size,
|
|
||||||
input,
|
|
||||||
output1);
|
|
||||||
|
|
||||||
all_pass_filter =&str_three_band_bank->str_all_pass_stage_2;
|
all_pass_filter = &str_three_band_bank->str_all_pass_stage_2;
|
||||||
|
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
impd_iir_second_order_filter_all_pass(all_pass_filter, c, size, output1[1],
|
||||||
c,
|
|
||||||
size,
|
|
||||||
output1[1],
|
|
||||||
output[2]);
|
output[2]);
|
||||||
pstr_lp_filt_coeff=&str_three_band_bank->str_low_pass_stage_2;
|
pstr_lp_filt_coeff = &str_three_band_bank->str_low_pass_stage_2;
|
||||||
pstr_hp_filt_coeff=&str_three_band_bank->str_high_pass_stage_2;
|
pstr_hp_filt_coeff = &str_three_band_bank->str_high_pass_stage_2;
|
||||||
|
|
||||||
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, c, size,
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
output1[0], output1);
|
||||||
pstr_hp_filt_coeff,
|
|
||||||
c,
|
|
||||||
size,
|
|
||||||
output1[0],
|
|
||||||
output1);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
WORD32 cha_idx,
|
WORD32 cha_idx, WORD32 win_size,
|
||||||
WORD32 win_size,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
WORD32 err_code = 0;
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
WORD32 err_code=0;
|
|
||||||
ia_iir_filter_struct* all_pass_filter;
|
ia_iir_filter_struct* all_pass_filter;
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_four_band_bank->str_low_pass_stage_1;
|
ia_iir_filter_struct* pstr_lp_filt_coeff =
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_four_band_bank->str_high_pass_stage_1;
|
&str_four_band_bank->str_low_pass_stage_1;
|
||||||
|
ia_iir_filter_struct* pstr_hp_filt_coeff =
|
||||||
|
&str_four_band_bank->str_high_pass_stage_1;
|
||||||
FLOAT32* output1[2];
|
FLOAT32* output1[2];
|
||||||
FLOAT32* output2[2];
|
FLOAT32* output2[2];
|
||||||
output1[0]=output[0];
|
output1[0] = output[0];
|
||||||
output1[1]=output[1];
|
output1[1] = output[1];
|
||||||
output2[0]=output[2];
|
output2[0] = output[2];
|
||||||
output2[1]=output[3];
|
output2[1] = output[3];
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
pstr_hp_filt_coeff,
|
win_size, input, output1);
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
input,
|
|
||||||
output1);
|
|
||||||
|
|
||||||
all_pass_filter =&str_four_band_bank->str_all_pass_stage_2_low;
|
all_pass_filter = &str_four_band_bank->str_all_pass_stage_2_low;
|
||||||
|
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
impd_iir_second_order_filter_all_pass(all_pass_filter, cha_idx, win_size,
|
||||||
cha_idx,
|
output1[0], output1[0]);
|
||||||
win_size,
|
|
||||||
output1[0],
|
|
||||||
output1[0]);
|
|
||||||
|
|
||||||
|
all_pass_filter = &str_four_band_bank->str_all_pass_stage_2_high;
|
||||||
|
|
||||||
all_pass_filter =&str_four_band_bank->str_all_pass_stage_2_high;
|
impd_iir_second_order_filter_all_pass(all_pass_filter, cha_idx, win_size,
|
||||||
|
output1[1], output2[0]);
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output1[1],
|
|
||||||
output2[0]);
|
|
||||||
|
|
||||||
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_low;
|
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_low;
|
||||||
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_low;
|
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_low;
|
||||||
|
|
||||||
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
win_size, output1[0], output1);
|
||||||
pstr_hp_filt_coeff,
|
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output1[0],
|
|
||||||
output1);
|
|
||||||
|
|
||||||
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_high;
|
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_high;
|
||||||
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_high;
|
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_high;
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
pstr_hp_filt_coeff,
|
win_size, output2[0], output2);
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output2[0],
|
|
||||||
output2);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_all_pass_cascade_process(ia_all_pass_cascade_struct *str_all_pass_cascade,
|
VOID impd_all_pass_cascade_process(
|
||||||
WORD32 ch_idx,
|
ia_all_pass_cascade_struct* str_all_pass_cascade, WORD32 ch_idx,
|
||||||
WORD32 win_size,
|
WORD32 win_size, FLOAT32* input) {
|
||||||
FLOAT32* input)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
||||||
for (i=0; i<str_all_pass_cascade->num_filter; i++)
|
for (i = 0; i < str_all_pass_cascade->num_filter; i++) {
|
||||||
{
|
impd_iir_second_order_filter_all_pass(
|
||||||
impd_iir_second_order_filter_all_pass (&(str_all_pass_cascade->str_all_pass_cascade_filter[i].str_all_pass_stage),
|
&(str_all_pass_cascade->str_all_pass_cascade_filter[i]
|
||||||
ch_idx,
|
.str_all_pass_stage),
|
||||||
win_size,
|
ch_idx, win_size, input, input);
|
||||||
input,
|
|
||||||
input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,11 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff,
|
ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_ap_filt_coeff,
|
ia_iir_filter_struct* pstr_ap_filt_coeff,
|
||||||
WORD32 filter_type)
|
WORD32 filter_type) {
|
||||||
{
|
|
||||||
FLOAT32 gamma = normal_cross_freq[crossover_freq_idx].gamma;
|
FLOAT32 gamma = normal_cross_freq[crossover_freq_idx].gamma;
|
||||||
FLOAT32 delta = normal_cross_freq[crossover_freq_idx].delta;
|
FLOAT32 delta = normal_cross_freq[crossover_freq_idx].delta;
|
||||||
|
|
||||||
if(filter_type==0||filter_type==2){
|
if (filter_type == 0 || filter_type == 2) {
|
||||||
pstr_lp_filt_coeff->a0 = 1.0f;
|
pstr_lp_filt_coeff->a0 = 1.0f;
|
||||||
pstr_lp_filt_coeff->a1 = 2.0f * (gamma - delta);
|
pstr_lp_filt_coeff->a1 = 2.0f * (gamma - delta);
|
||||||
pstr_lp_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
pstr_lp_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
||||||
|
|
@ -49,14 +48,16 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
pstr_hp_filt_coeff->a1 = pstr_lp_filt_coeff->a1;
|
pstr_hp_filt_coeff->a1 = pstr_lp_filt_coeff->a1;
|
||||||
pstr_hp_filt_coeff->a2 = pstr_lp_filt_coeff->a2;
|
pstr_hp_filt_coeff->a2 = pstr_lp_filt_coeff->a2;
|
||||||
pstr_hp_filt_coeff->b0 = delta;
|
pstr_hp_filt_coeff->b0 = delta;
|
||||||
pstr_hp_filt_coeff->b1 = - 2.0f * delta;
|
pstr_hp_filt_coeff->b1 = -2.0f * delta;
|
||||||
pstr_hp_filt_coeff->b2 = delta;
|
pstr_hp_filt_coeff->b2 = delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(filter_type==1||filter_type==2){
|
if (filter_type == 1 || filter_type == 2) {
|
||||||
pstr_ap_filt_coeff->a0 = 1.0f;
|
pstr_ap_filt_coeff->a0 = 1.0f;
|
||||||
pstr_ap_filt_coeff->a1 = 2.0f * (gamma - delta);;
|
pstr_ap_filt_coeff->a1 = 2.0f * (gamma - delta);
|
||||||
pstr_ap_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;;
|
;
|
||||||
|
pstr_ap_filt_coeff->a2 = 2.0f * (gamma + delta) - 1.0f;
|
||||||
|
;
|
||||||
pstr_ap_filt_coeff->b0 = pstr_ap_filt_coeff->a2;
|
pstr_ap_filt_coeff->b0 = pstr_ap_filt_coeff->a2;
|
||||||
pstr_ap_filt_coeff->b1 = pstr_ap_filt_coeff->a1;
|
pstr_ap_filt_coeff->b1 = pstr_ap_filt_coeff->a1;
|
||||||
pstr_ap_filt_coeff->b2 = pstr_ap_filt_coeff->a0;
|
pstr_ap_filt_coeff->b2 = pstr_ap_filt_coeff->a0;
|
||||||
|
|
@ -67,42 +68,34 @@ VOID impd_compute_filt_coeff(WORD32 crossover_freq_idx,
|
||||||
|
|
||||||
WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
||||||
ia_gain_params_struct* gain_params,
|
ia_gain_params_struct* gain_params,
|
||||||
ia_drc_filter_bank_struct* drc_filter_bank)
|
ia_drc_filter_bank_struct* drc_filter_bank) {
|
||||||
{
|
|
||||||
ia_two_band_filt_struct* str_two_band_bank;
|
ia_two_band_filt_struct* str_two_band_bank;
|
||||||
ia_three_band_filt_struct* str_three_band_bank;
|
ia_three_band_filt_struct* str_three_band_bank;
|
||||||
ia_four_band_filt_struct* str_four_band_bank;
|
ia_four_band_filt_struct* str_four_band_bank;
|
||||||
drc_filter_bank->complexity = 0;
|
drc_filter_bank->complexity = 0;
|
||||||
drc_filter_bank->num_bands = num_sub_bands;
|
drc_filter_bank->num_bands = num_sub_bands;
|
||||||
|
|
||||||
|
if (num_sub_bands == 1) {
|
||||||
if(num_sub_bands==1){
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (num_sub_bands == 2) {
|
||||||
else if(num_sub_bands==2){
|
|
||||||
str_two_band_bank = &drc_filter_bank->str_two_band_bank;
|
str_two_band_bank = &drc_filter_bank->str_two_band_bank;
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
&(str_two_band_bank->low_pass),
|
&(str_two_band_bank->low_pass),
|
||||||
&(str_two_band_bank->high_pass),
|
&(str_two_band_bank->high_pass), NULL, 0);
|
||||||
NULL,
|
} else if (num_sub_bands == 3) {
|
||||||
0);
|
|
||||||
}
|
|
||||||
else if(num_sub_bands==3){
|
|
||||||
str_three_band_bank = &drc_filter_bank->str_three_band_bank;
|
str_three_band_bank = &drc_filter_bank->str_three_band_bank;
|
||||||
|
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
&(str_three_band_bank->str_low_pass_stage_2),
|
&(str_three_band_bank->str_low_pass_stage_2),
|
||||||
&(str_three_band_bank->str_high_pass_stage_2),
|
&(str_three_band_bank->str_high_pass_stage_2),
|
||||||
&(str_three_band_bank->str_all_pass_stage_2),
|
&(str_three_band_bank->str_all_pass_stage_2), 2);
|
||||||
2);
|
|
||||||
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
||||||
&(str_three_band_bank->str_low_pass_stage_1),
|
&(str_three_band_bank->str_low_pass_stage_1),
|
||||||
&(str_three_band_bank->str_high_pass_stage_1),
|
&(str_three_band_bank->str_high_pass_stage_1), NULL,
|
||||||
NULL,
|
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(num_sub_bands==4){
|
else if (num_sub_bands == 4) {
|
||||||
str_four_band_bank = &drc_filter_bank->str_four_band_bank;
|
str_four_band_bank = &drc_filter_bank->str_four_band_bank;
|
||||||
|
|
||||||
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[1].crossover_freq_idx,
|
||||||
|
|
@ -112,119 +105,112 @@ WORD32 impd_initialize_filt_bank(WORD32 num_sub_bands,
|
||||||
2);
|
2);
|
||||||
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[2].crossover_freq_idx,
|
||||||
&(str_four_band_bank->str_low_pass_stage_1),
|
&(str_four_band_bank->str_low_pass_stage_1),
|
||||||
&(str_four_band_bank->str_high_pass_stage_1),
|
&(str_four_band_bank->str_high_pass_stage_1), NULL,
|
||||||
NULL,
|
|
||||||
0);
|
0);
|
||||||
impd_compute_filt_coeff(gain_params[3].crossover_freq_idx,
|
impd_compute_filt_coeff(gain_params[3].crossover_freq_idx,
|
||||||
&(str_four_band_bank->str_low_pass_stage_3_high),
|
&(str_four_band_bank->str_low_pass_stage_3_high),
|
||||||
&(str_four_band_bank->str_high_pass_stage_3_high),
|
&(str_four_band_bank->str_high_pass_stage_3_high),
|
||||||
&(str_four_band_bank->str_all_pass_stage_2_low),
|
&(str_four_band_bank->str_all_pass_stage_2_low), 2);
|
||||||
2);
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
WORD32 impd_init_all_filter_banks(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct)
|
ia_filter_banks_struct* ia_filter_banks_struct) {
|
||||||
{
|
WORD32 err_code = 0;
|
||||||
WORD32 err_code=0;
|
WORD32 b, g, i, k, m, s, crossover_freq_idx, num_ch_in_groups,
|
||||||
WORD32 b, g, i, k, m, s , crossover_freq_idx, num_ch_in_groups, num_ph_align_ch_groups;
|
num_ph_align_ch_groups;
|
||||||
WORD32 match_found = 0, num_filter;
|
WORD32 match_found = 0, num_filter;
|
||||||
WORD32 cascade_cross_idx[CHANNEL_GROUP_COUNT_MAX+1][CHANNEL_GROUP_COUNT_MAX * 3];
|
WORD32 cascade_cross_idx[CHANNEL_GROUP_COUNT_MAX + 1]
|
||||||
|
[CHANNEL_GROUP_COUNT_MAX * 3];
|
||||||
WORD32 count[CHANNEL_GROUP_COUNT_MAX + 1];
|
WORD32 count[CHANNEL_GROUP_COUNT_MAX + 1];
|
||||||
|
|
||||||
num_ch_in_groups = 0;
|
num_ch_in_groups = 0;
|
||||||
num_ph_align_ch_groups = str_drc_instruction_str->num_drc_ch_groups;
|
num_ph_align_ch_groups = str_drc_instruction_str->num_drc_ch_groups;
|
||||||
|
|
||||||
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
|
||||||
{
|
|
||||||
num_ch_in_groups += str_drc_instruction_str->num_chan_per_ch_group[g];
|
num_ch_in_groups += str_drc_instruction_str->num_chan_per_ch_group[g];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_ch_in_groups < str_drc_instruction_str->audio_num_chan)
|
if (num_ch_in_groups < str_drc_instruction_str->audio_num_chan) {
|
||||||
{
|
|
||||||
num_ph_align_ch_groups++;
|
num_ph_align_ch_groups++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_filter_banks_struct->nfilter_banks = str_drc_instruction_str->num_drc_ch_groups;
|
ia_filter_banks_struct->nfilter_banks =
|
||||||
|
str_drc_instruction_str->num_drc_ch_groups;
|
||||||
ia_filter_banks_struct->num_ph_align_ch_groups = num_ph_align_ch_groups;
|
ia_filter_banks_struct->num_ph_align_ch_groups = num_ph_align_ch_groups;
|
||||||
|
|
||||||
if (str_p_loc_drc_coefficients_uni_drc == NULL)
|
if (str_p_loc_drc_coefficients_uni_drc == NULL) {
|
||||||
{
|
|
||||||
ia_filter_banks_struct->str_drc_filter_bank->num_bands = 1;
|
ia_filter_banks_struct->str_drc_filter_bank->num_bands = 1;
|
||||||
}
|
} else {
|
||||||
else
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
err_code = impd_initialize_filt_bank(
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
{
|
->gain_set_params[str_drc_instruction_str
|
||||||
err_code = impd_initialize_filt_bank(str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].band_count,
|
->gain_set_index_for_channel_group[g]]
|
||||||
str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].gain_params,
|
.band_count,
|
||||||
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
|
->gain_set_params[str_drc_instruction_str
|
||||||
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.gain_params,
|
||||||
&(ia_filter_banks_struct->str_drc_filter_bank[g]));
|
&(ia_filter_banks_struct->str_drc_filter_bank[g]));
|
||||||
if (err_code!=0)
|
if (err_code != 0) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<CHANNEL_GROUP_COUNT_MAX + 1; g++)
|
for (g = 0; g < CHANNEL_GROUP_COUNT_MAX + 1; g++) {
|
||||||
{
|
|
||||||
count[g] = 0;
|
count[g] = 0;
|
||||||
}
|
}
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
for (b = 1;
|
||||||
for (b=1; b<str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].band_count; b++)
|
b < str_p_loc_drc_coefficients_uni_drc
|
||||||
{
|
->gain_set_params[str_drc_instruction_str
|
||||||
crossover_freq_idx = str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].gain_params[b].crossover_freq_idx;
|
->gain_set_index_for_channel_group[g]]
|
||||||
for (k=0; k<num_ph_align_ch_groups; k++)
|
.band_count;
|
||||||
{
|
b++) {
|
||||||
if (k!=g)
|
crossover_freq_idx =
|
||||||
{
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
|
->gain_set_params[str_drc_instruction_str
|
||||||
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.gain_params[b]
|
||||||
|
.crossover_freq_idx;
|
||||||
|
for (k = 0; k < num_ph_align_ch_groups; k++) {
|
||||||
|
if (k != g) {
|
||||||
cascade_cross_idx[k][count[k]] = crossover_freq_idx;
|
cascade_cross_idx[k][count[k]] = crossover_freq_idx;
|
||||||
count[k]++;
|
count[k]++;
|
||||||
if (count[k] > CHANNEL_GROUP_COUNT_MAX * 3)
|
if (count[k] > CHANNEL_GROUP_COUNT_MAX * 3) {
|
||||||
{
|
return -1;
|
||||||
return -1 ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i=0;
|
i = 0;
|
||||||
while (i<count[0])
|
while (i < count[0]) {
|
||||||
{
|
|
||||||
crossover_freq_idx = cascade_cross_idx[0][i];
|
crossover_freq_idx = cascade_cross_idx[0][i];
|
||||||
match_found = 0;
|
match_found = 0;
|
||||||
for (g=1; g<num_ph_align_ch_groups; g++)
|
for (g = 1; g < num_ph_align_ch_groups; g++) {
|
||||||
{
|
|
||||||
match_found = 0;
|
match_found = 0;
|
||||||
for (k=0; k<count[g]; k++)
|
for (k = 0; k < count[g]; k++) {
|
||||||
{
|
if (cascade_cross_idx[g][k] == crossover_freq_idx) {
|
||||||
if (cascade_cross_idx[g][k] == crossover_freq_idx)
|
|
||||||
{
|
|
||||||
match_found = 1;
|
match_found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match_found == 0)
|
if (match_found == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (match_found == 1)
|
if (match_found == 1) {
|
||||||
{
|
for (g = 0; g < num_ph_align_ch_groups; g++) {
|
||||||
for (g=0; g<num_ph_align_ch_groups; g++)
|
for (m = 0; m < count[g]; m++) {
|
||||||
{
|
if (cascade_cross_idx[g][m] == crossover_freq_idx) {
|
||||||
for (m=0; m<count[g]; m++)
|
for (s = m + 1; s < count[g]; s++) {
|
||||||
{
|
cascade_cross_idx[g][s - 1] = cascade_cross_idx[g][s];
|
||||||
if (cascade_cross_idx[g][m] == crossover_freq_idx)
|
|
||||||
{
|
|
||||||
for (s=m+1; s<count[g]; s++)
|
|
||||||
{
|
|
||||||
cascade_cross_idx[g][s-1] = cascade_cross_idx[g][s];
|
|
||||||
}
|
}
|
||||||
count[g]--;
|
count[g]--;
|
||||||
break;
|
break;
|
||||||
|
|
@ -232,41 +218,35 @@ WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coeff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<num_ph_align_ch_groups; g++)
|
for (g = 0; g < num_ph_align_ch_groups; g++) {
|
||||||
{
|
|
||||||
num_filter = count[g];
|
num_filter = count[g];
|
||||||
if(num_filter>0){
|
if (num_filter > 0) {
|
||||||
for(i=0;i<num_filter;i++){
|
for (i = 0; i < num_filter; i++) {
|
||||||
impd_compute_filt_coeff(cascade_cross_idx[g][i],
|
impd_compute_filt_coeff(
|
||||||
NULL,
|
cascade_cross_idx[g][i], NULL, NULL,
|
||||||
NULL,
|
&(ia_filter_banks_struct->str_drc_filter_bank[g]
|
||||||
&(ia_filter_banks_struct->str_drc_filter_bank[g].str_all_pass_cascade.str_all_pass_cascade_filter[i].str_all_pass_stage),
|
.str_all_pass_cascade.str_all_pass_cascade_filter[i]
|
||||||
|
.str_all_pass_stage),
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
ia_filter_banks_struct->str_drc_filter_bank[g].str_all_pass_cascade.num_filter = num_filter;
|
ia_filter_banks_struct->str_drc_filter_bank[g]
|
||||||
|
.str_all_pass_cascade.num_filter = num_filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err_code!=0)
|
if (err_code != 0) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output) {
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 tmp;
|
FLOAT32 tmp;
|
||||||
FLOAT32 a1 = filter->a1;
|
FLOAT32 a1 = filter->a1;
|
||||||
|
|
@ -275,29 +255,25 @@ VOID impd_iir_second_order_filter_all_pass(ia_iir_filter_struct* filter,
|
||||||
FLOAT32 b1 = filter->b1;
|
FLOAT32 b1 = filter->b1;
|
||||||
FLOAT32 b2 = filter->b2;
|
FLOAT32 b2 = filter->b2;
|
||||||
|
|
||||||
FLOAT32 st1 = filter->x_p[chan_idx*2];
|
FLOAT32 st1 = filter->x_p[chan_idx * 2];
|
||||||
FLOAT32 st2 = filter->y_p[chan_idx*2];
|
FLOAT32 st2 = filter->y_p[chan_idx * 2];
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++)
|
for (i = 0; i < frame_len; i++) {
|
||||||
{
|
|
||||||
tmp = input[i];
|
tmp = input[i];
|
||||||
output[i] = b0 * tmp + st1;
|
output[i] = b0 * tmp + st1;
|
||||||
st1 = b1 * tmp - a1 * output[i] + st2;
|
st1 = b1 * tmp - a1 * output[i] + st2;
|
||||||
st2 = b2 * tmp - a2 * output[i];
|
st2 = b2 * tmp - a2 * output[i];
|
||||||
}
|
}
|
||||||
filter->x_p[chan_idx*2] = st1;
|
filter->x_p[chan_idx * 2] = st1;
|
||||||
filter->y_p[chan_idx*2] = st2;
|
filter->y_p[chan_idx * 2] = st2;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
ia_iir_filter_struct* pstr_hp_filt_coeff,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 tmp, tmp1;
|
FLOAT32 tmp, tmp1;
|
||||||
FLOAT32 a1_l = pstr_lp_filt_coeff->a1;
|
FLOAT32 a1_l = pstr_lp_filt_coeff->a1;
|
||||||
|
|
@ -306,10 +282,10 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
FLOAT32 b1_l = pstr_lp_filt_coeff->b1;
|
FLOAT32 b1_l = pstr_lp_filt_coeff->b1;
|
||||||
FLOAT32 b2_l = pstr_lp_filt_coeff->b2;
|
FLOAT32 b2_l = pstr_lp_filt_coeff->b2;
|
||||||
|
|
||||||
FLOAT32 st1_l = pstr_lp_filt_coeff->x_p[chan_idx*2+0];
|
FLOAT32 st1_l = pstr_lp_filt_coeff->x_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st2_l = pstr_lp_filt_coeff->x_p[chan_idx*2+1];
|
FLOAT32 st2_l = pstr_lp_filt_coeff->x_p[chan_idx * 2 + 1];
|
||||||
FLOAT32 st3_l = pstr_lp_filt_coeff->y_p[chan_idx*2+0];
|
FLOAT32 st3_l = pstr_lp_filt_coeff->y_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st4_l = pstr_lp_filt_coeff->y_p[chan_idx*2+1];
|
FLOAT32 st4_l = pstr_lp_filt_coeff->y_p[chan_idx * 2 + 1];
|
||||||
|
|
||||||
FLOAT32 a1_h = pstr_hp_filt_coeff->a1;
|
FLOAT32 a1_h = pstr_hp_filt_coeff->a1;
|
||||||
FLOAT32 a2_h = pstr_hp_filt_coeff->a2;
|
FLOAT32 a2_h = pstr_hp_filt_coeff->a2;
|
||||||
|
|
@ -317,16 +293,15 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
FLOAT32 b1_h = pstr_hp_filt_coeff->b1;
|
FLOAT32 b1_h = pstr_hp_filt_coeff->b1;
|
||||||
FLOAT32 b2_h = pstr_hp_filt_coeff->b2;
|
FLOAT32 b2_h = pstr_hp_filt_coeff->b2;
|
||||||
|
|
||||||
FLOAT32 st1_h = pstr_hp_filt_coeff->x_p[chan_idx*2+0];
|
FLOAT32 st1_h = pstr_hp_filt_coeff->x_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st2_h = pstr_hp_filt_coeff->x_p[chan_idx*2+1];
|
FLOAT32 st2_h = pstr_hp_filt_coeff->x_p[chan_idx * 2 + 1];
|
||||||
FLOAT32 st3_h = pstr_hp_filt_coeff->y_p[chan_idx*2+0];
|
FLOAT32 st3_h = pstr_hp_filt_coeff->y_p[chan_idx * 2 + 0];
|
||||||
FLOAT32 st4_h = pstr_hp_filt_coeff->y_p[chan_idx*2+1];
|
FLOAT32 st4_h = pstr_hp_filt_coeff->y_p[chan_idx * 2 + 1];
|
||||||
|
|
||||||
FLOAT32* output_low = output[0];
|
FLOAT32* output_low = output[0];
|
||||||
FLOAT32* output_high = output[1];
|
FLOAT32* output_high = output[1];
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++)
|
for (i = 0; i < frame_len; i++) {
|
||||||
{
|
|
||||||
tmp1 = input[i];
|
tmp1 = input[i];
|
||||||
tmp = b0_l * tmp1 + st1_l;
|
tmp = b0_l * tmp1 + st1_l;
|
||||||
st1_l = b1_l * tmp1 - a1_l * tmp + st2_l;
|
st1_l = b1_l * tmp1 - a1_l * tmp + st2_l;
|
||||||
|
|
@ -344,161 +319,112 @@ VOID impd_apply_low_high_filter(ia_iir_filter_struct* pstr_lp_filt_coeff,
|
||||||
st3_h = b1_h * tmp - a1_h * output_high[i] + st4_h;
|
st3_h = b1_h * tmp - a1_h * output_high[i] + st4_h;
|
||||||
st4_h = b2_h * tmp - a2_h * output_high[i];
|
st4_h = b2_h * tmp - a2_h * output_high[i];
|
||||||
}
|
}
|
||||||
pstr_lp_filt_coeff->x_p[chan_idx*2+0] = st1_l;
|
pstr_lp_filt_coeff->x_p[chan_idx * 2 + 0] = st1_l;
|
||||||
pstr_lp_filt_coeff->x_p[chan_idx*2+1] = st2_l;
|
pstr_lp_filt_coeff->x_p[chan_idx * 2 + 1] = st2_l;
|
||||||
pstr_lp_filt_coeff->y_p[chan_idx*2+0] = st3_l;
|
pstr_lp_filt_coeff->y_p[chan_idx * 2 + 0] = st3_l;
|
||||||
pstr_lp_filt_coeff->y_p[chan_idx*2+1] = st4_l;
|
pstr_lp_filt_coeff->y_p[chan_idx * 2 + 1] = st4_l;
|
||||||
|
|
||||||
pstr_hp_filt_coeff->x_p[chan_idx*2+0] = st1_h;
|
pstr_hp_filt_coeff->x_p[chan_idx * 2 + 0] = st1_h;
|
||||||
pstr_hp_filt_coeff->x_p[chan_idx*2+1] = st2_h;
|
pstr_hp_filt_coeff->x_p[chan_idx * 2 + 1] = st2_h;
|
||||||
pstr_hp_filt_coeff->y_p[chan_idx*2+0] = st3_h;
|
pstr_hp_filt_coeff->y_p[chan_idx * 2 + 0] = st3_h;
|
||||||
pstr_hp_filt_coeff->y_p[chan_idx*2+1] = st4_h;
|
pstr_hp_filt_coeff->y_p[chan_idx * 2 + 1] = st4_h;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
||||||
WORD32 chan_idx,
|
WORD32 chan_idx, WORD32 frame_len,
|
||||||
WORD32 frame_len,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
ia_iir_filter_struct* pstr_lp_filt_coeff = &str_two_band_bank->low_pass;
|
||||||
FLOAT32* output[])
|
ia_iir_filter_struct* pstr_hp_filt_coeff = &str_two_band_bank->high_pass;
|
||||||
{
|
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_two_band_bank->low_pass;
|
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_two_band_bank->high_pass;
|
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, chan_idx,
|
||||||
pstr_hp_filt_coeff,
|
frame_len, input, output);
|
||||||
chan_idx,
|
|
||||||
frame_len,
|
|
||||||
input,
|
|
||||||
output);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID impd_three_band_filter_process(
|
||||||
|
ia_three_band_filt_struct* str_three_band_bank, WORD32 c, WORD32 size,
|
||||||
VOID impd_three_band_filter_process(ia_three_band_filt_struct* str_three_band_bank,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
WORD32 c,
|
// WORD32 err_code=0;
|
||||||
WORD32 size,
|
|
||||||
FLOAT32* input,
|
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
// WORD32 err_code=0;
|
|
||||||
ia_iir_filter_struct* all_pass_filter;
|
ia_iir_filter_struct* all_pass_filter;
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_three_band_bank->str_low_pass_stage_1;
|
ia_iir_filter_struct* pstr_lp_filt_coeff =
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_three_band_bank->str_high_pass_stage_1;
|
&str_three_band_bank->str_low_pass_stage_1;
|
||||||
|
ia_iir_filter_struct* pstr_hp_filt_coeff =
|
||||||
|
&str_three_band_bank->str_high_pass_stage_1;
|
||||||
FLOAT32* output1[2];
|
FLOAT32* output1[2];
|
||||||
output1[0]=output[0];
|
output1[0] = output[0];
|
||||||
output1[1]=output[1];
|
output1[1] = output[1];
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, c, size,
|
||||||
pstr_hp_filt_coeff,
|
input, output1);
|
||||||
c,
|
|
||||||
size,
|
|
||||||
input,
|
|
||||||
output1);
|
|
||||||
|
|
||||||
all_pass_filter =&str_three_band_bank->str_all_pass_stage_2;
|
all_pass_filter = &str_three_band_bank->str_all_pass_stage_2;
|
||||||
|
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
impd_iir_second_order_filter_all_pass(all_pass_filter, c, size, output1[1],
|
||||||
c,
|
|
||||||
size,
|
|
||||||
output1[1],
|
|
||||||
output[2]);
|
output[2]);
|
||||||
pstr_lp_filt_coeff=&str_three_band_bank->str_low_pass_stage_2;
|
pstr_lp_filt_coeff = &str_three_band_bank->str_low_pass_stage_2;
|
||||||
pstr_hp_filt_coeff=&str_three_band_bank->str_high_pass_stage_2;
|
pstr_hp_filt_coeff = &str_three_band_bank->str_high_pass_stage_2;
|
||||||
|
|
||||||
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, c, size,
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
output1[0], output1);
|
||||||
pstr_hp_filt_coeff,
|
|
||||||
c,
|
|
||||||
size,
|
|
||||||
output1[0],
|
|
||||||
output1);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
WORD32 cha_idx,
|
WORD32 cha_idx, WORD32 win_size,
|
||||||
WORD32 win_size,
|
FLOAT32* input, FLOAT32* output[]) {
|
||||||
FLOAT32* input,
|
// WORD32 err_code=0;
|
||||||
FLOAT32* output[])
|
|
||||||
{
|
|
||||||
// WORD32 err_code=0;
|
|
||||||
ia_iir_filter_struct* all_pass_filter;
|
ia_iir_filter_struct* all_pass_filter;
|
||||||
ia_iir_filter_struct* pstr_lp_filt_coeff=&str_four_band_bank->str_low_pass_stage_1;
|
ia_iir_filter_struct* pstr_lp_filt_coeff =
|
||||||
ia_iir_filter_struct* pstr_hp_filt_coeff=&str_four_band_bank->str_high_pass_stage_1;
|
&str_four_band_bank->str_low_pass_stage_1;
|
||||||
|
ia_iir_filter_struct* pstr_hp_filt_coeff =
|
||||||
|
&str_four_band_bank->str_high_pass_stage_1;
|
||||||
FLOAT32* output1[2];
|
FLOAT32* output1[2];
|
||||||
FLOAT32* output2[2];
|
FLOAT32* output2[2];
|
||||||
output1[0]=output[0];
|
output1[0] = output[0];
|
||||||
output1[1]=output[1];
|
output1[1] = output[1];
|
||||||
output2[0]=output[2];
|
output2[0] = output[2];
|
||||||
output2[1]=output[3];
|
output2[1] = output[3];
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
pstr_hp_filt_coeff,
|
win_size, input, output1);
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
input,
|
|
||||||
output1);
|
|
||||||
|
|
||||||
all_pass_filter =&str_four_band_bank->str_all_pass_stage_2_low;
|
all_pass_filter = &str_four_band_bank->str_all_pass_stage_2_low;
|
||||||
|
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
impd_iir_second_order_filter_all_pass(all_pass_filter, cha_idx, win_size,
|
||||||
cha_idx,
|
output1[0], output1[0]);
|
||||||
win_size,
|
|
||||||
output1[0],
|
|
||||||
output1[0]);
|
|
||||||
|
|
||||||
|
all_pass_filter = &str_four_band_bank->str_all_pass_stage_2_high;
|
||||||
|
|
||||||
all_pass_filter =&str_four_band_bank->str_all_pass_stage_2_high;
|
impd_iir_second_order_filter_all_pass(all_pass_filter, cha_idx, win_size,
|
||||||
|
output1[1], output2[0]);
|
||||||
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output1[1],
|
|
||||||
output2[0]);
|
|
||||||
|
|
||||||
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_low;
|
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_low;
|
||||||
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_low;
|
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_low;
|
||||||
|
|
||||||
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
win_size, output1[0], output1);
|
||||||
pstr_hp_filt_coeff,
|
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output1[0],
|
|
||||||
output1);
|
|
||||||
|
|
||||||
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_high;
|
pstr_lp_filt_coeff = &str_four_band_bank->str_low_pass_stage_3_high;
|
||||||
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_high;
|
pstr_hp_filt_coeff = &str_four_band_bank->str_high_pass_stage_3_high;
|
||||||
|
|
||||||
impd_apply_low_high_filter(pstr_lp_filt_coeff,
|
impd_apply_low_high_filter(pstr_lp_filt_coeff, pstr_hp_filt_coeff, cha_idx,
|
||||||
pstr_hp_filt_coeff,
|
win_size, output2[0], output2);
|
||||||
cha_idx,
|
|
||||||
win_size,
|
|
||||||
output2[0],
|
|
||||||
output2);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_all_pass_cascade_process(ia_all_pass_cascade_struct *str_all_pass_cascade,
|
VOID impd_all_pass_cascade_process(
|
||||||
WORD32 ch_idx,
|
ia_all_pass_cascade_struct* str_all_pass_cascade, WORD32 ch_idx,
|
||||||
WORD32 win_size,
|
WORD32 win_size, FLOAT32* input) {
|
||||||
FLOAT32* input)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
||||||
for (i=0; i<str_all_pass_cascade->num_filter; i++)
|
for (i = 0; i < str_all_pass_cascade->num_filter; i++) {
|
||||||
{
|
impd_iir_second_order_filter_all_pass(
|
||||||
impd_iir_second_order_filter_all_pass (&(str_all_pass_cascade->str_all_pass_cascade_filter[i].str_all_pass_stage),
|
&(str_all_pass_cascade->str_all_pass_cascade_filter[i]
|
||||||
ch_idx,
|
.str_all_pass_stage),
|
||||||
win_size,
|
ch_idx, win_size, input, input);
|
||||||
input,
|
|
||||||
input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,15 @@
|
||||||
#define QMF_NUM_FILT_BANDS 64
|
#define QMF_NUM_FILT_BANDS 64
|
||||||
#define QMF_FILT_RESOLUTION 64
|
#define QMF_FILT_RESOLUTION 64
|
||||||
|
|
||||||
|
typedef struct ia_drc_qmf_filt_struct {
|
||||||
|
FLOAT64* ana_buff;
|
||||||
|
FLOAT64* syn_buff;
|
||||||
|
FLOAT64 ana_tab_real[QMF_NUM_FILT_BANDS][2 * QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 ana_tab_imag[QMF_NUM_FILT_BANDS][2 * QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 syn_tab_real[2 * QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 syn_tab_imag[2 * QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
||||||
|
|
||||||
typedef struct ia_drc_qmf_filt_struct
|
} ia_drc_qmf_filt_struct;
|
||||||
{
|
|
||||||
|
|
||||||
FLOAT64* ana_buff;
|
|
||||||
FLOAT64* syn_buff;
|
|
||||||
FLOAT64 ana_tab_real[QMF_NUM_FILT_BANDS][2*QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 ana_tab_imag[QMF_NUM_FILT_BANDS][2*QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 syn_tab_real[2*QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 syn_tab_imag[2*QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
|
||||||
|
|
||||||
}ia_drc_qmf_filt_struct;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FLOAT32 f_cross_norm;
|
FLOAT32 f_cross_norm;
|
||||||
|
|
@ -44,7 +41,6 @@ typedef struct {
|
||||||
FLOAT32 delta;
|
FLOAT32 delta;
|
||||||
} ia_filter_bank_params_struct;
|
} ia_filter_bank_params_struct;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FLOAT32 s00;
|
FLOAT32 s00;
|
||||||
FLOAT32 s01;
|
FLOAT32 s01;
|
||||||
|
|
@ -52,7 +48,6 @@ typedef struct {
|
||||||
FLOAT32 s11;
|
FLOAT32 s11;
|
||||||
} ia_lr_filter_state_struct;
|
} ia_lr_filter_state_struct;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FLOAT32 s0;
|
FLOAT32 s0;
|
||||||
FLOAT32 s1;
|
FLOAT32 s1;
|
||||||
|
|
@ -65,8 +60,8 @@ typedef struct {
|
||||||
FLOAT32 b0;
|
FLOAT32 b0;
|
||||||
FLOAT32 b1;
|
FLOAT32 b1;
|
||||||
FLOAT32 b2;
|
FLOAT32 b2;
|
||||||
FLOAT32 x_p[MAX_CHANNEL_COUNT*2];
|
FLOAT32 x_p[MAX_CHANNEL_COUNT * 2];
|
||||||
FLOAT32 y_p[MAX_CHANNEL_COUNT*2];
|
FLOAT32 y_p[MAX_CHANNEL_COUNT * 2];
|
||||||
} ia_iir_filter_struct;
|
} ia_iir_filter_struct;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_iir_filter_struct low_pass;
|
ia_iir_filter_struct low_pass;
|
||||||
|
|
@ -97,7 +92,8 @@ typedef struct {
|
||||||
} ia_all_pass_filter_sturct;
|
} ia_all_pass_filter_sturct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_all_pass_filter_sturct str_all_pass_cascade_filter[CASCADE_ALLPASS_COUNT_MAX];
|
ia_all_pass_filter_sturct
|
||||||
|
str_all_pass_cascade_filter[CASCADE_ALLPASS_COUNT_MAX];
|
||||||
WORD32 num_filter;
|
WORD32 num_filter;
|
||||||
} ia_all_pass_cascade_struct;
|
} ia_all_pass_cascade_struct;
|
||||||
|
|
||||||
|
|
@ -117,49 +113,38 @@ typedef struct {
|
||||||
ia_drc_filter_bank_struct str_drc_filter_bank[8];
|
ia_drc_filter_bank_struct str_drc_filter_bank[8];
|
||||||
} ia_filter_banks_struct;
|
} ia_filter_banks_struct;
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
impd_init_all_filter_banks(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct);
|
ia_filter_banks_struct* ia_filter_banks_struct);
|
||||||
|
|
||||||
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
VOID impd_two_band_filter_process(ia_two_band_filt_struct* str_two_band_bank,
|
||||||
WORD32 c,
|
WORD32 c, WORD32 size, FLOAT32* audio_in,
|
||||||
WORD32 size,
|
|
||||||
FLOAT32* audio_in,
|
|
||||||
FLOAT32* audio_out[]);
|
FLOAT32* audio_out[]);
|
||||||
|
|
||||||
VOID impd_three_band_filter_process(ia_three_band_filt_struct* str_three_band_bank,
|
VOID impd_three_band_filter_process(
|
||||||
WORD32 c,
|
ia_three_band_filt_struct* str_three_band_bank, WORD32 c, WORD32 size,
|
||||||
WORD32 size,
|
FLOAT32* audio_in, FLOAT32* audio_out[]);
|
||||||
FLOAT32* audio_in,
|
|
||||||
FLOAT32* audio_out[]);
|
|
||||||
|
|
||||||
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
WORD32 c,
|
WORD32 c, WORD32 size, FLOAT32* audio_in,
|
||||||
WORD32 size,
|
|
||||||
FLOAT32* audio_in,
|
|
||||||
FLOAT32* audio_out[]);
|
FLOAT32* audio_out[]);
|
||||||
|
|
||||||
VOID impd_all_pass_cascade_process(ia_all_pass_cascade_struct *str_all_pass_cascade,
|
VOID impd_all_pass_cascade_process(
|
||||||
WORD32 c,
|
ia_all_pass_cascade_struct* str_all_pass_cascade, WORD32 c, WORD32 size,
|
||||||
WORD32 size,
|
|
||||||
FLOAT32* audio_in);
|
FLOAT32* audio_in);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_shape_filt_block_init(ia_shape_filter_block_params_struct* pstr_shape_filter_block_params,
|
impd_shape_filt_block_init(
|
||||||
|
ia_shape_filter_block_params_struct* pstr_shape_filter_block_params,
|
||||||
shape_filter_block* shape_filter_block);
|
shape_filter_block* shape_filter_block);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
|
impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
|
||||||
shape_filter_block* shape_filter_block);
|
shape_filter_block* shape_filter_block);
|
||||||
|
|
||||||
|
WORD32 impd_shape_filt_block_time_process(
|
||||||
|
shape_filter_block* shape_filter_block, FLOAT32* drc_gain,
|
||||||
WORD32 impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block,
|
const WORD32 channel, FLOAT32* audio_in, WORD32 start, WORD32 end);
|
||||||
FLOAT32* drc_gain,
|
|
||||||
const WORD32 channel,
|
|
||||||
FLOAT32 *audio_in,
|
|
||||||
WORD32 start,
|
|
||||||
WORD32 end);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -21,8 +21,7 @@
|
||||||
#define IMPD_DRC_GAIN_DEC_H
|
#define IMPD_DRC_GAIN_DEC_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -66,7 +65,6 @@ typedef struct {
|
||||||
FLOAT32 boost;
|
FLOAT32 boost;
|
||||||
} ia_interp_params_struct;
|
} ia_interp_params_struct;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_instructions_index;
|
WORD32 drc_instructions_index;
|
||||||
WORD32 drc_coeff_idx;
|
WORD32 drc_coeff_idx;
|
||||||
|
|
@ -90,7 +88,6 @@ typedef struct {
|
||||||
|
|
||||||
} ia_drc_params_struct;
|
} ia_drc_params_struct;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -38,436 +38,442 @@
|
||||||
#include "impd_drc_gain_decoder.h"
|
#include "impd_drc_gain_decoder.h"
|
||||||
#include "impd_drc_dec.h"
|
#include "impd_drc_dec.h"
|
||||||
|
|
||||||
IA_ERRORCODE impd_init_drc_decode( WORD32 frame_size,
|
IA_ERRORCODE impd_init_drc_decode(
|
||||||
WORD32 sample_rate,
|
WORD32 frame_size, WORD32 sample_rate, WORD32 gain_delay_samples,
|
||||||
WORD32 gain_delay_samples,
|
WORD32 delay_mode, WORD32 sub_band_domain_mode,
|
||||||
WORD32 delay_mode,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs) {
|
||||||
WORD32 sub_band_domain_mode,
|
|
||||||
ia_drc_gain_dec_struct* p_drc_gain_dec_structs)
|
|
||||||
{
|
|
||||||
IA_ERRORCODE err_code = IA_NO_ERROR;
|
IA_ERRORCODE err_code = IA_NO_ERROR;
|
||||||
|
|
||||||
|
err_code = impd_init_drc_params(
|
||||||
|
frame_size, sample_rate, gain_delay_samples, delay_mode,
|
||||||
|
sub_band_domain_mode, &p_drc_gain_dec_structs->ia_drc_params_struct);
|
||||||
|
|
||||||
err_code = impd_init_drc_params(frame_size,
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
sample_rate,
|
|
||||||
gain_delay_samples,
|
|
||||||
delay_mode,
|
|
||||||
sub_band_domain_mode,
|
|
||||||
&p_drc_gain_dec_structs->ia_drc_params_struct);
|
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
impd_init_parametric_drc(
|
||||||
return (err_code);
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size, sample_rate,
|
||||||
|
sub_band_domain_mode, &p_drc_gain_dec_structs->parametricdrc_params);
|
||||||
|
|
||||||
impd_init_parametric_drc(p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size,
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
sample_rate,
|
|
||||||
sub_band_domain_mode,
|
|
||||||
&p_drc_gain_dec_structs->parametricdrc_params);
|
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_init_drc_decode_post_config(
|
||||||
IA_ERRORCODE impd_init_drc_decode_post_config(WORD32 audio_num_chan,
|
WORD32 audio_num_chan, WORD32* drc_set_id_processed,
|
||||||
WORD32* drc_set_id_processed,
|
WORD32* downmix_id_processed, WORD32 num_sets_processed,
|
||||||
WORD32* downmix_id_processed,
|
|
||||||
WORD32 num_sets_processed,
|
|
||||||
WORD32 eq_set_id_processed,
|
WORD32 eq_set_id_processed,
|
||||||
|
|
||||||
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info, pVOID* mem_ptr) {
|
||||||
pVOID *mem_ptr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
IA_ERRORCODE err_code = 0;
|
IA_ERRORCODE err_code = 0;
|
||||||
WORD32 i,j,k, maxMultibandAudioSignalCount=0;
|
WORD32 i, j, k, maxMultibandAudioSignalCount = 0;
|
||||||
ia_drc_params_struct* p_drc_params_struct = &p_drc_gain_dec_structs->ia_drc_params_struct;
|
ia_drc_params_struct* p_drc_params_struct =
|
||||||
ia_audio_in_out_buf* p_audio_in_out_buf = &p_drc_gain_dec_structs->audio_in_out_buf;
|
&p_drc_gain_dec_structs->ia_drc_params_struct;
|
||||||
|
ia_audio_in_out_buf* p_audio_in_out_buf =
|
||||||
|
&p_drc_gain_dec_structs->audio_in_out_buf;
|
||||||
|
|
||||||
for (i = 0; i < num_sets_processed; i++)
|
for (i = 0; i < num_sets_processed; i++) {
|
||||||
{
|
err_code = impd_init_selected_drc_set(
|
||||||
err_code = impd_init_selected_drc_set(pstr_drc_config,
|
pstr_drc_config, p_drc_params_struct,
|
||||||
p_drc_params_struct,
|
&p_drc_gain_dec_structs->parametricdrc_params, audio_num_chan,
|
||||||
&p_drc_gain_dec_structs->parametricdrc_params,
|
drc_set_id_processed[i], downmix_id_processed[i],
|
||||||
audio_num_chan,
|
|
||||||
drc_set_id_processed[i],
|
|
||||||
downmix_id_processed[i],
|
|
||||||
&p_drc_gain_dec_structs->ia_filter_banks_struct,
|
&p_drc_gain_dec_structs->ia_filter_banks_struct,
|
||||||
&p_drc_gain_dec_structs->str_overlap_params
|
&p_drc_gain_dec_structs->str_overlap_params,
|
||||||
,p_drc_gain_dec_structs->shape_filter_block
|
p_drc_gain_dec_structs->shape_filter_block);
|
||||||
);
|
if (err_code) return (err_code);
|
||||||
if (err_code)
|
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p_drc_gain_dec_structs->audio_num_chan = audio_num_chan;
|
p_drc_gain_dec_structs->audio_num_chan = audio_num_chan;
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.audio_delay_samples = p_drc_gain_dec_structs->ia_drc_params_struct.parametric_drc_delay;
|
p_drc_gain_dec_structs->ia_drc_params_struct.audio_delay_samples =
|
||||||
|
p_drc_gain_dec_structs->ia_drc_params_struct.parametric_drc_delay;
|
||||||
if (pstr_drc_config->str_drc_config_ext.parametric_drc_present) {
|
if (pstr_drc_config->str_drc_config_ext.parametric_drc_present) {
|
||||||
err_code = impd_init_parametric_drc_after_config(pstr_drc_config,
|
err_code = impd_init_parametric_drc_after_config(
|
||||||
pstr_loudness_info,
|
pstr_drc_config, pstr_loudness_info,
|
||||||
&p_drc_gain_dec_structs->parametricdrc_params,
|
&p_drc_gain_dec_structs->parametricdrc_params, mem_ptr);
|
||||||
mem_ptr);
|
if (err_code) return (err_code);
|
||||||
if (err_code)
|
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p_audio_in_out_buf->audio_num_chan = audio_num_chan;
|
p_audio_in_out_buf->audio_num_chan = audio_num_chan;
|
||||||
p_audio_in_out_buf->audio_delay_samples = p_drc_params_struct->audio_delay_samples;
|
p_audio_in_out_buf->audio_delay_samples =
|
||||||
|
p_drc_params_struct->audio_delay_samples;
|
||||||
p_audio_in_out_buf->frame_size = p_drc_params_struct->drc_frame_size;
|
p_audio_in_out_buf->frame_size = p_drc_params_struct->drc_frame_size;
|
||||||
|
|
||||||
|
if (p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_QMF64) {
|
||||||
if(p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_QMF64){
|
p_audio_in_out_buf->audio_delay_sub_band_samples =
|
||||||
p_audio_in_out_buf->audio_delay_sub_band_samples = p_drc_params_struct->audio_delay_samples / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
p_drc_params_struct->audio_delay_samples /
|
||||||
p_audio_in_out_buf->audio_sub_band_frame_size = p_drc_params_struct->drc_frame_size / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
|
p_audio_in_out_buf->audio_sub_band_frame_size =
|
||||||
|
p_drc_params_struct->drc_frame_size /
|
||||||
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
p_audio_in_out_buf->audio_sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
p_audio_in_out_buf->audio_sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF64;
|
||||||
}
|
} else if (p_drc_params_struct->sub_band_domain_mode ==
|
||||||
else if(p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_QMF71){
|
SUBBAND_DOMAIN_MODE_QMF71) {
|
||||||
p_audio_in_out_buf->audio_delay_sub_band_samples = p_drc_params_struct->audio_delay_samples / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
p_audio_in_out_buf->audio_delay_sub_band_samples =
|
||||||
p_audio_in_out_buf->audio_sub_band_frame_size = p_drc_params_struct->drc_frame_size / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
p_drc_params_struct->audio_delay_samples /
|
||||||
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
||||||
|
p_audio_in_out_buf->audio_sub_band_frame_size =
|
||||||
|
p_drc_params_struct->drc_frame_size /
|
||||||
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
||||||
p_audio_in_out_buf->audio_sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF71;
|
p_audio_in_out_buf->audio_sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_QMF71;
|
||||||
}
|
} else if (p_drc_params_struct->sub_band_domain_mode ==
|
||||||
else if(p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_STFT256){
|
SUBBAND_DOMAIN_MODE_STFT256) {
|
||||||
p_audio_in_out_buf->audio_delay_sub_band_samples = p_drc_params_struct->audio_delay_samples / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
p_audio_in_out_buf->audio_delay_sub_band_samples =
|
||||||
p_audio_in_out_buf->audio_sub_band_frame_size = p_drc_params_struct->drc_frame_size / AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
p_drc_params_struct->audio_delay_samples /
|
||||||
p_audio_in_out_buf->audio_sub_band_count = AUDIO_CODEC_SUBBAND_COUNT_STFT256;
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
||||||
}
|
p_audio_in_out_buf->audio_sub_band_frame_size =
|
||||||
else{
|
p_drc_params_struct->drc_frame_size /
|
||||||
|
AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
||||||
|
p_audio_in_out_buf->audio_sub_band_count =
|
||||||
|
AUDIO_CODEC_SUBBAND_COUNT_STFT256;
|
||||||
|
} else {
|
||||||
p_audio_in_out_buf->audio_delay_sub_band_samples = 0;
|
p_audio_in_out_buf->audio_delay_sub_band_samples = 0;
|
||||||
p_audio_in_out_buf->audio_sub_band_frame_size = 0;
|
p_audio_in_out_buf->audio_sub_band_frame_size = 0;
|
||||||
p_audio_in_out_buf->audio_sub_band_count = 0;
|
p_audio_in_out_buf->audio_sub_band_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (k = 0; k < SEL_DRC_COUNT; k++) {
|
||||||
|
if (p_drc_params_struct->sel_drc_array[k].drc_instructions_index >= 0) {
|
||||||
|
ia_drc_instructions_struct* drc_instruction_str =
|
||||||
|
&(pstr_drc_config->str_drc_instruction_str
|
||||||
|
[p_drc_params_struct->sel_drc_array[k].drc_instructions_index]);
|
||||||
|
if (drc_instruction_str->gain_element_count > 0) {
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
|
||||||
|
.buf_interpolation = (ia_interp_buf_struct*)*mem_ptr;
|
||||||
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
drc_instruction_str->gain_element_count *
|
||||||
|
sizeof(ia_interp_buf_struct) +
|
||||||
|
32);
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
|
||||||
|
.buf_interpolation_count = drc_instruction_str->gain_element_count;
|
||||||
|
for (i = 0;
|
||||||
|
i < p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
|
.buf_interpolation_count;
|
||||||
|
i++) {
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
|
.buf_interpolation[i]
|
||||||
|
.str_node.time = 0;
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
|
.buf_interpolation[i]
|
||||||
|
.prev_node.time = -1;
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
|
.buf_interpolation[i]
|
||||||
|
.str_node.loc_db_gain = 0.0f;
|
||||||
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
|
.buf_interpolation[i]
|
||||||
|
.str_node.slope = 0.0f;
|
||||||
|
|
||||||
|
for (j = 0; j < 2 * AUDIO_CODEC_FRAME_SIZE_MAX + MAX_SIGNAL_DELAY;
|
||||||
|
j++) {
|
||||||
for (k=0; k<SEL_DRC_COUNT; k++)
|
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
|
||||||
{
|
.buf_interpolation[i]
|
||||||
if (p_drc_params_struct->sel_drc_array[k].drc_instructions_index >= 0)
|
.lpcm_gains[j] = 1.f;
|
||||||
{
|
|
||||||
ia_drc_instructions_struct* drc_instruction_str = &(pstr_drc_config->str_drc_instruction_str[p_drc_params_struct->sel_drc_array[k].drc_instructions_index]);
|
|
||||||
if (drc_instruction_str->gain_element_count > 0)
|
|
||||||
{
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k].buf_interpolation = (ia_interp_buf_struct*)*mem_ptr;
|
|
||||||
*mem_ptr=(pVOID)((SIZE_T)*mem_ptr+drc_instruction_str->gain_element_count*sizeof(ia_interp_buf_struct)+32);
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k].buf_interpolation_count = drc_instruction_str->gain_element_count;
|
|
||||||
for (i=0; i<p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation_count; i++)
|
|
||||||
{
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation[i].str_node.time = 0;
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation[i].prev_node.time = -1;
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation[i].str_node.loc_db_gain = 0.0f;
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation[i].str_node.slope = 0.0f;
|
|
||||||
|
|
||||||
for (j=0; j<2 * AUDIO_CODEC_FRAME_SIZE_MAX + MAX_SIGNAL_DELAY; j++)
|
|
||||||
{
|
|
||||||
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation[i].lpcm_gains[j] = 1.f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eq_set_id_processed > 0) {
|
||||||
|
for (i = 0; i < pstr_drc_config->str_drc_config_ext.eq_instructions_count;
|
||||||
|
i++) {
|
||||||
if (eq_set_id_processed > 0)
|
if (pstr_drc_config->str_drc_config_ext.str_eq_instructions[i]
|
||||||
{
|
.eq_set_id == eq_set_id_processed)
|
||||||
for(i=0; i<pstr_drc_config->str_drc_config_ext.eq_instructions_count; i++)
|
|
||||||
{
|
|
||||||
if (pstr_drc_config->str_drc_config_ext.str_eq_instructions[i].eq_set_id == eq_set_id_processed)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==pstr_drc_config->str_drc_config_ext.eq_instructions_count)
|
if (i == pstr_drc_config->str_drc_config_ext.eq_instructions_count) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_drc_gain_dec_structs->eq_set = (ia_eq_set_struct*)*mem_ptr;
|
||||||
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr + sizeof(ia_eq_set_struct) + 32);
|
||||||
|
|
||||||
p_drc_gain_dec_structs->eq_set=(ia_eq_set_struct*)*mem_ptr ;
|
if (err_code) return (err_code);
|
||||||
*mem_ptr=(pVOID)((SIZE_T)*mem_ptr+sizeof(ia_eq_set_struct)+32);
|
|
||||||
|
|
||||||
if (err_code)
|
err_code = impd_derive_eq_set(
|
||||||
return (err_code);
|
&pstr_drc_config->str_drc_config_ext.str_eq_coeff,
|
||||||
|
|
||||||
err_code = impd_derive_eq_set (&pstr_drc_config->str_drc_config_ext.str_eq_coeff,
|
|
||||||
&(pstr_drc_config->str_drc_config_ext.str_eq_instructions[i]),
|
&(pstr_drc_config->str_drc_config_ext.str_eq_instructions[i]),
|
||||||
(FLOAT32)p_drc_gain_dec_structs->ia_drc_params_struct.sample_rate,
|
(FLOAT32)p_drc_gain_dec_structs->ia_drc_params_struct.sample_rate,
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size,
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size,
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.sub_band_domain_mode,
|
p_drc_gain_dec_structs->ia_drc_params_struct.sub_band_domain_mode,
|
||||||
p_drc_gain_dec_structs->eq_set);
|
p_drc_gain_dec_structs->eq_set);
|
||||||
if (err_code)
|
if (err_code) return (err_code);
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
impd_get_eq_set_delay (p_drc_gain_dec_structs->eq_set,
|
impd_get_eq_set_delay(
|
||||||
|
p_drc_gain_dec_structs->eq_set,
|
||||||
&p_drc_gain_dec_structs->ia_drc_params_struct.eq_delay);
|
&p_drc_gain_dec_structs->ia_drc_params_struct.eq_delay);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < p_drc_params_struct->drc_set_counter; i++) {
|
||||||
|
|
||||||
for (i=0; i<p_drc_params_struct->drc_set_counter; i++)
|
|
||||||
{
|
|
||||||
ia_drc_instructions_struct* drc_instruction_str;
|
ia_drc_instructions_struct* drc_instruction_str;
|
||||||
drc_instruction_str = &(pstr_drc_config->str_drc_instruction_str[p_drc_params_struct->sel_drc_array[i].drc_instructions_index]);
|
drc_instruction_str =
|
||||||
maxMultibandAudioSignalCount = max(maxMultibandAudioSignalCount, drc_instruction_str->multiband_audio_sig_count);
|
&(pstr_drc_config->str_drc_instruction_str
|
||||||
|
[p_drc_params_struct->sel_drc_array[i].drc_instructions_index]);
|
||||||
|
maxMultibandAudioSignalCount =
|
||||||
|
max(maxMultibandAudioSignalCount,
|
||||||
|
drc_instruction_str->multiband_audio_sig_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio = *mem_ptr;
|
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ((SIZE_T)*mem_ptr+(maxMultibandAudioSignalCount*sizeof(FLOAT32*))+32);
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(maxMultibandAudioSignalCount * sizeof(FLOAT32*)) + 32);
|
||||||
|
|
||||||
|
|
||||||
for (i=0;i<maxMultibandAudioSignalCount; i++)
|
|
||||||
{
|
|
||||||
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio[i] = *mem_ptr;
|
|
||||||
*mem_ptr = (pVOID) ( (SIZE_T)*mem_ptr+(p_drc_params_struct->drc_frame_size*sizeof(FLOAT32))+32);
|
|
||||||
|
|
||||||
|
for (i = 0; i < maxMultibandAudioSignalCount; i++) {
|
||||||
|
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio[i] =
|
||||||
|
*mem_ptr;
|
||||||
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_drc_params_struct->drc_frame_size * sizeof(FLOAT32)) + 32);
|
||||||
}
|
}
|
||||||
p_drc_gain_dec_structs->audio_band_buffer.multiband_audio_sig_count = maxMultibandAudioSignalCount;
|
p_drc_gain_dec_structs->audio_band_buffer.multiband_audio_sig_count =
|
||||||
p_drc_gain_dec_structs->audio_band_buffer.frame_size = p_drc_params_struct->drc_frame_size;;
|
maxMultibandAudioSignalCount;
|
||||||
|
p_drc_gain_dec_structs->audio_band_buffer.frame_size =
|
||||||
|
p_drc_params_struct->drc_frame_size;
|
||||||
|
;
|
||||||
|
|
||||||
|
if (p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_OFF &&
|
||||||
if (p_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_OFF && p_audio_in_out_buf->audio_delay_samples) {
|
p_audio_in_out_buf->audio_delay_samples) {
|
||||||
p_audio_in_out_buf->audio_io_buffer_delayed = *mem_ptr;
|
p_audio_in_out_buf->audio_io_buffer_delayed = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ( (SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
p_audio_in_out_buf->audio_in_out_buf = *mem_ptr;
|
p_audio_in_out_buf->audio_in_out_buf = *mem_ptr;
|
||||||
*mem_ptr =(pVOID) ( (SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
for (i=0; i<p_audio_in_out_buf->audio_num_chan; i++) {
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
p_audio_in_out_buf->audio_io_buffer_delayed[i]=*mem_ptr;
|
|
||||||
*mem_ptr = (pVOID) ((SIZE_T)*mem_ptr+((p_audio_in_out_buf->frame_size + p_audio_in_out_buf->audio_delay_samples)*sizeof(FLOAT32*))+32);
|
|
||||||
p_audio_in_out_buf->audio_in_out_buf[i] = &p_audio_in_out_buf->audio_io_buffer_delayed[i][p_audio_in_out_buf->audio_delay_samples];
|
|
||||||
|
|
||||||
|
for (i = 0; i < p_audio_in_out_buf->audio_num_chan; i++) {
|
||||||
|
p_audio_in_out_buf->audio_io_buffer_delayed[i] = *mem_ptr;
|
||||||
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
((p_audio_in_out_buf->frame_size +
|
||||||
|
p_audio_in_out_buf->audio_delay_samples) *
|
||||||
|
sizeof(FLOAT32*)) +
|
||||||
|
32);
|
||||||
|
p_audio_in_out_buf->audio_in_out_buf[i] =
|
||||||
|
&p_audio_in_out_buf->audio_io_buffer_delayed
|
||||||
|
[i][p_audio_in_out_buf->audio_delay_samples];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p_drc_params_struct->sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF && p_audio_in_out_buf->audio_delay_sub_band_samples) {
|
if (p_drc_params_struct->sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF &&
|
||||||
|
p_audio_in_out_buf->audio_delay_sub_band_samples) {
|
||||||
p_audio_in_out_buf->audio_buffer_delayed_real = *mem_ptr;
|
p_audio_in_out_buf->audio_buffer_delayed_real = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ((SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
p_audio_in_out_buf->audio_buffer_delayed_imag = *mem_ptr;
|
p_audio_in_out_buf->audio_buffer_delayed_imag = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ( (SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
p_audio_in_out_buf->audio_real_buff = *mem_ptr;
|
p_audio_in_out_buf->audio_real_buff = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ((SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
p_audio_in_out_buf->audio_imag_buff = *mem_ptr;
|
p_audio_in_out_buf->audio_imag_buff = *mem_ptr;
|
||||||
*mem_ptr = (pVOID) ( (SIZE_T)*mem_ptr+(p_audio_in_out_buf->audio_num_chan*sizeof(FLOAT32*))+32);
|
*mem_ptr =
|
||||||
|
(pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
(p_audio_in_out_buf->audio_num_chan * sizeof(FLOAT32*)) + 32);
|
||||||
|
|
||||||
|
for (i = 0; i < p_audio_in_out_buf->audio_num_chan; i++) {
|
||||||
for (i=0; i<p_audio_in_out_buf->audio_num_chan; i++) {
|
|
||||||
p_audio_in_out_buf->audio_buffer_delayed_real[i] = *mem_ptr;
|
p_audio_in_out_buf->audio_buffer_delayed_real[i] = *mem_ptr;
|
||||||
*mem_ptr =(pVOID) ((SIZE_T)*mem_ptr+(( p_audio_in_out_buf->audio_sub_band_frame_size + p_audio_in_out_buf->audio_delay_sub_band_samples)*sizeof(FLOAT32*))+32);
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
((p_audio_in_out_buf->audio_sub_band_frame_size +
|
||||||
|
p_audio_in_out_buf->audio_delay_sub_band_samples) *
|
||||||
|
sizeof(FLOAT32*)) +
|
||||||
|
32);
|
||||||
p_audio_in_out_buf->audio_buffer_delayed_imag[i] = *mem_ptr;
|
p_audio_in_out_buf->audio_buffer_delayed_imag[i] = *mem_ptr;
|
||||||
*mem_ptr =(pVOID) ((SIZE_T)*mem_ptr+(( p_audio_in_out_buf->audio_sub_band_frame_size + p_audio_in_out_buf->audio_delay_sub_band_samples)*sizeof(FLOAT32*))+32);
|
*mem_ptr = (pVOID)((SIZE_T)*mem_ptr +
|
||||||
|
((p_audio_in_out_buf->audio_sub_band_frame_size +
|
||||||
|
p_audio_in_out_buf->audio_delay_sub_band_samples) *
|
||||||
|
sizeof(FLOAT32*)) +
|
||||||
|
32);
|
||||||
|
|
||||||
p_audio_in_out_buf->audio_real_buff[i] = &p_audio_in_out_buf->audio_buffer_delayed_real[i][ p_audio_in_out_buf->audio_delay_sub_band_samples * p_audio_in_out_buf->audio_sub_band_count];
|
p_audio_in_out_buf->audio_real_buff[i] =
|
||||||
p_audio_in_out_buf->audio_imag_buff[i] = &p_audio_in_out_buf->audio_buffer_delayed_imag[i][ p_audio_in_out_buf->audio_delay_sub_band_samples * p_audio_in_out_buf->audio_sub_band_count];
|
&p_audio_in_out_buf->audio_buffer_delayed_real
|
||||||
|
[i][p_audio_in_out_buf->audio_delay_sub_band_samples *
|
||||||
|
p_audio_in_out_buf->audio_sub_band_count];
|
||||||
|
p_audio_in_out_buf->audio_imag_buff[i] =
|
||||||
|
&p_audio_in_out_buf->audio_buffer_delayed_imag
|
||||||
|
[i][p_audio_in_out_buf->audio_delay_sub_band_samples *
|
||||||
|
p_audio_in_out_buf->audio_sub_band_count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_process_time_domain(
|
||||||
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
|
ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
|
||||||
|
FLOAT32* audio_in_out_buf[], FLOAT32 loudness_normalization_gain_db,
|
||||||
IA_ERRORCODE impd_drc_process_time_domain( ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
FLOAT32 boost, FLOAT32 compress, WORD32 drc_characteristic_target) {
|
||||||
ia_drc_config* pstr_drc_config,
|
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
|
||||||
FLOAT32* audio_in_out_buf[],
|
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
|
||||||
FLOAT32 boost,
|
|
||||||
FLOAT32 compress,
|
|
||||||
WORD32 drc_characteristic_target)
|
|
||||||
{
|
|
||||||
WORD32 sel_drc_index;
|
WORD32 sel_drc_index;
|
||||||
IA_ERRORCODE err_code = 0;
|
IA_ERRORCODE err_code = 0;
|
||||||
WORD32 passThru;
|
WORD32 passThru;
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str = pstr_drc_config->str_drc_instruction_str;
|
ia_drc_instructions_struct* str_drc_instruction_str =
|
||||||
|
pstr_drc_config->str_drc_instruction_str;
|
||||||
|
|
||||||
if (p_drc_gain_dec_structs->eq_set)
|
if (p_drc_gain_dec_structs->eq_set) {
|
||||||
{
|
|
||||||
WORD32 ch;
|
WORD32 ch;
|
||||||
FLOAT32* audio_channel;
|
FLOAT32* audio_channel;
|
||||||
for (ch=0; ch<p_drc_gain_dec_structs->eq_set->audio_num_chan; ch++)
|
for (ch = 0; ch < p_drc_gain_dec_structs->eq_set->audio_num_chan; ch++) {
|
||||||
{
|
|
||||||
audio_channel = audio_in_out_buf[ch];
|
audio_channel = audio_in_out_buf[ch];
|
||||||
|
|
||||||
impd_process_eq_set_time_domain(p_drc_gain_dec_structs->eq_set, ch, audio_channel, audio_channel, p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size);
|
impd_process_eq_set_time_domain(
|
||||||
|
p_drc_gain_dec_structs->eq_set, ch, audio_channel, audio_channel,
|
||||||
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_frame_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_store_audio_io_buffer_time(audio_in_out_buf,
|
err_code = impd_store_audio_io_buffer_time(
|
||||||
&p_drc_gain_dec_structs->audio_in_out_buf);
|
audio_in_out_buf, &p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
if(err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
if (pstr_drc_config->apply_drc)
|
if (pstr_drc_config->apply_drc) {
|
||||||
{
|
for (sel_drc_index = 0;
|
||||||
for (sel_drc_index=0; sel_drc_index<p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter; sel_drc_index++)
|
sel_drc_index <
|
||||||
{
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter;
|
||||||
err_code = impd_get_drc_gain (p_drc_gain_dec_structs,
|
sel_drc_index++) {
|
||||||
pstr_drc_config,
|
err_code = impd_get_drc_gain(
|
||||||
pstr_drc_gain,
|
p_drc_gain_dec_structs, pstr_drc_config, pstr_drc_gain, compress,
|
||||||
compress,
|
boost, drc_characteristic_target, loudness_normalization_gain_db,
|
||||||
boost,
|
sel_drc_index, &p_drc_gain_dec_structs->drc_gain_buffers);
|
||||||
drc_characteristic_target,
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
loudness_normalization_gain_db,
|
|
||||||
sel_drc_index,
|
|
||||||
&p_drc_gain_dec_structs->drc_gain_buffers);
|
|
||||||
if(err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter == 0)
|
if (p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter == 0) {
|
||||||
{
|
err_code = impd_retrieve_audio_io_buffer_time(
|
||||||
err_code = impd_retrieve_audio_io_buffer_time(audio_in_out_buf,
|
audio_in_out_buf, &p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
&p_drc_gain_dec_structs->audio_in_out_buf);
|
|
||||||
if (err_code) return (err_code);
|
if (err_code) return (err_code);
|
||||||
} else
|
} else {
|
||||||
{
|
for (sel_drc_index = 0;
|
||||||
|
sel_drc_index <
|
||||||
for (sel_drc_index=0; sel_drc_index<p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter; sel_drc_index++)
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter;
|
||||||
{
|
sel_drc_index++) {
|
||||||
if (p_drc_gain_dec_structs->ia_drc_params_struct.multiband_sel_drc_idx == sel_drc_index)
|
if (p_drc_gain_dec_structs->ia_drc_params_struct
|
||||||
{
|
.multiband_sel_drc_idx == sel_drc_index) {
|
||||||
passThru = 0;
|
passThru = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
passThru = 1;
|
passThru = 1;
|
||||||
}
|
}
|
||||||
err_code = impd_filter_banks_process(str_drc_instruction_str,
|
err_code = impd_filter_banks_process(
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.sel_drc_array[sel_drc_index].drc_instructions_index,
|
str_drc_instruction_str,
|
||||||
|
p_drc_gain_dec_structs->ia_drc_params_struct
|
||||||
|
.sel_drc_array[sel_drc_index]
|
||||||
|
.drc_instructions_index,
|
||||||
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
||||||
p_drc_gain_dec_structs->audio_in_out_buf.audio_io_buffer_delayed,
|
p_drc_gain_dec_structs->audio_in_out_buf.audio_io_buffer_delayed,
|
||||||
&p_drc_gain_dec_structs->audio_band_buffer,
|
&p_drc_gain_dec_structs->audio_band_buffer,
|
||||||
&p_drc_gain_dec_structs->ia_filter_banks_struct,
|
&p_drc_gain_dec_structs->ia_filter_banks_struct, passThru);
|
||||||
passThru);
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
if(err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
err_code = impd_apply_gains_and_add(str_drc_instruction_str,
|
err_code = impd_apply_gains_and_add(
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.sel_drc_array[sel_drc_index].drc_instructions_index,
|
str_drc_instruction_str,
|
||||||
|
p_drc_gain_dec_structs->ia_drc_params_struct
|
||||||
|
.sel_drc_array[sel_drc_index]
|
||||||
|
.drc_instructions_index,
|
||||||
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
||||||
&(p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[sel_drc_index]),
|
&(p_drc_gain_dec_structs->drc_gain_buffers
|
||||||
|
.pstr_gain_buf[sel_drc_index]),
|
||||||
p_drc_gain_dec_structs->shape_filter_block,
|
p_drc_gain_dec_structs->shape_filter_block,
|
||||||
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio,
|
p_drc_gain_dec_structs->audio_band_buffer.non_interleaved_audio,
|
||||||
audio_in_out_buf,
|
audio_in_out_buf, 1);
|
||||||
1);
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
if(err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_advance_audio_io_buffer_time(&p_drc_gain_dec_structs->audio_in_out_buf);
|
err_code = impd_advance_audio_io_buffer_time(
|
||||||
if(err_code!=IA_NO_ERROR)
|
&p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
return (err_code);
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_process_freq_domain(
|
||||||
IA_ERRORCODE impd_drc_process_freq_domain( ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
FLOAT32* audio_real_buff[], FLOAT32* audio_imag_buff[],
|
||||||
FLOAT32* audio_real_buff[],
|
FLOAT32 loudness_normalization_gain_db, FLOAT32 boost, FLOAT32 compress,
|
||||||
FLOAT32* audio_imag_buff[],
|
WORD32 drc_characteristic_target) {
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
|
||||||
FLOAT32 boost,
|
|
||||||
FLOAT32 compress,
|
|
||||||
WORD32 drc_characteristic_target)
|
|
||||||
{
|
|
||||||
WORD32 sel_drc_index;
|
WORD32 sel_drc_index;
|
||||||
IA_ERRORCODE err_code = 0;
|
IA_ERRORCODE err_code = 0;
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str = pstr_drc_config->str_drc_instruction_str;
|
ia_drc_instructions_struct* str_drc_instruction_str =
|
||||||
|
pstr_drc_config->str_drc_instruction_str;
|
||||||
|
|
||||||
if (p_drc_gain_dec_structs->eq_set)
|
if (p_drc_gain_dec_structs->eq_set) {
|
||||||
{
|
|
||||||
WORD32 ch;
|
WORD32 ch;
|
||||||
|
|
||||||
for (ch=0; ch<p_drc_gain_dec_structs->eq_set->audio_num_chan; ch++)
|
for (ch = 0; ch < p_drc_gain_dec_structs->eq_set->audio_num_chan; ch++) {
|
||||||
{
|
err_code = impd_process_eq_set_subband_domain(
|
||||||
err_code = impd_process_eq_set_subband_domain(p_drc_gain_dec_structs->eq_set,
|
p_drc_gain_dec_structs->eq_set, ch, audio_real_buff[ch],
|
||||||
ch,
|
|
||||||
audio_real_buff[ch],
|
|
||||||
audio_imag_buff[ch]);
|
audio_imag_buff[ch]);
|
||||||
if(err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err_code = impd_store_audio_io_buffer_freq(audio_real_buff,
|
err_code = impd_store_audio_io_buffer_freq(
|
||||||
audio_imag_buff,
|
audio_real_buff, audio_imag_buff,
|
||||||
&p_drc_gain_dec_structs->audio_in_out_buf);
|
&p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
if(err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
return (err_code);
|
|
||||||
|
|
||||||
if (pstr_drc_config->apply_drc)
|
if (pstr_drc_config->apply_drc) {
|
||||||
{
|
for (sel_drc_index = 0;
|
||||||
for (sel_drc_index=0; sel_drc_index<p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter; sel_drc_index++)
|
sel_drc_index <
|
||||||
{
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter;
|
||||||
|
sel_drc_index++) {
|
||||||
err_code = impd_get_drc_gain (p_drc_gain_dec_structs,
|
err_code = impd_get_drc_gain(
|
||||||
pstr_drc_config,
|
p_drc_gain_dec_structs, pstr_drc_config, pstr_drc_gain, compress,
|
||||||
pstr_drc_gain,
|
boost, drc_characteristic_target, loudness_normalization_gain_db,
|
||||||
compress,
|
sel_drc_index, &p_drc_gain_dec_structs->drc_gain_buffers);
|
||||||
boost,
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
drc_characteristic_target,
|
|
||||||
loudness_normalization_gain_db,
|
|
||||||
sel_drc_index,
|
|
||||||
&p_drc_gain_dec_structs->drc_gain_buffers);
|
|
||||||
if(err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter == 0)
|
if (p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter == 0) {
|
||||||
{
|
err_code = impd_retrieve_audio_buffer_freq(
|
||||||
err_code = impd_retrieve_audio_buffer_freq(audio_real_buff,
|
audio_real_buff, audio_imag_buff,
|
||||||
audio_imag_buff,
|
|
||||||
&p_drc_gain_dec_structs->audio_in_out_buf);
|
&p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
if(err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
return (err_code);
|
} else {
|
||||||
} else
|
for (sel_drc_index = 0;
|
||||||
{
|
sel_drc_index <
|
||||||
for (sel_drc_index=0; sel_drc_index<p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter; sel_drc_index++)
|
p_drc_gain_dec_structs->ia_drc_params_struct.drc_set_counter;
|
||||||
{
|
sel_drc_index++) {
|
||||||
err_code = impd_apply_gains_subband(str_drc_instruction_str,
|
err_code = impd_apply_gains_subband(
|
||||||
p_drc_gain_dec_structs->ia_drc_params_struct.sel_drc_array[sel_drc_index].drc_instructions_index,
|
str_drc_instruction_str,
|
||||||
|
p_drc_gain_dec_structs->ia_drc_params_struct
|
||||||
|
.sel_drc_array[sel_drc_index]
|
||||||
|
.drc_instructions_index,
|
||||||
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
&p_drc_gain_dec_structs->ia_drc_params_struct,
|
||||||
&(p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[sel_drc_index]),
|
&(p_drc_gain_dec_structs->drc_gain_buffers
|
||||||
|
.pstr_gain_buf[sel_drc_index]),
|
||||||
&p_drc_gain_dec_structs->str_overlap_params,
|
&p_drc_gain_dec_structs->str_overlap_params,
|
||||||
p_drc_gain_dec_structs->audio_in_out_buf.audio_buffer_delayed_real,
|
p_drc_gain_dec_structs->audio_in_out_buf.audio_buffer_delayed_real,
|
||||||
p_drc_gain_dec_structs->audio_in_out_buf.audio_buffer_delayed_imag,
|
p_drc_gain_dec_structs->audio_in_out_buf.audio_buffer_delayed_imag,
|
||||||
audio_real_buff,
|
audio_real_buff, audio_imag_buff);
|
||||||
audio_imag_buff);
|
if (err_code != IA_NO_ERROR) return (err_code);
|
||||||
if(err_code!=IA_NO_ERROR)
|
|
||||||
return (err_code);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_advance_audio_buff_freq(&p_drc_gain_dec_structs->audio_in_out_buf);
|
err_code =
|
||||||
|
impd_advance_audio_buff_freq(&p_drc_gain_dec_structs->audio_in_out_buf);
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_get_parametric_drc_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
VOID impd_get_parametric_drc_delay(
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
WORD32* parametric_drc_delay,
|
ia_drc_config* pstr_drc_config, WORD32* parametric_drc_delay,
|
||||||
WORD32* parametric_drc_delay_max)
|
WORD32* parametric_drc_delay_max) {
|
||||||
{
|
*parametric_drc_delay =
|
||||||
*parametric_drc_delay = p_drc_gain_dec_structs->ia_drc_params_struct.parametric_drc_delay;
|
p_drc_gain_dec_structs->ia_drc_params_struct.parametric_drc_delay;
|
||||||
|
|
||||||
if (pstr_drc_config->str_drc_config_ext.parametric_drc_present && pstr_drc_config->str_drc_config_ext.str_drc_coeff_param_drc.parametric_drc_delay_max_present) {
|
if (pstr_drc_config->str_drc_config_ext.parametric_drc_present &&
|
||||||
*parametric_drc_delay_max = pstr_drc_config->str_drc_config_ext.str_drc_coeff_param_drc.parametric_drc_delay_max;
|
pstr_drc_config->str_drc_config_ext.str_drc_coeff_param_drc
|
||||||
|
.parametric_drc_delay_max_present) {
|
||||||
|
*parametric_drc_delay_max =
|
||||||
|
pstr_drc_config->str_drc_config_ext.str_drc_coeff_param_drc
|
||||||
|
.parametric_drc_delay_max;
|
||||||
} else if (pstr_drc_config->str_drc_config_ext.parametric_drc_present == 0) {
|
} else if (pstr_drc_config->str_drc_config_ext.parametric_drc_present == 0) {
|
||||||
*parametric_drc_delay_max = 0;
|
*parametric_drc_delay_max = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -478,14 +484,14 @@ VOID impd_get_parametric_drc_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_struc
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config, WORD32* eq_delay,
|
||||||
WORD32* eq_delay,
|
WORD32* eq_delay_max) {
|
||||||
WORD32* eq_delay_max)
|
|
||||||
{
|
|
||||||
*eq_delay = p_drc_gain_dec_structs->ia_drc_params_struct.eq_delay;
|
*eq_delay = p_drc_gain_dec_structs->ia_drc_params_struct.eq_delay;
|
||||||
|
|
||||||
if (pstr_drc_config->str_drc_config_ext.eq_flag && pstr_drc_config->str_drc_config_ext.str_eq_coeff.eq_delay_max_present) {
|
if (pstr_drc_config->str_drc_config_ext.eq_flag &&
|
||||||
*eq_delay_max = pstr_drc_config->str_drc_config_ext.str_eq_coeff.eq_delay_max;
|
pstr_drc_config->str_drc_config_ext.str_eq_coeff.eq_delay_max_present) {
|
||||||
|
*eq_delay_max =
|
||||||
|
pstr_drc_config->str_drc_config_ext.str_eq_coeff.eq_delay_max;
|
||||||
} else if (pstr_drc_config->str_drc_config_ext.eq_flag == 0) {
|
} else if (pstr_drc_config->str_drc_config_ext.eq_flag == 0) {
|
||||||
*eq_delay_max = 0;
|
*eq_delay_max = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -494,5 +500,3 @@ VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,11 @@
|
||||||
#ifndef IMPD_DRC_GAIN_DECODER2_H
|
#ifndef IMPD_DRC_GAIN_DECODER2_H
|
||||||
#define IMPD_DRC_GAIN_DECODER2_H
|
#define IMPD_DRC_GAIN_DECODER2_H
|
||||||
|
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI (3.14159265358979323846)
|
#define M_PI (3.14159265358979323846)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct ia_drc_gain_dec_struct
|
typedef struct ia_drc_gain_dec_struct {
|
||||||
{
|
|
||||||
WORD32 audio_num_chan;
|
WORD32 audio_num_chan;
|
||||||
ia_drc_params_struct ia_drc_params_struct;
|
ia_drc_params_struct ia_drc_params_struct;
|
||||||
ia_drc_gain_buffers_struct drc_gain_buffers;
|
ia_drc_gain_buffers_struct drc_gain_buffers;
|
||||||
|
|
@ -37,71 +35,52 @@ typedef struct ia_drc_gain_dec_struct
|
||||||
ia_parametric_drc_params_struct parametricdrc_params;
|
ia_parametric_drc_params_struct parametricdrc_params;
|
||||||
shape_filter_block shape_filter_block[CHANNEL_GROUP_COUNT_MAX];
|
shape_filter_block shape_filter_block[CHANNEL_GROUP_COUNT_MAX];
|
||||||
ia_eq_set_struct* eq_set;
|
ia_eq_set_struct* eq_set;
|
||||||
}ia_drc_gain_dec_struct;
|
} ia_drc_gain_dec_struct;
|
||||||
|
|
||||||
|
WORD32 impd_init_drc_decode(WORD32 frame_size, WORD32 sample_rate,
|
||||||
WORD32 impd_init_drc_decode( WORD32 frame_size,
|
WORD32 gain_delay_samples, WORD32 delay_mode,
|
||||||
WORD32 sample_rate,
|
|
||||||
WORD32 gain_delay_samples,
|
|
||||||
WORD32 delay_mode,
|
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_drc_gain_dec_struct* p_drc_gain_dec_structs);
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs);
|
||||||
|
|
||||||
WORD32 impd_init_drc_decode_post_config( WORD32 audio_num_chan,
|
WORD32 impd_init_drc_decode_post_config(
|
||||||
WORD32* drc_set_id_processed,
|
WORD32 audio_num_chan, WORD32* drc_set_id_processed,
|
||||||
WORD32* downmix_id_processed,
|
WORD32* downmix_id_processed, WORD32 num_sets_processed,
|
||||||
WORD32 num_sets_processed,
|
|
||||||
WORD32 eq_set_id_processed,
|
WORD32 eq_set_id_processed,
|
||||||
|
|
||||||
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config * pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info, pVOID* mem_ptr
|
||||||
pVOID *mem_ptr
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
WORD32 impd_drc_process_time_domain( ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
WORD32 impd_drc_process_time_domain(
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
|
||||||
FLOAT32* audio_in_out_buf[],
|
FLOAT32* audio_in_out_buf[], FLOAT32 loudness_normalization_gain_db,
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
FLOAT32 boost, FLOAT32 compress, WORD32 drc_characteristic);
|
||||||
FLOAT32 boost,
|
|
||||||
FLOAT32 compress,
|
WORD32 impd_drc_process_freq_domain(
|
||||||
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
|
ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
|
||||||
|
FLOAT32* audio_real_buff[], FLOAT32* audio_imag_buff[],
|
||||||
|
FLOAT32 loudness_normalization_gain_db, FLOAT32 boost, FLOAT32 compress,
|
||||||
WORD32 drc_characteristic);
|
WORD32 drc_characteristic);
|
||||||
|
|
||||||
WORD32 impd_drc_process_freq_domain(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
VOID impd_get_parametric_drc_delay(
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_config* pstr_drc_config, WORD32* parametric_drc_delay,
|
||||||
FLOAT32* audio_real_buff[],
|
|
||||||
FLOAT32* audio_imag_buff[],
|
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
|
||||||
FLOAT32 boost,
|
|
||||||
FLOAT32 compress,
|
|
||||||
WORD32 drc_characteristic);
|
|
||||||
|
|
||||||
VOID impd_get_parametric_drc_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
|
||||||
ia_drc_config* pstr_drc_config,
|
|
||||||
WORD32* parametric_drc_delay,
|
|
||||||
WORD32* parametric_drc_delay_max);
|
WORD32* parametric_drc_delay_max);
|
||||||
|
|
||||||
VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config, WORD32* eq_delay,
|
||||||
WORD32* eq_delay,
|
|
||||||
WORD32* eq_delay_max);
|
WORD32* eq_delay_max);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_drc_gain (ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
impd_get_drc_gain(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_gain_struct* pstr_drc_gain, FLOAT32 compress,
|
||||||
FLOAT32 compress,
|
FLOAT32 boost, WORD32 characteristic_index,
|
||||||
FLOAT32 boost,
|
FLOAT32 loudness_normalization_gain_db, WORD32 sub_drc_index,
|
||||||
WORD32 characteristic_index,
|
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
|
||||||
WORD32 sub_drc_index,
|
|
||||||
ia_drc_gain_buffers_struct* drc_gain_buffers);
|
ia_drc_gain_buffers_struct* drc_gain_buffers);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef IMPD_DRC_HASHDEFINES_H
|
#ifndef IMPD_DRC_HASHDEFINES_H
|
||||||
#define IMPD_DRC_HASHDEFINES_H
|
#define IMPD_DRC_HASHDEFINES_H
|
||||||
|
|
||||||
|
|
||||||
#define DEC_TYPE_TD 0
|
#define DEC_TYPE_TD 0
|
||||||
#define DEC_TYPE_TD_QMF64 1
|
#define DEC_TYPE_TD_QMF64 1
|
||||||
#define DEC_TYPE_QMF64 2
|
#define DEC_TYPE_QMF64 2
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,8 @@
|
||||||
#include "impd_drc_filter_bank.h"
|
#include "impd_drc_filter_bank.h"
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
|
WORD32 impd_set_default_params_selection_process(
|
||||||
WORD32 impd_set_default_params_selection_process(ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params)
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params) {
|
||||||
{
|
|
||||||
pstr_drc_sel_proc_params->base_channel_count = -1;
|
pstr_drc_sel_proc_params->base_channel_count = -1;
|
||||||
pstr_drc_sel_proc_params->base_layout = -1;
|
pstr_drc_sel_proc_params->base_layout = -1;
|
||||||
pstr_drc_sel_proc_params->target_config_request_type = 0;
|
pstr_drc_sel_proc_params->target_config_request_type = 0;
|
||||||
|
|
@ -42,101 +41,138 @@ WORD32 impd_set_default_params_selection_process(ia_drc_sel_proc_params_struct *
|
||||||
pstr_drc_sel_proc_params->loudness_normalization_on = 0;
|
pstr_drc_sel_proc_params->loudness_normalization_on = 0;
|
||||||
pstr_drc_sel_proc_params->target_loudness = -24.0f;
|
pstr_drc_sel_proc_params->target_loudness = -24.0f;
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->loudness_deviation_max = LOUDNESS_DEVIATION_MAX_DEFAULT;
|
pstr_drc_sel_proc_params->loudness_deviation_max =
|
||||||
|
LOUDNESS_DEVIATION_MAX_DEFAULT;
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_method = USER_METHOD_DEFINITION_DEFAULT;
|
pstr_drc_sel_proc_params->loudness_measurement_method =
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_system = USER_MEASUREMENT_SYSTEM_DEFAULT;
|
USER_METHOD_DEFINITION_DEFAULT;
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_pre_proc = USER_LOUDNESS_PREPROCESSING_DEFAULT;
|
pstr_drc_sel_proc_params->loudness_measurement_system =
|
||||||
|
USER_MEASUREMENT_SYSTEM_DEFAULT;
|
||||||
|
pstr_drc_sel_proc_params->loudness_measurement_pre_proc =
|
||||||
|
USER_LOUDNESS_PREPROCESSING_DEFAULT;
|
||||||
pstr_drc_sel_proc_params->device_cut_off_frequency = 500;
|
pstr_drc_sel_proc_params->device_cut_off_frequency = 500;
|
||||||
pstr_drc_sel_proc_params->loudness_norm_gain_db_max = LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
pstr_drc_sel_proc_params->loudness_norm_gain_db_max =
|
||||||
|
LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
||||||
pstr_drc_sel_proc_params->loudness_norm_gain_modification_db = 0.0f;
|
pstr_drc_sel_proc_params->loudness_norm_gain_modification_db = 0.0f;
|
||||||
pstr_drc_sel_proc_params->output_peak_level_max = 0.0f;
|
pstr_drc_sel_proc_params->output_peak_level_max = 0.0f;
|
||||||
if (pstr_drc_sel_proc_params->peak_limiter == 1) {
|
if (pstr_drc_sel_proc_params->peak_limiter == 1) {
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->output_peak_level_max = 6.0f;
|
pstr_drc_sel_proc_params->output_peak_level_max = 6.0f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->dynamic_range_control_on = 1;
|
pstr_drc_sel_proc_params->dynamic_range_control_on = 1;
|
||||||
pstr_drc_sel_proc_params->num_bands_supported = 4;
|
pstr_drc_sel_proc_params->num_bands_supported = 4;
|
||||||
pstr_drc_sel_proc_params->num_drc_feature_requests = 0;
|
pstr_drc_sel_proc_params->num_drc_feature_requests = 0;
|
||||||
|
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->boost = 1.f;
|
pstr_drc_sel_proc_params->boost = 1.f;
|
||||||
pstr_drc_sel_proc_params->compress = 1.f;
|
pstr_drc_sel_proc_params->compress = 1.f;
|
||||||
pstr_drc_sel_proc_params->drc_characteristic_target = 0;
|
pstr_drc_sel_proc_params->drc_characteristic_target = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WORD32 impd_set_custom_params(const WORD32 param_set_idx,
|
WORD32 impd_set_custom_params(
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params)
|
const WORD32 param_set_idx,
|
||||||
{
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params) {
|
||||||
WORD32 i, k;
|
WORD32 i, k;
|
||||||
|
|
||||||
const ia_loc_sys_interface_struct* system_interface = &(loc_sys_interface[param_set_idx-1]);
|
const ia_loc_sys_interface_struct* system_interface =
|
||||||
|
&(loc_sys_interface[param_set_idx - 1]);
|
||||||
|
|
||||||
const ia_loc_loudness_norm_ctrl_interface_struct* loudness_norm_ctrl_interface = &(loc_loudness_norm_ctrl_interface[param_set_idx-1]);
|
const ia_loc_loudness_norm_ctrl_interface_struct*
|
||||||
const ia_loc_loudness_norm_param_interface_struct* loudness_norm_param_interface = &(loc_loudness_norm_param_interface[param_set_idx-1]);
|
loudness_norm_ctrl_interface =
|
||||||
|
&(loc_loudness_norm_ctrl_interface[param_set_idx - 1]);
|
||||||
|
const ia_loc_loudness_norm_param_interface_struct*
|
||||||
|
loudness_norm_param_interface =
|
||||||
|
&(loc_loudness_norm_param_interface[param_set_idx - 1]);
|
||||||
|
|
||||||
const ia_loc_drc_interface_struct* drc_ctrl_interface = &(loc_dyn_range_ctrl_interface[param_set_idx-1]);
|
const ia_loc_drc_interface_struct* drc_ctrl_interface =
|
||||||
const ia_loc_requested_drc_effect_struct* requested_drc_effect_type = &(loc_requested_drc_effect_type_str[param_set_idx-1]);
|
&(loc_dyn_range_ctrl_interface[param_set_idx - 1]);
|
||||||
const ia_loc_drc_parameter_interface_struct* drc_parameter_interface = &(loc_drc_parameter_interface[param_set_idx-1]);
|
const ia_loc_requested_drc_effect_struct* requested_drc_effect_type =
|
||||||
|
&(loc_requested_drc_effect_type_str[param_set_idx - 1]);
|
||||||
|
const ia_loc_drc_parameter_interface_struct* drc_parameter_interface =
|
||||||
|
&(loc_drc_parameter_interface[param_set_idx - 1]);
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->target_config_request_type = system_interface->target_config_request_type;
|
pstr_drc_sel_proc_params->target_config_request_type =
|
||||||
|
system_interface->target_config_request_type;
|
||||||
switch (system_interface->target_config_request_type) {
|
switch (system_interface->target_config_request_type) {
|
||||||
case 1:
|
case 1:
|
||||||
pstr_drc_sel_proc_params->requested_target_layout = system_interface->requested_target_layout;
|
pstr_drc_sel_proc_params->requested_target_layout =
|
||||||
|
system_interface->requested_target_layout;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
pstr_drc_sel_proc_params->requested_target_ch_count = system_interface->requested_target_ch_count;
|
pstr_drc_sel_proc_params->requested_target_ch_count =
|
||||||
|
system_interface->requested_target_ch_count;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
pstr_drc_sel_proc_params->num_downmix_id_requests = system_interface->num_downmix_id_requests;
|
pstr_drc_sel_proc_params->num_downmix_id_requests =
|
||||||
for (i=0; i<system_interface->num_downmix_id_requests; i++) {
|
system_interface->num_downmix_id_requests;
|
||||||
pstr_drc_sel_proc_params->requested_dwnmix_id[i] = system_interface->requested_dwnmix_id[i];
|
for (i = 0; i < system_interface->num_downmix_id_requests; i++) {
|
||||||
|
pstr_drc_sel_proc_params->requested_dwnmix_id[i] =
|
||||||
|
system_interface->requested_dwnmix_id[i];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->loudness_normalization_on = loudness_norm_ctrl_interface->loudness_normalization_on;
|
pstr_drc_sel_proc_params->loudness_normalization_on =
|
||||||
pstr_drc_sel_proc_params->target_loudness = loudness_norm_ctrl_interface->target_loudness;
|
loudness_norm_ctrl_interface->loudness_normalization_on;
|
||||||
|
pstr_drc_sel_proc_params->target_loudness =
|
||||||
|
loudness_norm_ctrl_interface->target_loudness;
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->album_mode = loudness_norm_param_interface->album_mode;
|
pstr_drc_sel_proc_params->album_mode =
|
||||||
pstr_drc_sel_proc_params->peak_limiter = loudness_norm_param_interface->peak_limiter;
|
loudness_norm_param_interface->album_mode;
|
||||||
pstr_drc_sel_proc_params->loudness_deviation_max = loudness_norm_param_interface->loudness_deviation_max;
|
pstr_drc_sel_proc_params->peak_limiter =
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_method = loudness_norm_param_interface->loudness_measurement_method;
|
loudness_norm_param_interface->peak_limiter;
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_system = loudness_norm_param_interface->loudness_measurement_system;
|
pstr_drc_sel_proc_params->loudness_deviation_max =
|
||||||
pstr_drc_sel_proc_params->loudness_measurement_pre_proc = loudness_norm_param_interface->loudness_measurement_pre_proc;
|
loudness_norm_param_interface->loudness_deviation_max;
|
||||||
pstr_drc_sel_proc_params->device_cut_off_frequency= loudness_norm_param_interface->device_cut_off_frequency;
|
pstr_drc_sel_proc_params->loudness_measurement_method =
|
||||||
pstr_drc_sel_proc_params->loudness_norm_gain_db_max = loudness_norm_param_interface->loudness_norm_gain_db_max;
|
loudness_norm_param_interface->loudness_measurement_method;
|
||||||
pstr_drc_sel_proc_params->loudness_norm_gain_modification_db = loudness_norm_param_interface->loudness_norm_gain_modification_db;
|
pstr_drc_sel_proc_params->loudness_measurement_system =
|
||||||
pstr_drc_sel_proc_params->output_peak_level_max = loudness_norm_param_interface->output_peak_level_max;
|
loudness_norm_param_interface->loudness_measurement_system;
|
||||||
|
pstr_drc_sel_proc_params->loudness_measurement_pre_proc =
|
||||||
|
loudness_norm_param_interface->loudness_measurement_pre_proc;
|
||||||
|
pstr_drc_sel_proc_params->device_cut_off_frequency =
|
||||||
|
loudness_norm_param_interface->device_cut_off_frequency;
|
||||||
|
pstr_drc_sel_proc_params->loudness_norm_gain_db_max =
|
||||||
|
loudness_norm_param_interface->loudness_norm_gain_db_max;
|
||||||
|
pstr_drc_sel_proc_params->loudness_norm_gain_modification_db =
|
||||||
|
loudness_norm_param_interface->loudness_norm_gain_modification_db;
|
||||||
|
pstr_drc_sel_proc_params->output_peak_level_max =
|
||||||
|
loudness_norm_param_interface->output_peak_level_max;
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->dynamic_range_control_on = drc_ctrl_interface->dynamic_range_control_on;
|
pstr_drc_sel_proc_params->dynamic_range_control_on =
|
||||||
pstr_drc_sel_proc_params->num_drc_feature_requests = drc_ctrl_interface->num_drc_feature_requests;
|
drc_ctrl_interface->dynamic_range_control_on;
|
||||||
for (i=0; i<drc_ctrl_interface->num_drc_feature_requests; i++)
|
pstr_drc_sel_proc_params->num_drc_feature_requests =
|
||||||
{
|
drc_ctrl_interface->num_drc_feature_requests;
|
||||||
pstr_drc_sel_proc_params->drc_feature_req_type[i] = drc_ctrl_interface->drc_feature_req_type[i];
|
for (i = 0; i < drc_ctrl_interface->num_drc_feature_requests; i++) {
|
||||||
switch (drc_ctrl_interface->drc_feature_req_type[i])
|
pstr_drc_sel_proc_params->drc_feature_req_type[i] =
|
||||||
{
|
drc_ctrl_interface->drc_feature_req_type[i];
|
||||||
|
switch (drc_ctrl_interface->drc_feature_req_type[i]) {
|
||||||
case MATCH_EFFECT_TYPE:
|
case MATCH_EFFECT_TYPE:
|
||||||
pstr_drc_sel_proc_params->requested_num_drc_effects[i] = requested_drc_effect_type->requested_num_drc_effects;
|
pstr_drc_sel_proc_params->requested_num_drc_effects[i] =
|
||||||
pstr_drc_sel_proc_params->desired_num_drc_effects_of_requested[i] = requested_drc_effect_type->desired_num_drc_effects_of_requested;
|
requested_drc_effect_type->requested_num_drc_effects;
|
||||||
for (k=0; k<requested_drc_effect_type->requested_num_drc_effects; k++)
|
pstr_drc_sel_proc_params->desired_num_drc_effects_of_requested[i] =
|
||||||
{
|
requested_drc_effect_type->desired_num_drc_effects_of_requested;
|
||||||
pstr_drc_sel_proc_params->requested_drc_effect_type[i][k] = requested_drc_effect_type->requested_drc_effect_type[k];
|
for (k = 0; k < requested_drc_effect_type->requested_num_drc_effects;
|
||||||
|
k++) {
|
||||||
|
pstr_drc_sel_proc_params->requested_drc_effect_type[i][k] =
|
||||||
|
requested_drc_effect_type->requested_drc_effect_type[k];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MATCH_DYNAMIC_RANGE:
|
case MATCH_DYNAMIC_RANGE:
|
||||||
pstr_drc_sel_proc_params->requested_dyn_range_measur_type[i] = drc_ctrl_interface->requested_dyn_rng_measurement_type;
|
pstr_drc_sel_proc_params->requested_dyn_range_measur_type[i] =
|
||||||
pstr_drc_sel_proc_params->requested_dyn_range_range_flag[i] = drc_ctrl_interface->requested_dyn_range_is_single_val_flag;
|
drc_ctrl_interface->requested_dyn_rng_measurement_type;
|
||||||
pstr_drc_sel_proc_params->requested_dyn_range_value[i] = drc_ctrl_interface->requested_dyn_range_value;
|
pstr_drc_sel_proc_params->requested_dyn_range_range_flag[i] =
|
||||||
pstr_drc_sel_proc_params->requested_dyn_range_min_val[i] = drc_ctrl_interface->requested_dyn_range_min_val;
|
drc_ctrl_interface->requested_dyn_range_is_single_val_flag;
|
||||||
pstr_drc_sel_proc_params->requested_dyn_range_max_val[i] = drc_ctrl_interface->requested_dyn_range_max_val;
|
pstr_drc_sel_proc_params->requested_dyn_range_value[i] =
|
||||||
|
drc_ctrl_interface->requested_dyn_range_value;
|
||||||
|
pstr_drc_sel_proc_params->requested_dyn_range_min_val[i] =
|
||||||
|
drc_ctrl_interface->requested_dyn_range_min_val;
|
||||||
|
pstr_drc_sel_proc_params->requested_dyn_range_max_val[i] =
|
||||||
|
drc_ctrl_interface->requested_dyn_range_max_val;
|
||||||
break;
|
break;
|
||||||
case MATCH_DRC_CHARACTERISTIC:
|
case MATCH_DRC_CHARACTERISTIC:
|
||||||
pstr_drc_sel_proc_params->requested_drc_characteristic[i] = drc_ctrl_interface->requested_drc_characteristic;
|
pstr_drc_sel_proc_params->requested_drc_characteristic[i] =
|
||||||
|
drc_ctrl_interface->requested_drc_characteristic;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
|
|
@ -145,16 +181,17 @@ WORD32 impd_set_custom_params(const WORD32 param_set_idx,
|
||||||
|
|
||||||
pstr_drc_sel_proc_params->boost = drc_parameter_interface->boost;
|
pstr_drc_sel_proc_params->boost = drc_parameter_interface->boost;
|
||||||
pstr_drc_sel_proc_params->compress = drc_parameter_interface->compress;
|
pstr_drc_sel_proc_params->compress = drc_parameter_interface->compress;
|
||||||
pstr_drc_sel_proc_params->drc_characteristic_target = drc_parameter_interface->drc_characteristic_target;
|
pstr_drc_sel_proc_params->drc_characteristic_target =
|
||||||
|
drc_parameter_interface->drc_characteristic_target;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
WORD32 impd_eval_custom_params_selection_process(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params)
|
WORD32 impd_eval_custom_params_selection_process(
|
||||||
{
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params) {
|
||||||
pstr_drc_sel_proc_params->loudness_norm_gain_db_max = max (0.0f, pstr_drc_sel_proc_params->loudness_norm_gain_db_max);
|
pstr_drc_sel_proc_params->loudness_norm_gain_db_max =
|
||||||
pstr_drc_sel_proc_params->loudness_deviation_max = max (0, pstr_drc_sel_proc_params->loudness_deviation_max);
|
max(0.0f, pstr_drc_sel_proc_params->loudness_norm_gain_db_max);
|
||||||
|
pstr_drc_sel_proc_params->loudness_deviation_max =
|
||||||
|
max(0, pstr_drc_sel_proc_params->loudness_deviation_max);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,15 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
WORD32 impd_set_default_params_selection_process(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
WORD32 impd_set_default_params_selection_process(
|
||||||
|
|
||||||
WORD32 impd_set_custom_params(const WORD32 param_set_idx,
|
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
||||||
|
|
||||||
WORD32 impd_eval_custom_params_selection_process(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
WORD32 impd_set_custom_params(
|
||||||
|
const WORD32 param_set_idx,
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
||||||
|
|
||||||
|
WORD32 impd_eval_custom_params_selection_process(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,50 +42,45 @@
|
||||||
#include "impd_drc_peak_limiter.h"
|
#include "impd_drc_peak_limiter.h"
|
||||||
#include "impd_drc_host_params.h"
|
#include "impd_drc_host_params.h"
|
||||||
|
|
||||||
|
|
||||||
#define PARAMETRIC_DRC_DELAY_MAX_DEFAULT 4096
|
#define PARAMETRIC_DRC_DELAY_MAX_DEFAULT 4096
|
||||||
#define EQ_DELAY_MAX_DEFAULT 256
|
#define EQ_DELAY_MAX_DEFAULT 256
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc,
|
IA_ERRORCODE impd_drc_mem_api(ia_drc_api_struct *p_obj_drc, WORD32 iCmd,
|
||||||
WORD32 iCmd, WORD32 iIdx, pVOID pvValue);
|
WORD32 iIdx, pVOID pvValue);
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc);
|
IA_ERRORCODE impd_drc_fill_mem_tables(ia_drc_api_struct *p_obj_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_dec_interface_process(
|
impd_drc_dec_interface_process(ia_bit_buf_struct *it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_interface_struct *pstr_drc_interface,
|
||||||
ia_drc_interface_struct* pstr_drc_interface,
|
UWORD8 *it_bit_buf, WORD32 num_bit_stream_bits,
|
||||||
UWORD8* it_bit_buf,
|
WORD32 *num_bits_read);
|
||||||
WORD32 num_bit_stream_bits,
|
|
||||||
WORD32* num_bits_read);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_dec_interface_add_effect_type(ia_drc_interface_struct* pstr_drc_interface,
|
impd_drc_dec_interface_add_effect_type(
|
||||||
WORD32 drc_effect_type,WORD32 target_loudness, WORD32 loud_norm);
|
ia_drc_interface_struct *pstr_drc_interface, WORD32 drc_effect_type,
|
||||||
|
WORD32 target_loudness, WORD32 loud_norm);
|
||||||
|
|
||||||
#define NUM_GAIN_DEC_INSTANCES 2
|
#define NUM_GAIN_DEC_INSTANCES 2
|
||||||
|
|
||||||
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
||||||
#define LIM_DEFAULT_THRESHOLD (0.89125094f)
|
#define LIM_DEFAULT_THRESHOLD (0.89125094f)
|
||||||
|
|
||||||
static WORD32 impd_match_downmix(WORD32 downmix_id, WORD32 dec_downmix_id)
|
static WORD32 impd_match_downmix(WORD32 downmix_id, WORD32 dec_downmix_id) {
|
||||||
{
|
|
||||||
WORD32 id_match = 0;
|
WORD32 id_match = 0;
|
||||||
|
|
||||||
switch (dec_downmix_id )
|
switch (dec_downmix_id) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
id_match = (downmix_id == 0);
|
id_match = (downmix_id == 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
id_match = ( (downmix_id == 0) || (downmix_id == 0x7F) );
|
id_match = ((downmix_id == 0) || (downmix_id == 0x7F));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
id_match = (downmix_id == 0x7F);
|
id_match = (downmix_id == 0x7F);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
id_match = ( (downmix_id != 0) && (downmix_id != 0x7F) );
|
id_match = ((downmix_id != 0) && (downmix_id != 0x7F));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
id_match = (downmix_id != 0);
|
id_match = (downmix_id != 0);
|
||||||
|
|
@ -94,8 +89,7 @@ static WORD32 impd_match_downmix(WORD32 downmix_id, WORD32 dec_downmix_id)
|
||||||
return id_match;
|
return id_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc)
|
IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc) {
|
||||||
{
|
|
||||||
p_obj_drc->str_config.bitstream_file_format = 0;
|
p_obj_drc->str_config.bitstream_file_format = 0;
|
||||||
p_obj_drc->str_config.dec_type = 0;
|
p_obj_drc->str_config.dec_type = 0;
|
||||||
p_obj_drc->str_config.sub_band_domain_mode = 0;
|
p_obj_drc->str_config.sub_band_domain_mode = 0;
|
||||||
|
|
@ -134,449 +128,496 @@ IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc)
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_set_default_bitstream_config(
|
||||||
IA_ERRORCODE impd_drc_set_default_bitstream_config(ia_drc_config *pstr_drc_config)
|
ia_drc_config *pstr_drc_config) {
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
||||||
pstr_drc_config->sample_rate_present=0;
|
pstr_drc_config->sample_rate_present = 0;
|
||||||
pstr_drc_config->sampling_rate=0;
|
pstr_drc_config->sampling_rate = 0;
|
||||||
pstr_drc_config->dwnmix_instructions_count=0;
|
pstr_drc_config->dwnmix_instructions_count = 0;
|
||||||
pstr_drc_config->drc_coefficients_drc_count=1;
|
pstr_drc_config->drc_coefficients_drc_count = 1;
|
||||||
pstr_drc_config->drc_instructions_uni_drc_count=4;
|
pstr_drc_config->drc_instructions_uni_drc_count = 4;
|
||||||
pstr_drc_config->drc_instructions_count_plus=5;
|
pstr_drc_config->drc_instructions_count_plus = 5;
|
||||||
pstr_drc_config->drc_description_basic_present=0;
|
pstr_drc_config->drc_description_basic_present = 0;
|
||||||
pstr_drc_config->drc_coefficients_basic_count=0;
|
pstr_drc_config->drc_coefficients_basic_count = 0;
|
||||||
pstr_drc_config->drc_instructions_basic_count=0;
|
pstr_drc_config->drc_instructions_basic_count = 0;
|
||||||
pstr_drc_config->drc_config_ext_present=1;
|
pstr_drc_config->drc_config_ext_present = 1;
|
||||||
pstr_drc_config->apply_drc=0;
|
pstr_drc_config->apply_drc = 0;
|
||||||
pstr_drc_config->str_drc_config_ext.drc_config_ext_type[0]=2;
|
pstr_drc_config->str_drc_config_ext.drc_config_ext_type[0] = 2;
|
||||||
pstr_drc_config->str_drc_config_ext.ext_bit_size[0]=345;
|
pstr_drc_config->str_drc_config_ext.ext_bit_size[0] = 345;
|
||||||
pstr_drc_config->str_drc_config_ext.parametric_drc_present=0;
|
pstr_drc_config->str_drc_config_ext.parametric_drc_present = 0;
|
||||||
pstr_drc_config->str_drc_config_ext.drc_extension_v1_present=1;
|
pstr_drc_config->str_drc_config_ext.drc_extension_v1_present = 1;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].version=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].version = 1;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].drc_location=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].drc_location = 1;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count=4;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count = 4;
|
||||||
for(i=0;i<pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count;i++)
|
for (i = 0;
|
||||||
{
|
i <
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params[i].gain_interpolation_type=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params[i].band_count=1;
|
i++) {
|
||||||
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
|
.gain_set_params[i]
|
||||||
|
.gain_interpolation_type = 1;
|
||||||
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
|
.gain_set_params[i]
|
||||||
|
.band_count = 1;
|
||||||
}
|
}
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_sequence_count=4;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_sequence_count =
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[0]=0;
|
4;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[1]=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[2]=2;
|
.gain_set_params_index_for_gain_sequence[0] = 0;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[3]=3;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count_plus=4;
|
.gain_set_params_index_for_gain_sequence[1] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_id=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_complexity_level=2;
|
.gain_set_params_index_for_gain_sequence[2] = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_location=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
pstr_drc_config->str_drc_instruction_str[0].dwnmix_id_count=1;
|
.gain_set_params_index_for_gain_sequence[3] = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_effect=1;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count_plus =
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_set_index[1]=1;
|
4;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_target_loudness_value_lower=-63;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_id = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].num_drc_ch_groups=2;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_complexity_level = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_set_index_for_channel_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[0].drc_location = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].band_count_of_ch_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[0].dwnmix_id_count = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_effect = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_interpolation_type_for_channel_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[0].gain_set_index[1] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_interpolation_type_for_channel_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
pstr_drc_config->str_drc_instruction_str[0].time_delta_min_for_channel_group[0]=32;
|
.drc_set_target_loudness_value_lower = -63;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].time_delta_min_for_channel_group[1]=32;
|
pstr_drc_config->str_drc_instruction_str[0].num_drc_ch_groups = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].channel_group_of_ch[1]=1;
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_element_count=2;
|
.gain_set_index_for_channel_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0].band_count_of_ch_group[0] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0].band_count_of_ch_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
|
.gain_interpolation_type_for_channel_group[0] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
|
.gain_interpolation_type_for_channel_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
|
.time_delta_min_for_channel_group[0] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0]
|
||||||
|
.time_delta_min_for_channel_group[1] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0].channel_group_of_ch[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[0].gain_element_count = 2;
|
||||||
|
|
||||||
pstr_drc_config->str_drc_instruction_str[1].drc_set_id=2;
|
pstr_drc_config->str_drc_instruction_str[1].drc_set_id = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].drc_set_complexity_level=2;
|
pstr_drc_config->str_drc_instruction_str[1].drc_set_complexity_level = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].drc_location=1;
|
pstr_drc_config->str_drc_instruction_str[1].drc_location = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].dwnmix_id_count=1;
|
pstr_drc_config->str_drc_instruction_str[1].dwnmix_id_count = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].drc_set_effect=2;
|
pstr_drc_config->str_drc_instruction_str[1].drc_set_effect = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_set_index[0]=1;
|
pstr_drc_config->str_drc_instruction_str[1].gain_set_index[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_set_index[1]=2;
|
pstr_drc_config->str_drc_instruction_str[1].gain_set_index[1] = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].drc_set_target_loudness_value_lower=-63;
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
pstr_drc_config->str_drc_instruction_str[1].num_drc_ch_groups=2;
|
.drc_set_target_loudness_value_lower = -63;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_set_index_for_channel_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[1].num_drc_ch_groups = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_set_index_for_channel_group[1]=2;
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
pstr_drc_config->str_drc_instruction_str[1].band_count_of_ch_group[0]=1;
|
.gain_set_index_for_channel_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_interpolation_type_for_channel_group[0]=1;
|
.gain_set_index_for_channel_group[1] = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_interpolation_type_for_channel_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[1].band_count_of_ch_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].time_delta_min_for_channel_group[0]=32;
|
pstr_drc_config->str_drc_instruction_str[1].band_count_of_ch_group[1] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].time_delta_min_for_channel_group[1]=32;
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
pstr_drc_config->str_drc_instruction_str[1].channel_group_of_ch[1]=1;
|
.gain_interpolation_type_for_channel_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_element_count=2;
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
|
.gain_interpolation_type_for_channel_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
|
.time_delta_min_for_channel_group[0] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[1]
|
||||||
|
.time_delta_min_for_channel_group[1] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[1].channel_group_of_ch[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[1].gain_element_count = 2;
|
||||||
|
|
||||||
pstr_drc_config->str_drc_instruction_str[2].drc_set_id=3;
|
pstr_drc_config->str_drc_instruction_str[2].drc_set_id = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].drc_set_complexity_level=2;
|
pstr_drc_config->str_drc_instruction_str[2].drc_set_complexity_level = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].drc_location=1;
|
pstr_drc_config->str_drc_instruction_str[2].drc_location = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].dwnmix_id_count=1;
|
pstr_drc_config->str_drc_instruction_str[2].dwnmix_id_count = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].drc_set_effect=4;
|
pstr_drc_config->str_drc_instruction_str[2].drc_set_effect = 4;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_set_index[0]=2;
|
pstr_drc_config->str_drc_instruction_str[2].gain_set_index[0] = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_set_index[1]=3;
|
pstr_drc_config->str_drc_instruction_str[2].gain_set_index[1] = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].drc_set_target_loudness_value_lower=-63;
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
pstr_drc_config->str_drc_instruction_str[2].num_drc_ch_groups=2;
|
.drc_set_target_loudness_value_lower = -63;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_set_index_for_channel_group[0]=2;
|
pstr_drc_config->str_drc_instruction_str[2].num_drc_ch_groups = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_set_index_for_channel_group[1]=3;
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[0]=1;
|
.gain_set_index_for_channel_group[0] = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_interpolation_type_for_channel_group[0]=1;
|
.gain_set_index_for_channel_group[1] = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_interpolation_type_for_channel_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].time_delta_min_for_channel_group[0]=32;
|
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[1] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].time_delta_min_for_channel_group[1]=32;
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
pstr_drc_config->str_drc_instruction_str[2].channel_group_of_ch[1]=1;
|
.gain_interpolation_type_for_channel_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_element_count=2;
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
|
.gain_interpolation_type_for_channel_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
|
.time_delta_min_for_channel_group[0] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[2]
|
||||||
|
.time_delta_min_for_channel_group[1] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[2].channel_group_of_ch[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[2].gain_element_count = 2;
|
||||||
|
|
||||||
pstr_drc_config->str_drc_instruction_str[3].drc_set_id=4;
|
pstr_drc_config->str_drc_instruction_str[3].drc_set_id = 4;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].drc_set_complexity_level=2;
|
pstr_drc_config->str_drc_instruction_str[3].drc_set_complexity_level = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].drc_location=1;
|
pstr_drc_config->str_drc_instruction_str[3].drc_location = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].dwnmix_id_count=1;
|
pstr_drc_config->str_drc_instruction_str[3].dwnmix_id_count = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].drc_set_effect=32;
|
pstr_drc_config->str_drc_instruction_str[3].drc_set_effect = 32;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_set_index[0]=3;
|
pstr_drc_config->str_drc_instruction_str[3].gain_set_index[0] = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_set_index[1]=0;
|
pstr_drc_config->str_drc_instruction_str[3].gain_set_index[1] = 0;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].drc_set_target_loudness_value_lower=-63;
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
pstr_drc_config->str_drc_instruction_str[3].num_drc_ch_groups=2;
|
.drc_set_target_loudness_value_lower = -63;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_set_index_for_channel_group[0]=3;
|
pstr_drc_config->str_drc_instruction_str[3].num_drc_ch_groups = 2;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_set_index_for_channel_group[1]=0;
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[0]=1;
|
.gain_set_index_for_channel_group[0] = 3;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_interpolation_type_for_channel_group[0]=1;
|
.gain_set_index_for_channel_group[1] = 0;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_interpolation_type_for_channel_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].time_delta_min_for_channel_group[0]=32;
|
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[1] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].time_delta_min_for_channel_group[1]=32;
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
pstr_drc_config->str_drc_instruction_str[3].channel_group_of_ch[1]=1;
|
.gain_interpolation_type_for_channel_group[0] = 1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_element_count=2;
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
|
.gain_interpolation_type_for_channel_group[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
|
.time_delta_min_for_channel_group[0] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[3]
|
||||||
|
.time_delta_min_for_channel_group[1] = 32;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[3].channel_group_of_ch[1] = 1;
|
||||||
|
pstr_drc_config->str_drc_instruction_str[3].gain_element_count = 2;
|
||||||
|
|
||||||
pstr_drc_config->str_drc_instruction_str[4].drc_set_id=-1;
|
pstr_drc_config->str_drc_instruction_str[4].drc_set_id = -1;
|
||||||
pstr_drc_config->str_drc_instruction_str[4].dwnmix_id_count=1;
|
pstr_drc_config->str_drc_instruction_str[4].dwnmix_id_count = 1;
|
||||||
pstr_drc_config->channel_layout.base_channel_count=2;
|
pstr_drc_config->channel_layout.base_channel_count = 2;
|
||||||
|
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_set_struct_pointer(ia_drc_api_struct *p_obj_drc) {
|
||||||
IA_ERRORCODE impd_drc_set_struct_pointer(ia_drc_api_struct *p_obj_drc)
|
|
||||||
{
|
|
||||||
SIZE_T persistant_ptr = (SIZE_T)p_obj_drc->p_state->persistant_ptr;
|
SIZE_T persistant_ptr = (SIZE_T)p_obj_drc->p_state->persistant_ptr;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_bitstream_dec = (ia_drc_bits_dec_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_bitstream_dec =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_bits_dec_struct)+32;
|
(ia_drc_bits_dec_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_bits_dec_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_gain_dec[0] = (ia_drc_gain_dec_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_gain_dec[0] =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_dec_struct)+32;
|
(ia_drc_gain_dec_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_dec_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_gain_dec[1] = (ia_drc_gain_dec_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_gain_dec[1] =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_dec_struct)+32;
|
(ia_drc_gain_dec_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_dec_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_loudness_info = (ia_drc_loudness_info_set_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_loudness_info =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_loudness_info_set_struct)+32;
|
(ia_drc_loudness_info_set_struct *)persistant_ptr;
|
||||||
|
persistant_ptr =
|
||||||
|
(SIZE_T)persistant_ptr + sizeof(ia_drc_loudness_info_set_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_drc_gain = (ia_drc_gain_struct*)persistant_ptr;;
|
p_obj_drc->str_payload.pstr_drc_gain = (ia_drc_gain_struct *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_struct)+32;
|
;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_gain_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_drc_interface = (ia_drc_interface_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_drc_interface =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_interface_struct)+32;
|
(ia_drc_interface_struct *)persistant_ptr;
|
||||||
|
persistant_ptr =
|
||||||
|
(SIZE_T)persistant_ptr + sizeof(ia_drc_interface_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_drc_config = (ia_drc_config*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_drc_config = (ia_drc_config *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_config)+32;
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_config) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_selection_proc = (ia_drc_sel_pro_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_selection_proc =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_sel_pro_struct)+32;
|
(ia_drc_sel_pro_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_sel_pro_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.it_bit_buf = (UWORD8*)persistant_ptr;
|
p_obj_drc->str_bit_handler.it_bit_buf = (UWORD8 *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 32*1024; /*varify the sizelater*/
|
persistant_ptr = (SIZE_T)persistant_ptr + 32 * 1024; /*varify the sizelater*/
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_params = (ia_drc_sel_proc_params_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_drc_sel_proc_params =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_sel_proc_params_struct);
|
(ia_drc_sel_proc_params_struct *)persistant_ptr;
|
||||||
|
persistant_ptr =
|
||||||
|
(SIZE_T)persistant_ptr + sizeof(ia_drc_sel_proc_params_struct);
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output = (ia_drc_sel_proc_output_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_sel_proc_output_struct)+16*1024;
|
(ia_drc_sel_proc_output_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr +
|
||||||
|
sizeof(ia_drc_sel_proc_output_struct) + 16 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.bitstream_drc_config = (UWORD8*)persistant_ptr;
|
p_obj_drc->str_bit_handler.bitstream_drc_config = (UWORD8 *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 8*1024;
|
persistant_ptr = (SIZE_T)persistant_ptr + 8 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.bitstream_loudness_info = (UWORD8*)persistant_ptr;
|
p_obj_drc->str_bit_handler.bitstream_loudness_info = (UWORD8 *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 8*1024;
|
persistant_ptr = (SIZE_T)persistant_ptr + 8 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.bitstream_unidrc_interface = (UWORD8*)persistant_ptr;
|
p_obj_drc->str_bit_handler.bitstream_unidrc_interface =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 8*1024;
|
(UWORD8 *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + 8 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_peak_limiter = (ia_drc_peak_limiter_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_peak_limiter =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_peak_limiter_struct)+32;
|
(ia_drc_peak_limiter_struct *)persistant_ptr;
|
||||||
|
persistant_ptr =
|
||||||
|
(SIZE_T)persistant_ptr + sizeof(ia_drc_peak_limiter_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_peak_limiter->buffer = (FLOAT32*)((SIZE_T) p_obj_drc->str_payload.pstr_peak_limiter+sizeof(ia_drc_peak_limiter_struct)+32);
|
p_obj_drc->str_payload.pstr_peak_limiter->buffer =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 16*1024;
|
(FLOAT32 *)((SIZE_T)p_obj_drc->str_payload.pstr_peak_limiter +
|
||||||
|
sizeof(ia_drc_peak_limiter_struct) + 32);
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + 16 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_qmf_filter = (ia_drc_qmf_filt_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_qmf_filter =
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_qmf_filt_struct)+32;
|
(ia_drc_qmf_filt_struct *)persistant_ptr;
|
||||||
|
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_qmf_filt_struct) + 32;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_qmf_filter->ana_buff = (FLOAT64*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_qmf_filter->ana_buff = (FLOAT64 *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 16*1024;
|
persistant_ptr = (SIZE_T)persistant_ptr + 16 * 1024;
|
||||||
|
|
||||||
p_obj_drc->str_payload.pstr_qmf_filter->syn_buff = (FLOAT64*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_qmf_filter->syn_buff = (FLOAT64 *)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + 16*1024;
|
persistant_ptr = (SIZE_T)persistant_ptr + 16 * 1024;
|
||||||
|
|
||||||
p_obj_drc->p_state->persistant_ptr=(pVOID)persistant_ptr;
|
p_obj_drc->p_state->persistant_ptr = (pVOID)persistant_ptr;
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID init_qmf_filt_bank(ia_drc_qmf_filt_struct *qmf_filt)
|
VOID init_qmf_filt_bank(ia_drc_qmf_filt_struct *qmf_filt) {
|
||||||
{
|
WORD32 l, k;
|
||||||
|
|
||||||
WORD32 l,k;
|
FLOAT64 gain_ana = 64.0 / QMF_FILT_RESOLUTION;
|
||||||
|
FLOAT64 gain_syn = 1.0 / 64.0;
|
||||||
FLOAT64 gain_ana =64.0 / QMF_FILT_RESOLUTION;
|
for (l = 0; l < 2 * QMF_FILT_RESOLUTION; l++) {
|
||||||
FLOAT64 gain_syn =1.0 / 64.0;
|
for (k = 0; k < QMF_FILT_RESOLUTION; k++) {
|
||||||
for ( l=0; l<2*QMF_FILT_RESOLUTION; l++ )
|
qmf_filt->syn_tab_real[l][k] =
|
||||||
{
|
gain_syn * cos((0.0245436926) * (k + 0.5) * (2 * l - 255.0));
|
||||||
for ( k=0; k<QMF_FILT_RESOLUTION; k++ )
|
qmf_filt->syn_tab_imag[l][k] =
|
||||||
{
|
gain_syn * sin((0.0245436926) * (k + 0.5) * (2 * l - 255.0));
|
||||||
qmf_filt->syn_tab_real[l][k] = gain_syn * cos((0.0245436926) * (k+0.5) * (2*l-255.0));
|
qmf_filt->ana_tab_real[k][l] =
|
||||||
qmf_filt->syn_tab_imag[l][k] = gain_syn * sin((0.0245436926) * (k+0.5) * (2*l-255.0));
|
gain_ana * cos((0.0245436926) * (k + 0.5) * (2 * l - 1.0));
|
||||||
qmf_filt->ana_tab_real[k][l] = gain_ana * cos((0.0245436926) * (k+0.5) * (2*l-1.0));
|
qmf_filt->ana_tab_imag[k][l] =
|
||||||
qmf_filt->ana_tab_imag[k][l] = gain_ana * sin((0.0245436926) * (k+0.5) * (2*l-1.0));
|
gain_ana * sin((0.0245436926) * (k + 0.5) * (2 * l - 1.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
|
||||||
IA_ERRORCODE err_code = IA_NO_ERROR;
|
IA_ERRORCODE err_code = IA_NO_ERROR;
|
||||||
WORD32 i,j;
|
WORD32 i, j;
|
||||||
|
|
||||||
pVOID persistant_ptr =p_obj_drc->p_state->persistant_ptr;
|
pVOID persistant_ptr = p_obj_drc->p_state->persistant_ptr;
|
||||||
|
|
||||||
struct ia_bit_buf_struct *it_bit_buff;
|
struct ia_bit_buf_struct *it_bit_buff;
|
||||||
|
|
||||||
WORD32 decDownmixIdList[NUM_GAIN_DEC_INSTANCES] = { 0, 4 };
|
WORD32 decDownmixIdList[NUM_GAIN_DEC_INSTANCES] = {0, 4};
|
||||||
|
|
||||||
|
p_obj_drc->p_state->delay_in_output = 0;
|
||||||
|
p_obj_drc->str_payload.pstr_selection_proc->first_frame = 1;
|
||||||
|
|
||||||
p_obj_drc->p_state->delay_in_output =0;
|
p_obj_drc->pstr_bit_buf = impd_create_init_bit_buf(
|
||||||
p_obj_drc->str_payload.pstr_selection_proc->first_frame=1;
|
&p_obj_drc->str_bit_buf, p_obj_drc->str_bit_handler.it_bit_buf,
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs / 8);
|
||||||
|
|
||||||
p_obj_drc->pstr_bit_buf = impd_create_init_bit_buf(&p_obj_drc->str_bit_buf, p_obj_drc->str_bit_handler.it_bit_buf, p_obj_drc->str_bit_handler.num_bytes_bs/8);
|
|
||||||
it_bit_buff = p_obj_drc->pstr_bit_buf;
|
it_bit_buff = p_obj_drc->pstr_bit_buf;
|
||||||
|
|
||||||
|
err_code = impd_init_drc_bitstream_dec(
|
||||||
|
p_obj_drc->str_payload.pstr_bitstream_dec,
|
||||||
|
p_obj_drc->str_config.sampling_rate, p_obj_drc->str_config.frame_size,
|
||||||
|
p_obj_drc->str_config.delay_mode, -1, 0);
|
||||||
|
|
||||||
err_code = impd_init_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
for (i = 0; i < NUM_GAIN_DEC_INSTANCES; i++) {
|
||||||
p_obj_drc->str_config.sampling_rate,
|
|
||||||
p_obj_drc->str_config.frame_size,
|
|
||||||
p_obj_drc->str_config.delay_mode,
|
|
||||||
-1,
|
|
||||||
0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i=0; i<NUM_GAIN_DEC_INSTANCES; i++) {
|
|
||||||
err_code = impd_init_drc_decode(p_obj_drc->str_config.frame_size,
|
err_code = impd_init_drc_decode(p_obj_drc->str_config.frame_size,
|
||||||
p_obj_drc->str_config.sampling_rate,
|
p_obj_drc->str_config.sampling_rate,
|
||||||
p_obj_drc->str_config.gain_delay_samples,
|
p_obj_drc->str_config.gain_delay_samples,
|
||||||
p_obj_drc->str_config.delay_mode,
|
p_obj_drc->str_config.delay_mode,
|
||||||
p_obj_drc->str_config.sub_band_domain_mode,
|
p_obj_drc->str_config.sub_band_domain_mode,
|
||||||
p_obj_drc->str_payload.pstr_gain_dec[i]);
|
p_obj_drc->str_payload.pstr_gain_dec[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_obj_drc->str_config.interface_bitstream_present) {
|
if (p_obj_drc->str_config.interface_bitstream_present) {
|
||||||
|
err_code = impd_drc_dec_interface_add_effect_type(
|
||||||
|
p_obj_drc->str_payload.pstr_drc_interface,
|
||||||
err_code = impd_drc_dec_interface_add_effect_type(p_obj_drc->str_payload.pstr_drc_interface,
|
|
||||||
p_obj_drc->str_config.effect_type,
|
p_obj_drc->str_config.effect_type,
|
||||||
p_obj_drc->str_config.target_loudness,
|
p_obj_drc->str_config.target_loudness,
|
||||||
p_obj_drc->str_config.loud_norm_flag);
|
p_obj_drc->str_config.loud_norm_flag);
|
||||||
|
|
||||||
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
|
|
||||||
|
err_code = impd_drc_uni_selction_proc_init(
|
||||||
if (err_code!=IA_NO_ERROR)
|
p_obj_drc->str_payload.pstr_selection_proc, 0,
|
||||||
return err_code;
|
|
||||||
|
|
||||||
err_code = impd_drc_uni_selction_proc_init(p_obj_drc->str_payload.pstr_selection_proc,
|
|
||||||
0,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_interface,
|
p_obj_drc->str_payload.pstr_drc_interface,
|
||||||
p_obj_drc->str_config.sub_band_domain_mode);
|
p_obj_drc->str_config.sub_band_domain_mode);
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_interface->loudness_norm_parameter_interface_flag && p_obj_drc->str_payload.pstr_drc_interface->loudness_norm_param_interface.peak_limiter) {
|
if (p_obj_drc->str_payload.pstr_drc_interface
|
||||||
|
->loudness_norm_parameter_interface_flag &&
|
||||||
|
p_obj_drc->str_payload.pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.peak_limiter) {
|
||||||
p_obj_drc->str_config.peak_limiter = 1;
|
p_obj_drc->str_config.peak_limiter = 1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
err_code = impd_set_default_params_selection_process(
|
||||||
|
p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
||||||
err_code = impd_set_default_params_selection_process(p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
if (err_code!=IA_NO_ERROR)
|
err_code =
|
||||||
return err_code;
|
impd_set_custom_params(p_obj_drc->str_config.control_parameter_index,
|
||||||
err_code = impd_set_custom_params(p_obj_drc->str_config.control_parameter_index,p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
err_code = impd_eval_custom_params_selection_process(
|
||||||
err_code = impd_eval_custom_params_selection_process(p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
err_code = impd_drc_uni_selction_proc_init(
|
||||||
err_code = impd_drc_uni_selction_proc_init(p_obj_drc->str_payload.pstr_selection_proc, p_obj_drc->str_payload.pstr_drc_sel_proc_params, 0, p_obj_drc->str_config.sub_band_domain_mode);
|
p_obj_drc->str_payload.pstr_selection_proc,
|
||||||
if (err_code!=IA_NO_ERROR)
|
p_obj_drc->str_payload.pstr_drc_sel_proc_params, 0,
|
||||||
return err_code;
|
p_obj_drc->str_config.sub_band_domain_mode);
|
||||||
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_sel_proc_params->peak_limiter) {
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_params->peak_limiter) {
|
||||||
p_obj_drc->str_config.peak_limiter = 1;
|
p_obj_drc->str_config.peak_limiter = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_album_count=0;
|
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_album_count = 0;
|
||||||
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_count=0;
|
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_count = 0;
|
||||||
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_set_ext_present=0;
|
p_obj_drc->str_payload.pstr_loudness_info->loudness_info_set_ext_present = 0;
|
||||||
p_obj_drc->p_state->ui_exe_done =0;
|
p_obj_drc->p_state->ui_exe_done = 0;
|
||||||
|
|
||||||
if(p_obj_drc->str_config.bitstream_file_format == BITSTREAM_FILE_FORMAT_SPLIT) {
|
if (p_obj_drc->str_config.bitstream_file_format ==
|
||||||
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
err_code = impd_process_drc_bitstream_dec_config(p_obj_drc->str_payload.pstr_bitstream_dec,
|
err_code = impd_process_drc_bitstream_dec_config(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
&p_obj_drc->str_bit_handler.bitstream_drc_config[0],
|
&p_obj_drc->str_bit_handler.bitstream_drc_config[0],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config);
|
p_obj_drc->str_bit_handler.num_bytes_bs_drc_config);
|
||||||
|
|
||||||
|
if (err_code == 1) {
|
||||||
|
err_code = impd_drc_set_default_bitstream_config(
|
||||||
if(err_code==1)
|
p_obj_drc->str_payload.pstr_drc_config);
|
||||||
{
|
p_obj_drc->str_payload.pstr_drc_config->channel_layout
|
||||||
err_code=impd_drc_set_default_bitstream_config(p_obj_drc->str_payload.pstr_drc_config);
|
.base_channel_count = p_obj_drc->str_config.num_ch_in;
|
||||||
p_obj_drc->str_payload.pstr_drc_config->channel_layout.base_channel_count =
|
|
||||||
p_obj_drc->str_config.num_ch_in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
if (err_code!=IA_NO_ERROR)
|
err_code = impd_process_drc_bitstream_dec_loudness_info_set(
|
||||||
return err_code;
|
p_obj_drc->pstr_bit_buf, p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
err_code = impd_process_drc_bitstream_dec_loudness_info_set(p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
|
||||||
&p_obj_drc->str_bit_handler.bitstream_loudness_info[0],
|
&p_obj_drc->str_bit_handler.bitstream_loudness_info[0],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info
|
p_obj_drc->str_bit_handler.num_bytes_bs_loudness_info);
|
||||||
);
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
if (err_code!=IA_NO_ERROR)
|
|
||||||
return err_code;
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
err_code = impd_process_drc_bitstream_dec(
|
||||||
err_code = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (err_code > PROC_COMPLETE)
|
if (err_code > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err_code = impd_drc_uni_sel_proc_process(
|
||||||
err_code = impd_drc_uni_sel_proc_process(p_obj_drc->str_payload.pstr_selection_proc,
|
p_obj_drc->str_payload.pstr_selection_proc,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output);
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
|
||||||
|
|
||||||
for (i=0; i<NUM_GAIN_DEC_INSTANCES; i++){
|
for (i = 0; i < NUM_GAIN_DEC_INSTANCES; i++) {
|
||||||
|
WORD32 audio_num_chan = 0;
|
||||||
WORD32 audio_num_chan=0;
|
|
||||||
WORD32 numMatchingDrcSets = 0;
|
WORD32 numMatchingDrcSets = 0;
|
||||||
WORD32 matchingDrcSetIds[3], matchingDownmixIds[3];
|
WORD32 matchingDrcSetIds[3], matchingDownmixIds[3];
|
||||||
for (j=0; j<p_obj_drc->str_payload.pstr_drc_sel_proc_output->num_sel_drc_sets; j++) {
|
for (j = 0;
|
||||||
|
j < p_obj_drc->str_payload.pstr_drc_sel_proc_output->num_sel_drc_sets;
|
||||||
if (impd_match_downmix(p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_downmix_ids[j], decDownmixIdList[i])) {
|
j++) {
|
||||||
matchingDrcSetIds[numMatchingDrcSets] = p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_drc_set_ids[j];
|
if (impd_match_downmix(p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
matchingDownmixIds[numMatchingDrcSets] = p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_downmix_ids[j];
|
->sel_downmix_ids[j],
|
||||||
|
decDownmixIdList[i])) {
|
||||||
|
matchingDrcSetIds[numMatchingDrcSets] =
|
||||||
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_drc_set_ids[j];
|
||||||
|
matchingDownmixIds[numMatchingDrcSets] =
|
||||||
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_downmix_ids[j];
|
||||||
numMatchingDrcSets++;
|
numMatchingDrcSets++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i==0)
|
if (i == 0) {
|
||||||
{
|
if (p_obj_drc->str_config.num_ch_in !=
|
||||||
if (p_obj_drc->str_config.num_ch_in != p_obj_drc->str_payload.pstr_drc_sel_proc_output->base_channel_count)
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->base_channel_count)
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
audio_num_chan = p_obj_drc->str_config.num_ch_in;
|
audio_num_chan = p_obj_drc->str_config.num_ch_in;
|
||||||
} else if (i==1)
|
} else if (i == 1) {
|
||||||
{
|
p_obj_drc->str_config.num_ch_out =
|
||||||
p_obj_drc->str_config.num_ch_out = p_obj_drc->str_payload.pstr_drc_sel_proc_output->target_channel_count;
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->target_channel_count;
|
||||||
audio_num_chan = p_obj_drc->str_config.num_ch_out;
|
audio_num_chan = p_obj_drc->str_config.num_ch_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_init_drc_decode_post_config(audio_num_chan,
|
err_code = impd_init_drc_decode_post_config(
|
||||||
matchingDrcSetIds,
|
audio_num_chan, matchingDrcSetIds, matchingDownmixIds,
|
||||||
matchingDownmixIds,
|
numMatchingDrcSets,
|
||||||
numMatchingDrcSets
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_eq_set_ids[i]
|
||||||
, p_obj_drc->str_payload.pstr_drc_sel_proc_output->sel_eq_set_ids[i]
|
|
||||||
|
|
||||||
, p_obj_drc->str_payload.pstr_gain_dec[i]
|
,
|
||||||
, p_obj_drc->str_payload.pstr_drc_config
|
p_obj_drc->str_payload.pstr_gain_dec[i],
|
||||||
, p_obj_drc->str_payload.pstr_loudness_info
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
, &persistant_ptr
|
p_obj_drc->str_payload.pstr_loudness_info, &persistant_ptr);
|
||||||
);
|
|
||||||
|
|
||||||
impd_get_parametric_drc_delay(p_obj_drc->str_payload.pstr_gain_dec[i], p_obj_drc->str_payload.pstr_drc_config, & p_obj_drc->str_config.parametric_drc_delay_gain_dec_instance, &p_obj_drc->str_config.parametric_drc_delay_max);
|
|
||||||
impd_get_eq_delay(p_obj_drc->str_payload.pstr_gain_dec[i], p_obj_drc->str_payload.pstr_drc_config, & p_obj_drc->str_config.eq_delay_gain_dec_instance, & p_obj_drc->str_config.eq_delay_max);
|
|
||||||
p_obj_drc->str_config.parametric_drc_delay += p_obj_drc->str_config.parametric_drc_delay_gain_dec_instance;
|
|
||||||
p_obj_drc->str_config.eq_delay += p_obj_drc->str_config.eq_delay_gain_dec_instance;
|
|
||||||
|
|
||||||
|
impd_get_parametric_drc_delay(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[i],
|
||||||
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
|
&p_obj_drc->str_config.parametric_drc_delay_gain_dec_instance,
|
||||||
|
&p_obj_drc->str_config.parametric_drc_delay_max);
|
||||||
|
impd_get_eq_delay(p_obj_drc->str_payload.pstr_gain_dec[i],
|
||||||
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
|
&p_obj_drc->str_config.eq_delay_gain_dec_instance,
|
||||||
|
&p_obj_drc->str_config.eq_delay_max);
|
||||||
|
p_obj_drc->str_config.parametric_drc_delay +=
|
||||||
|
p_obj_drc->str_config.parametric_drc_delay_gain_dec_instance;
|
||||||
|
p_obj_drc->str_config.eq_delay +=
|
||||||
|
p_obj_drc->str_config.eq_delay_gain_dec_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
if (p_obj_drc->str_config.parametric_drc_delay_max == -1) {
|
if (p_obj_drc->str_config.parametric_drc_delay_max == -1) {
|
||||||
p_obj_drc->str_config.parametric_drc_delay_max = PARAMETRIC_DRC_DELAY_MAX_DEFAULT;
|
p_obj_drc->str_config.parametric_drc_delay_max =
|
||||||
|
PARAMETRIC_DRC_DELAY_MAX_DEFAULT;
|
||||||
}
|
}
|
||||||
if (p_obj_drc->str_config.eq_delay_max == -1) {
|
if (p_obj_drc->str_config.eq_delay_max == -1) {
|
||||||
p_obj_drc->str_config.eq_delay_max = EQ_DELAY_MAX_DEFAULT;
|
p_obj_drc->str_config.eq_delay_max = EQ_DELAY_MAX_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p_obj_drc->str_config.constant_delay_on) {
|
if (!p_obj_drc->str_config.constant_delay_on) {
|
||||||
|
p_obj_drc->p_state->delay_in_output +=
|
||||||
p_obj_drc->p_state->delay_in_output += p_obj_drc->str_config.parametric_drc_delay + p_obj_drc->str_config.eq_delay + p_obj_drc->str_config.audio_delay_samples;
|
p_obj_drc->str_config.parametric_drc_delay +
|
||||||
p_obj_drc->str_config.delay_line_samples = p_obj_drc->str_config.audio_delay_samples;
|
p_obj_drc->str_config.eq_delay +
|
||||||
|
p_obj_drc->str_config.audio_delay_samples;
|
||||||
|
p_obj_drc->str_config.delay_line_samples =
|
||||||
|
p_obj_drc->str_config.audio_delay_samples;
|
||||||
|
|
||||||
if (!p_obj_drc->str_config.absorb_delay_on) {
|
if (!p_obj_drc->str_config.absorb_delay_on) {
|
||||||
p_obj_drc->p_state->delay_in_output = 0;
|
p_obj_drc->p_state->delay_in_output = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p_obj_drc->p_state->delay_in_output += p_obj_drc->str_config.parametric_drc_delay_max + p_obj_drc->str_config.eq_delay_max + p_obj_drc->str_config.audio_delay_samples;
|
p_obj_drc->p_state->delay_in_output +=
|
||||||
p_obj_drc->str_config.delay_line_samples = p_obj_drc->p_state->delay_in_output - p_obj_drc->str_config.parametric_drc_delay + p_obj_drc->str_config.eq_delay;
|
p_obj_drc->str_config.parametric_drc_delay_max +
|
||||||
|
p_obj_drc->str_config.eq_delay_max +
|
||||||
|
p_obj_drc->str_config.audio_delay_samples;
|
||||||
|
p_obj_drc->str_config.delay_line_samples =
|
||||||
|
p_obj_drc->p_state->delay_in_output -
|
||||||
|
p_obj_drc->str_config.parametric_drc_delay +
|
||||||
|
p_obj_drc->str_config.eq_delay;
|
||||||
|
|
||||||
if (!p_obj_drc->str_config.absorb_delay_on ) {
|
if (!p_obj_drc->str_config.absorb_delay_on) {
|
||||||
p_obj_drc->p_state->delay_in_output = 0;
|
p_obj_drc->p_state->delay_in_output = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(p_obj_drc->str_config.dec_type==1)
|
if (p_obj_drc->str_config.dec_type == 1) {
|
||||||
{
|
|
||||||
init_qmf_filt_bank(p_obj_drc->str_payload.pstr_qmf_filter);
|
init_qmf_filt_bank(p_obj_drc->str_payload.pstr_qmf_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_obj_drc->str_config.peak_limiter)
|
if (p_obj_drc->str_config.peak_limiter) {
|
||||||
{
|
impd_peak_limiter_init(
|
||||||
impd_peak_limiter_init(p_obj_drc->str_payload.pstr_peak_limiter,
|
p_obj_drc->str_payload.pstr_peak_limiter, DEFAULT_ATTACK_TIME_MS,
|
||||||
DEFAULT_ATTACK_TIME_MS,
|
DEFAULT_RELEASE_TIME_MS, LIM_DEFAULT_THRESHOLD,
|
||||||
DEFAULT_RELEASE_TIME_MS,
|
p_obj_drc->str_config.num_ch_out, p_obj_drc->str_config.sampling_rate,
|
||||||
LIM_DEFAULT_THRESHOLD,
|
|
||||||
p_obj_drc->str_config.num_ch_out,
|
|
||||||
p_obj_drc->str_config.sampling_rate,
|
|
||||||
p_obj_drc->str_payload.pstr_peak_limiter->buffer);
|
p_obj_drc->str_payload.pstr_peak_limiter->buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ typedef struct {
|
||||||
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS][MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS]
|
||||||
|
[MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
||||||
WORD32 requested_dyn_rng_measurement_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_rng_measurement_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_dyn_range_is_single_val_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_range_is_single_val_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
|
|
@ -109,10 +110,10 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 interface_signat_type;
|
WORD32 interface_signat_type;
|
||||||
WORD32 interface_signat_data_len;
|
WORD32 interface_signat_data_len;
|
||||||
UWORD32 interface_signat_data[MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE*8];
|
UWORD32 interface_signat_data[MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8];
|
||||||
} ia_drc_uni_interface_signat_struct;
|
} ia_drc_uni_interface_signat_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_interface_struct{
|
typedef struct ia_drc_interface_struct {
|
||||||
WORD32 interface_signat_flag;
|
WORD32 interface_signat_flag;
|
||||||
WORD32 system_interface_flag;
|
WORD32 system_interface_flag;
|
||||||
WORD32 loudness_norm_ctrl_interface_flag;
|
WORD32 loudness_norm_ctrl_interface_flag;
|
||||||
|
|
|
||||||
|
|
@ -30,119 +30,132 @@
|
||||||
#include "impd_drc_parser_interface.h"
|
#include "impd_drc_parser_interface.h"
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_dec_interface_process(
|
impd_drc_dec_interface_process(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
|
||||||
ia_drc_interface_struct* pstr_drc_interface,
|
ia_drc_interface_struct* pstr_drc_interface,
|
||||||
UWORD8* it_bit_buf,
|
UWORD8* it_bit_buf, WORD32 num_bit_stream_bits,
|
||||||
WORD32 num_bit_stream_bits,
|
WORD32* num_bits_read) {
|
||||||
WORD32* num_bits_read)
|
|
||||||
{
|
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
|
|
||||||
if (it_bit_buff != NULL && num_bit_stream_bits) {
|
if (it_bit_buff != NULL && num_bit_stream_bits) {
|
||||||
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, it_bit_buf, num_bit_stream_bits/8);
|
it_bit_buff = impd_create_init_bit_buf(it_bit_buff, it_bit_buf,
|
||||||
|
num_bit_stream_bits / 8);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = impd_unidrc_interface_read(it_bit_buff, pstr_drc_interface);
|
err = impd_unidrc_interface_read(it_bit_buff, pstr_drc_interface);
|
||||||
if (err) return(err);
|
if (err) return (err);
|
||||||
|
|
||||||
*num_bits_read = (it_bit_buff->size ) - it_bit_buff->cnt_bits;
|
*num_bits_read = (it_bit_buff->size) - it_bit_buff->cnt_bits;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_dec_interface_add_effect_type(ia_drc_interface_struct* pstr_drc_interface,
|
impd_drc_dec_interface_add_effect_type(
|
||||||
WORD32 drc_effect_type,
|
ia_drc_interface_struct* pstr_drc_interface, WORD32 drc_effect_type,
|
||||||
WORD32 target_loudness,
|
WORD32 target_loudness, WORD32 loud_norm) {
|
||||||
WORD32 loud_norm)
|
|
||||||
{
|
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
WORD32 i = 0;
|
WORD32 i = 0;
|
||||||
|
|
||||||
if (pstr_drc_interface != NULL)
|
if (pstr_drc_interface != NULL) {
|
||||||
{
|
|
||||||
pstr_drc_interface->interface_signat_flag = 0;
|
pstr_drc_interface->interface_signat_flag = 0;
|
||||||
for(i=0;i<MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8;i++)
|
for (i = 0; i < MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8; i++)
|
||||||
pstr_drc_interface->drc_uni_interface_signature.interface_signat_data[i] = 0;
|
pstr_drc_interface->drc_uni_interface_signature.interface_signat_data[i] =
|
||||||
|
0;
|
||||||
|
|
||||||
pstr_drc_interface->drc_uni_interface_signature.interface_signat_data_len = 0;
|
pstr_drc_interface->drc_uni_interface_signature.interface_signat_data_len =
|
||||||
|
0;
|
||||||
|
|
||||||
pstr_drc_interface->system_interface_flag = 1;
|
pstr_drc_interface->system_interface_flag = 1;
|
||||||
|
|
||||||
pstr_drc_interface->system_interface.target_config_request_type = 0;
|
pstr_drc_interface->system_interface.target_config_request_type = 0;
|
||||||
pstr_drc_interface->system_interface.num_downmix_id_requests = 0;
|
pstr_drc_interface->system_interface.num_downmix_id_requests = 0;
|
||||||
for (i = 0; i < MAX_NUM_DOWNMIX_ID_REQUESTS; i++)
|
for (i = 0; i < MAX_NUM_DOWNMIX_ID_REQUESTS; i++) {
|
||||||
{
|
|
||||||
pstr_drc_interface->system_interface.requested_dwnmix_id[i] = 0;
|
pstr_drc_interface->system_interface.requested_dwnmix_id[i] = 0;
|
||||||
}
|
}
|
||||||
pstr_drc_interface->system_interface.requested_target_layout = 0;
|
pstr_drc_interface->system_interface.requested_target_layout = 0;
|
||||||
pstr_drc_interface->system_interface.requested_target_ch_count = 0;
|
pstr_drc_interface->system_interface.requested_target_ch_count = 0;
|
||||||
|
|
||||||
pstr_drc_interface->loudness_norm_ctrl_interface_flag= 1;
|
pstr_drc_interface->loudness_norm_ctrl_interface_flag = 1;
|
||||||
if(loud_norm==1)
|
if (loud_norm == 1) {
|
||||||
{
|
pstr_drc_interface->loudness_norm_ctrl_interface
|
||||||
pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on = 1;
|
.loudness_normalization_on = 1;
|
||||||
|
} else {
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface
|
||||||
|
.loudness_normalization_on = 0;
|
||||||
}
|
}
|
||||||
else
|
pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness =
|
||||||
{
|
(FLOAT32)target_loudness;
|
||||||
pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on = 0;
|
|
||||||
}
|
|
||||||
pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness = (FLOAT32)target_loudness;
|
|
||||||
|
|
||||||
pstr_drc_interface->loudness_norm_parameter_interface_flag = 1;
|
pstr_drc_interface->loudness_norm_parameter_interface_flag = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.album_mode = 0;
|
pstr_drc_interface->loudness_norm_param_interface.album_mode = 0;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.peak_limiter = 0;
|
pstr_drc_interface->loudness_norm_param_interface.peak_limiter = 0;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_deviation_max = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max = 63;
|
.change_loudness_deviation_max = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_method = 1;
|
pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max =
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_method = 1;
|
63;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_system = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_system = 1;
|
.change_loudness_measur_method = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_pre_proc = 0;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_pre_proc = 0;
|
.loudness_measurement_method = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_device_cut_off_freq = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency = 20;
|
.change_loudness_measur_system = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_db_max = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_db_max = 1000.0;
|
.loudness_measurement_system = 1;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_modification_db = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_modification_db = 0.0;
|
.change_loudness_measur_pre_proc = 0;
|
||||||
pstr_drc_interface->loudness_norm_param_interface.change_output_peak_level_max = 1;
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max = 0.0;
|
.loudness_measurement_pre_proc = 0;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.change_device_cut_off_freq = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency =
|
||||||
|
20;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.change_loudness_norm_gain_db_max = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_db_max = 1000.0;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.change_loudness_norm_gain_modification_db = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_modification_db = 0.0;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.change_output_peak_level_max = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max =
|
||||||
|
0.0;
|
||||||
|
|
||||||
pstr_drc_interface->drc_interface_flag = 1;
|
pstr_drc_interface->drc_interface_flag = 1;
|
||||||
if(drc_effect_type==-1)
|
if (drc_effect_type == -1) {
|
||||||
{
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 0;
|
||||||
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on=0;
|
pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] =
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] = 0;
|
0;
|
||||||
}
|
} else if (drc_effect_type == 0) {
|
||||||
else if(drc_effect_type==0)
|
|
||||||
{
|
|
||||||
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on=1;
|
|
||||||
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] = drc_effect_type;
|
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 0;
|
||||||
|
} else {
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] =
|
||||||
|
drc_effect_type;
|
||||||
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 3;
|
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 3;
|
||||||
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[0] = 0;
|
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[0] = 0;
|
||||||
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[1] = 1;
|
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[1] = 1;
|
||||||
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[2] = 2;
|
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[2] = 2;
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[0] = 1;
|
pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[0] = 1;
|
||||||
pstr_drc_interface->drc_ctrl_interface.desired_num_drc_effects_of_requested[0] = 1;
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.desired_num_drc_effects_of_requested[0] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_dyn_rng_measurement_type[0] = 0;
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[0] = 0;
|
.requested_dyn_rng_measurement_type[0] = 0;
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[1] = 0;
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[1] = 3.0f;
|
.requested_dyn_range_is_single_val_flag[0] = 0;
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[1] = 10.0f;
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_is_single_val_flag[1] = 0;
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[1] =
|
||||||
|
3.0f;
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[1] =
|
||||||
|
10.0f;
|
||||||
pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[2] = 3;
|
pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[2] = 3;
|
||||||
|
|
||||||
pstr_drc_interface->drc_parameter_interface_flag = 1;
|
pstr_drc_interface->drc_parameter_interface_flag = 1;
|
||||||
|
|
@ -150,19 +163,15 @@ impd_drc_dec_interface_add_effect_type(ia_drc_interface_struct* pstr_drc_interfa
|
||||||
pstr_drc_interface->drc_parameter_interface.change_boost = 1;
|
pstr_drc_interface->drc_parameter_interface.change_boost = 1;
|
||||||
pstr_drc_interface->drc_parameter_interface.compress = 1.0f;
|
pstr_drc_interface->drc_parameter_interface.compress = 1.0f;
|
||||||
pstr_drc_interface->drc_parameter_interface.boost = 1.0f;
|
pstr_drc_interface->drc_parameter_interface.boost = 1.0f;
|
||||||
pstr_drc_interface->drc_parameter_interface.change_drc_characteristic_target = 1;
|
pstr_drc_interface->drc_parameter_interface
|
||||||
|
.change_drc_characteristic_target = 1;
|
||||||
pstr_drc_interface->drc_parameter_interface.drc_characteristic_target = 0;
|
pstr_drc_interface->drc_parameter_interface.drc_characteristic_target = 0;
|
||||||
|
|
||||||
|
|
||||||
pstr_drc_interface->drc_uni_interface_ext_flag = 0;
|
pstr_drc_interface->drc_uni_interface_ext_flag = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return UNEXPECTED_ERROR;
|
return UNEXPECTED_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,300 +28,295 @@
|
||||||
#include "impd_drc_extr_delta_coded_info.h"
|
#include "impd_drc_extr_delta_coded_info.h"
|
||||||
#include "impd_drc_struct.h"
|
#include "impd_drc_struct.h"
|
||||||
|
|
||||||
WORD32 impd_unidrc_interface_signature_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_unidrc_interface_signature_read(
|
||||||
ia_drc_uni_interface_signat_struct* drc_uni_interface_signature)
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
{
|
ia_drc_uni_interface_signat_struct* drc_uni_interface_signature) {
|
||||||
//WORD32 err = 0
|
// WORD32 err = 0
|
||||||
WORD32 interface_signat_data_len = 0, i, tmp;
|
WORD32 interface_signat_data_len = 0, i, tmp;
|
||||||
|
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 16);
|
tmp = impd_read_bits_buf(it_bit_buff, 16);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
drc_uni_interface_signature->interface_signat_type = (tmp>>8)&0xff;
|
drc_uni_interface_signature->interface_signat_type = (tmp >> 8) & 0xff;
|
||||||
drc_uni_interface_signature->interface_signat_data_len = tmp&0xff;
|
drc_uni_interface_signature->interface_signat_data_len = tmp & 0xff;
|
||||||
|
|
||||||
interface_signat_data_len = drc_uni_interface_signature->interface_signat_data_len + 1;
|
interface_signat_data_len =
|
||||||
for (i=0; i<interface_signat_data_len; i++) {
|
drc_uni_interface_signature->interface_signat_data_len + 1;
|
||||||
|
for (i = 0; i < interface_signat_data_len; i++) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
drc_uni_interface_signature->interface_signat_data[i] = (UWORD32)tmp;
|
drc_uni_interface_signature->interface_signat_data[i] = (UWORD32)tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
WORD32 impd_sys_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_sys_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_system_interface_struct* system_interface)
|
ia_system_interface_struct* system_interface) {
|
||||||
{
|
// WORD32 err = 0;
|
||||||
//WORD32 err = 0;
|
|
||||||
WORD32 i = 0, tmp = 0;
|
WORD32 i = 0, tmp = 0;
|
||||||
|
|
||||||
system_interface->target_config_request_type = impd_read_bits_buf(it_bit_buff, 2);
|
system_interface->target_config_request_type =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 2);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
switch (system_interface->target_config_request_type) {
|
switch (system_interface->target_config_request_type) {
|
||||||
case 0:
|
case 0:
|
||||||
system_interface->num_downmix_id_requests = impd_read_bits_buf(it_bit_buff, 4);
|
system_interface->num_downmix_id_requests =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 4);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
if (system_interface->num_downmix_id_requests == 0) {
|
if (system_interface->num_downmix_id_requests == 0) {
|
||||||
system_interface->num_downmix_id_requests = 1;
|
system_interface->num_downmix_id_requests = 1;
|
||||||
system_interface->requested_dwnmix_id[0] = 0;
|
system_interface->requested_dwnmix_id[0] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (i=0; i<system_interface->num_downmix_id_requests; i++) {
|
for (i = 0; i < system_interface->num_downmix_id_requests; i++) {
|
||||||
system_interface->requested_dwnmix_id[i] = impd_read_bits_buf(it_bit_buff, 7);
|
system_interface->requested_dwnmix_id[i] =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 7);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
system_interface->requested_target_layout = impd_read_bits_buf(it_bit_buff, 8);
|
system_interface->requested_target_layout =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 8);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 7);
|
tmp = impd_read_bits_buf(it_bit_buff, 7);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
system_interface->requested_target_ch_count = tmp + 1;
|
system_interface->requested_target_ch_count = tmp + 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(1);
|
return (1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_loudness_norm_control_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_loudness_norm_control_interface_read(
|
||||||
ia_loudness_norm_ctrl_interface_struct* loudness_norm_ctrl_interface)
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
{
|
ia_loudness_norm_ctrl_interface_struct* loudness_norm_ctrl_interface) {
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
WORD32 tmp = 0;
|
WORD32 tmp = 0;
|
||||||
|
|
||||||
loudness_norm_ctrl_interface->loudness_normalization_on = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_ctrl_interface->loudness_normalization_on =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
if (loudness_norm_ctrl_interface->loudness_normalization_on == 1) {
|
if (loudness_norm_ctrl_interface->loudness_normalization_on == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 12);
|
tmp = impd_read_bits_buf(it_bit_buff, 12);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
loudness_norm_ctrl_interface->target_loudness = -tmp * 0.03125f;
|
||||||
loudness_norm_ctrl_interface->target_loudness = - tmp * 0.03125f;
|
|
||||||
}
|
}
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_loudness_norm_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_loudness_norm_param_interface_read(
|
||||||
ia_loudness_norm_parameter_interface_struct* loudness_norm_param_interface)
|
ia_bit_buf_struct* it_bit_buff, ia_loudness_norm_parameter_interface_struct*
|
||||||
{
|
loudness_norm_param_interface) {
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
WORD32 tmp = 0;
|
WORD32 tmp = 0;
|
||||||
|
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 3);
|
tmp = impd_read_bits_buf(it_bit_buff, 3);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
loudness_norm_param_interface->album_mode = (tmp>>2)&1;
|
loudness_norm_param_interface->album_mode = (tmp >> 2) & 1;
|
||||||
loudness_norm_param_interface->peak_limiter = (tmp>>1)&1;
|
loudness_norm_param_interface->peak_limiter = (tmp >> 1) & 1;
|
||||||
loudness_norm_param_interface->change_loudness_deviation_max = tmp&1;
|
loudness_norm_param_interface->change_loudness_deviation_max = tmp & 1;
|
||||||
|
|
||||||
if (loudness_norm_param_interface->change_loudness_deviation_max == 1) {
|
if (loudness_norm_param_interface->change_loudness_deviation_max == 1) {
|
||||||
loudness_norm_param_interface->loudness_deviation_max = impd_read_bits_buf(it_bit_buff, 6);
|
loudness_norm_param_interface->loudness_deviation_max =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 6);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_loudness_measur_method = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_measur_method =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_loudness_measur_method == 1) {
|
if (loudness_norm_param_interface->change_loudness_measur_method == 1) {
|
||||||
loudness_norm_param_interface->loudness_measurement_method = impd_read_bits_buf(it_bit_buff, 3);
|
loudness_norm_param_interface->loudness_measurement_method =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 3);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_loudness_measur_system = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_measur_system =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_loudness_measur_system == 1) {
|
if (loudness_norm_param_interface->change_loudness_measur_system == 1) {
|
||||||
loudness_norm_param_interface->loudness_measurement_system = impd_read_bits_buf(it_bit_buff, 4);
|
loudness_norm_param_interface->loudness_measurement_system =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 4);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_loudness_measur_pre_proc = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_measur_pre_proc =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_loudness_measur_pre_proc == 1) {
|
if (loudness_norm_param_interface->change_loudness_measur_pre_proc == 1) {
|
||||||
loudness_norm_param_interface->loudness_measurement_pre_proc = impd_read_bits_buf(it_bit_buff, 2);
|
loudness_norm_param_interface->loudness_measurement_pre_proc =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 2);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_device_cut_off_freq = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_device_cut_off_freq =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_device_cut_off_freq == 1) {
|
if (loudness_norm_param_interface->change_device_cut_off_freq == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
loudness_norm_param_interface->device_cut_off_frequency =
|
||||||
loudness_norm_param_interface->device_cut_off_frequency = max(min(tmp*10,500),20);
|
max(min(tmp * 10, 500), 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_loudness_norm_gain_db_max = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_norm_gain_db_max =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_loudness_norm_gain_db_max == 1) {
|
if (loudness_norm_param_interface->change_loudness_norm_gain_db_max == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
if (tmp < 63) {
|
||||||
if (tmp<63) {
|
loudness_norm_param_interface->loudness_norm_gain_db_max = tmp * 0.5f;
|
||||||
loudness_norm_param_interface->loudness_norm_gain_db_max = tmp*0.5f;
|
|
||||||
} else {
|
} else {
|
||||||
loudness_norm_param_interface->loudness_norm_gain_db_max = LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
loudness_norm_param_interface->loudness_norm_gain_db_max =
|
||||||
|
LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_loudness_norm_gain_modification_db = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_norm_gain_modification_db =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_loudness_norm_gain_modification_db == 1) {
|
if (loudness_norm_param_interface
|
||||||
|
->change_loudness_norm_gain_modification_db == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 10);
|
tmp = impd_read_bits_buf(it_bit_buff, 10);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
loudness_norm_param_interface->loudness_norm_gain_modification_db =
|
||||||
loudness_norm_param_interface->loudness_norm_gain_modification_db = -16+tmp*0.03125f;
|
-16 + tmp * 0.03125f;
|
||||||
}
|
}
|
||||||
|
|
||||||
loudness_norm_param_interface->change_output_peak_level_max = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_output_peak_level_max =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_norm_param_interface->change_output_peak_level_max == 1) {
|
if (loudness_norm_param_interface->change_output_peak_level_max == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
tmp = impd_read_bits_buf(it_bit_buff, 6);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
loudness_norm_param_interface->output_peak_level_max = tmp * 0.5f;
|
||||||
loudness_norm_param_interface->output_peak_level_max = tmp*0.5f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_drc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_drc_interface_read(
|
||||||
ia_dyn_rng_ctrl_interface_struct* drc_ctrl_interface)
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
{
|
ia_dyn_rng_ctrl_interface_struct* drc_ctrl_interface) {
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
WORD32 i = 0, j = 0, tmp = 0;
|
WORD32 i = 0, j = 0, tmp = 0;
|
||||||
|
|
||||||
drc_ctrl_interface->dynamic_range_control_on = impd_read_bits_buf(it_bit_buff, 1);
|
drc_ctrl_interface->dynamic_range_control_on =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
if (drc_ctrl_interface->dynamic_range_control_on == 1) {
|
if (drc_ctrl_interface->dynamic_range_control_on == 1) {
|
||||||
drc_ctrl_interface->num_drc_feature_requests = impd_read_bits_buf(it_bit_buff, 3);
|
drc_ctrl_interface->num_drc_feature_requests =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 3);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
for (i=0; i<drc_ctrl_interface->num_drc_feature_requests; i++) {
|
for (i = 0; i < drc_ctrl_interface->num_drc_feature_requests; i++) {
|
||||||
drc_ctrl_interface->drc_feature_req_type[i] = impd_read_bits_buf(it_bit_buff, 2);
|
drc_ctrl_interface->drc_feature_req_type[i] =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 2);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
switch (drc_ctrl_interface->drc_feature_req_type[i]) {
|
switch (drc_ctrl_interface->drc_feature_req_type[i]) {
|
||||||
case 0:
|
case 0:
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
drc_ctrl_interface->requested_num_drc_effects[i] = (tmp>>4)&0xf;
|
drc_ctrl_interface->requested_num_drc_effects[i] = (tmp >> 4) & 0xf;
|
||||||
drc_ctrl_interface->desired_num_drc_effects_of_requested[i] = tmp&0xf;
|
drc_ctrl_interface->desired_num_drc_effects_of_requested[i] =
|
||||||
|
tmp & 0xf;
|
||||||
|
|
||||||
for (j=0; j<drc_ctrl_interface->requested_num_drc_effects[i]; j++)
|
for (j = 0; j < drc_ctrl_interface->requested_num_drc_effects[i];
|
||||||
{
|
j++) {
|
||||||
drc_ctrl_interface->requested_drc_effect_type[i][j] = impd_read_bits_buf(it_bit_buff, 4);
|
drc_ctrl_interface->requested_drc_effect_type[i][j] =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 4);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 3);
|
tmp = impd_read_bits_buf(it_bit_buff, 3);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
drc_ctrl_interface->requested_dyn_rng_measurement_type[i] = (tmp>>1)&3;
|
drc_ctrl_interface->requested_dyn_rng_measurement_type[i] =
|
||||||
drc_ctrl_interface->requested_dyn_range_is_single_val_flag[i] = tmp&1;
|
(tmp >> 1) & 3;
|
||||||
|
drc_ctrl_interface->requested_dyn_range_is_single_val_flag[i] =
|
||||||
|
tmp & 1;
|
||||||
|
|
||||||
if (drc_ctrl_interface->requested_dyn_range_is_single_val_flag[i] == 0) {
|
if (drc_ctrl_interface->requested_dyn_range_is_single_val_flag[i] ==
|
||||||
|
0) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (tmp == 0)
|
if (tmp == 0)
|
||||||
drc_ctrl_interface->requested_dyn_range_value[i] = 0.0f;
|
drc_ctrl_interface->requested_dyn_range_value[i] = 0.0f;
|
||||||
else if(tmp <= 128)
|
else if (tmp <= 128)
|
||||||
drc_ctrl_interface->requested_dyn_range_value[i] = tmp * 0.25f;
|
drc_ctrl_interface->requested_dyn_range_value[i] = tmp * 0.25f;
|
||||||
else if(tmp <= 204)
|
else if (tmp <= 204)
|
||||||
drc_ctrl_interface->requested_dyn_range_value[i] = 0.5f * tmp - 32.0f;
|
drc_ctrl_interface->requested_dyn_range_value[i] =
|
||||||
|
0.5f * tmp - 32.0f;
|
||||||
else
|
else
|
||||||
drc_ctrl_interface->requested_dyn_range_value[i] = tmp - 134.0f;
|
drc_ctrl_interface->requested_dyn_range_value[i] = tmp - 134.0f;
|
||||||
} else {
|
} else {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (tmp == 0)
|
if (tmp == 0)
|
||||||
drc_ctrl_interface->requested_dyn_range_min_val[i] = 0.0f;
|
drc_ctrl_interface->requested_dyn_range_min_val[i] = 0.0f;
|
||||||
else if(tmp <= 128)
|
else if (tmp <= 128)
|
||||||
drc_ctrl_interface->requested_dyn_range_min_val[i] = tmp * 0.25f;
|
drc_ctrl_interface->requested_dyn_range_min_val[i] = tmp * 0.25f;
|
||||||
else if(tmp <= 204)
|
else if (tmp <= 204)
|
||||||
drc_ctrl_interface->requested_dyn_range_min_val[i] = 0.5f * tmp - 32.0f;
|
drc_ctrl_interface->requested_dyn_range_min_val[i] =
|
||||||
|
0.5f * tmp - 32.0f;
|
||||||
else
|
else
|
||||||
drc_ctrl_interface->requested_dyn_range_min_val[i] = tmp - 134.0f;
|
drc_ctrl_interface->requested_dyn_range_min_val[i] = tmp - 134.0f;
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (tmp == 0)
|
if (tmp == 0)
|
||||||
drc_ctrl_interface->requested_dyn_range_max_val[i] = 0.0f;
|
drc_ctrl_interface->requested_dyn_range_max_val[i] = 0.0f;
|
||||||
else if(tmp <= 128)
|
else if (tmp <= 128)
|
||||||
drc_ctrl_interface->requested_dyn_range_max_val[i] = tmp * 0.25f;
|
drc_ctrl_interface->requested_dyn_range_max_val[i] = tmp * 0.25f;
|
||||||
else if(tmp <= 204)
|
else if (tmp <= 204)
|
||||||
drc_ctrl_interface->requested_dyn_range_max_val[i] = 0.5f * tmp - 32.0f;
|
drc_ctrl_interface->requested_dyn_range_max_val[i] =
|
||||||
|
0.5f * tmp - 32.0f;
|
||||||
else
|
else
|
||||||
drc_ctrl_interface->requested_dyn_range_max_val[i] = tmp - 134.0f;
|
drc_ctrl_interface->requested_dyn_range_max_val[i] = tmp - 134.0f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
drc_ctrl_interface->requested_drc_characteristic[i] = impd_read_bits_buf(it_bit_buff, 7);
|
drc_ctrl_interface->requested_drc_characteristic[i] =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 7);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(1);
|
return (1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_drc_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_drc_param_interface_read(
|
||||||
ia_drc_parameter_interface_struct* drc_parameter_interface)
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
{
|
ia_drc_parameter_interface_struct* drc_parameter_interface) {
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
WORD32 tmp = 0;
|
WORD32 tmp = 0;
|
||||||
|
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 2);
|
tmp = impd_read_bits_buf(it_bit_buff, 2);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
drc_parameter_interface->change_compress = (tmp>>1)&1;
|
drc_parameter_interface->change_compress = (tmp >> 1) & 1;
|
||||||
drc_parameter_interface->change_boost = tmp&1;
|
drc_parameter_interface->change_boost = tmp & 1;
|
||||||
|
|
||||||
if (drc_parameter_interface->change_compress == 1) {
|
if (drc_parameter_interface->change_compress == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
if (tmp < 255) {
|
||||||
if (tmp<255) {
|
|
||||||
drc_parameter_interface->compress = 1 - tmp * 0.00390625f;
|
drc_parameter_interface->compress = 1 - tmp * 0.00390625f;
|
||||||
} else {
|
} else {
|
||||||
drc_parameter_interface->compress = 0.f;
|
drc_parameter_interface->compress = 0.f;
|
||||||
|
|
@ -330,186 +325,190 @@ WORD32 impd_drc_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
|
|
||||||
if (drc_parameter_interface->change_boost == 1) {
|
if (drc_parameter_interface->change_boost == 1) {
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
tmp = impd_read_bits_buf(it_bit_buff, 8);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
if (tmp < 255) {
|
||||||
if (tmp<255) {
|
|
||||||
drc_parameter_interface->boost = 1 - tmp * 0.00390625f;
|
drc_parameter_interface->boost = 1 - tmp * 0.00390625f;
|
||||||
} else {
|
} else {
|
||||||
drc_parameter_interface->boost = 0.f;
|
drc_parameter_interface->boost = 0.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drc_parameter_interface->change_drc_characteristic_target = impd_read_bits_buf(it_bit_buff, 1);
|
drc_parameter_interface->change_drc_characteristic_target =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
if (drc_parameter_interface->change_drc_characteristic_target == 1) {
|
if (drc_parameter_interface->change_drc_characteristic_target == 1) {
|
||||||
drc_parameter_interface->drc_characteristic_target = impd_read_bits_buf(it_bit_buff, 8);
|
drc_parameter_interface->drc_characteristic_target =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 8);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD32 impd_parse_loud_eq_param_interface(ia_bit_buf_struct* it_bit_buff,
|
static WORD32 impd_parse_loud_eq_param_interface(
|
||||||
ia_loudness_eq_parameter_interface_struct* loudness_eq_parameter_interface)
|
ia_bit_buf_struct* it_bit_buff, ia_loudness_eq_parameter_interface_struct*
|
||||||
{
|
loudness_eq_parameter_interface) {
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
WORD32 bsSensitivity, bsPlaybackGain;
|
WORD32 bsSensitivity, bsPlaybackGain;
|
||||||
|
|
||||||
loudness_eq_parameter_interface->loudness_eq_request_flag = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_eq_parameter_interface->loudness_eq_request_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_eq_parameter_interface->loudness_eq_request_flag) {
|
if (loudness_eq_parameter_interface->loudness_eq_request_flag) {
|
||||||
loudness_eq_parameter_interface->loudness_eq_request = impd_read_bits_buf(it_bit_buff, 2);
|
loudness_eq_parameter_interface->loudness_eq_request =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 2);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
loudness_eq_parameter_interface->sensitivity_flag = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_eq_parameter_interface->sensitivity_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_eq_parameter_interface->sensitivity_flag) {
|
if (loudness_eq_parameter_interface->sensitivity_flag) {
|
||||||
bsSensitivity = impd_read_bits_buf(it_bit_buff, 7);
|
bsSensitivity = impd_read_bits_buf(it_bit_buff, 7);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
loudness_eq_parameter_interface->sensitivity = bsSensitivity + 23.0f;
|
loudness_eq_parameter_interface->sensitivity = bsSensitivity + 23.0f;
|
||||||
}
|
}
|
||||||
loudness_eq_parameter_interface->playback_gain_flag = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_eq_parameter_interface->playback_gain_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (loudness_eq_parameter_interface->playback_gain_flag) {
|
if (loudness_eq_parameter_interface->playback_gain_flag) {
|
||||||
bsPlaybackGain = impd_read_bits_buf(it_bit_buff, 7);
|
bsPlaybackGain = impd_read_bits_buf(it_bit_buff, 7);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
loudness_eq_parameter_interface->playback_gain = (FLOAT32)-bsPlaybackGain;
|
||||||
loudness_eq_parameter_interface->playback_gain = (FLOAT32) - bsPlaybackGain;
|
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_unidrc_interface_extension_read(ia_bit_buf_struct* it_bit_buff,
|
impd_unidrc_interface_extension_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_interface_struct* impd_drc_uni_interface,
|
ia_drc_interface_struct* impd_drc_uni_interface,
|
||||||
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext)
|
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext) {
|
||||||
{
|
|
||||||
WORD32 err = 0, i = 0, tmp = 0, dummy;
|
WORD32 err = 0, i = 0, tmp = 0, dummy;
|
||||||
WORD32 uni_drc_interface_ext_type;
|
WORD32 uni_drc_interface_ext_type;
|
||||||
ia_specific_interface_extension_struct* specific_interface_ext;
|
ia_specific_interface_extension_struct* specific_interface_ext;
|
||||||
|
|
||||||
uni_drc_interface_ext_type = impd_read_bits_buf(it_bit_buff, 4);
|
uni_drc_interface_ext_type = impd_read_bits_buf(it_bit_buff, 4);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
|
|
||||||
while (uni_drc_interface_ext_type != UNIDRCINTERFACEEXT_TERM) {
|
while (uni_drc_interface_ext_type != UNIDRCINTERFACEEXT_TERM) {
|
||||||
specific_interface_ext = &(drc_uni_interface_ext->specific_interface_ext[i]);
|
specific_interface_ext =
|
||||||
specific_interface_ext->uni_drc_interface_ext_type = uni_drc_interface_ext_type;
|
&(drc_uni_interface_ext->specific_interface_ext[i]);
|
||||||
|
specific_interface_ext->uni_drc_interface_ext_type =
|
||||||
|
uni_drc_interface_ext_type;
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, 4);
|
tmp = impd_read_bits_buf(it_bit_buff, 4);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
specific_interface_ext->ext_size_bits = tmp + 4;
|
||||||
specific_interface_ext->ext_size_bits = tmp+4;
|
|
||||||
|
|
||||||
tmp = impd_read_bits_buf(it_bit_buff, specific_interface_ext->ext_size_bits);
|
tmp =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, specific_interface_ext->ext_size_bits);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
|
|
||||||
specific_interface_ext->ext_bit_size = tmp+1;
|
specific_interface_ext->ext_bit_size = tmp + 1;
|
||||||
|
|
||||||
switch (uni_drc_interface_ext_type) {
|
switch (uni_drc_interface_ext_type) {
|
||||||
case UNIDRCINTERFACEEXT_EQ:
|
case UNIDRCINTERFACEEXT_EQ:
|
||||||
impd_drc_uni_interface->drc_uni_interface_ext.loudness_eq_parameter_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
impd_drc_uni_interface->drc_uni_interface_ext
|
||||||
if(it_bit_buff->error)
|
.loudness_eq_parameter_interface_flag =
|
||||||
return it_bit_buff->error;
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if (impd_drc_uni_interface->drc_uni_interface_ext.loudness_eq_parameter_interface_flag) {
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
err = impd_parse_loud_eq_param_interface(it_bit_buff, &(impd_drc_uni_interface->drc_uni_interface_ext.loudness_eq_parameter_interface));
|
if (impd_drc_uni_interface->drc_uni_interface_ext
|
||||||
if (err) return(err);
|
.loudness_eq_parameter_interface_flag) {
|
||||||
|
err = impd_parse_loud_eq_param_interface(
|
||||||
|
it_bit_buff, &(impd_drc_uni_interface->drc_uni_interface_ext
|
||||||
|
.loudness_eq_parameter_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface_flag) {
|
if (impd_drc_uni_interface->drc_uni_interface_ext
|
||||||
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface.eq_set_purpose_request = impd_read_bits_buf(it_bit_buff, 16);
|
.eq_ctrl_interface_flag) {
|
||||||
if(it_bit_buff->error)
|
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface
|
||||||
return it_bit_buff->error;
|
.eq_set_purpose_request = impd_read_bits_buf(it_bit_buff, 16);
|
||||||
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dummy = impd_read_bits_buf(it_bit_buff, specific_interface_ext->ext_bit_size);
|
dummy = impd_read_bits_buf(it_bit_buff,
|
||||||
if(it_bit_buff->error)
|
specific_interface_ext->ext_bit_size);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
if (i==EXT_COUNT_MAX)
|
if (i == EXT_COUNT_MAX) {
|
||||||
{
|
return (1);
|
||||||
return(1);
|
|
||||||
}
|
}
|
||||||
uni_drc_interface_ext_type = impd_read_bits_buf(it_bit_buff, 4);
|
uni_drc_interface_ext_type = impd_read_bits_buf(it_bit_buff, 4);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
}
|
}
|
||||||
drc_uni_interface_ext->interface_ext_count = i;
|
drc_uni_interface_ext->interface_ext_count = i;
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
WORD32 impd_unidrc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
WORD32 impd_unidrc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_interface_struct* uniDrcInterface)
|
ia_drc_interface_struct* uniDrcInterface) {
|
||||||
{
|
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
|
|
||||||
uniDrcInterface->interface_signat_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->interface_signat_flag = impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (uniDrcInterface->interface_signat_flag == 1) {
|
if (uniDrcInterface->interface_signat_flag == 1) {
|
||||||
err = impd_unidrc_interface_signature_read(it_bit_buff, &(uniDrcInterface->drc_uni_interface_signature));
|
err = impd_unidrc_interface_signature_read(
|
||||||
if (err) return(err);
|
it_bit_buff, &(uniDrcInterface->drc_uni_interface_signature));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->system_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->system_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (uniDrcInterface->system_interface_flag == 1) {
|
if (uniDrcInterface->system_interface_flag == 1) {
|
||||||
err = impd_sys_interface_read(it_bit_buff, &(uniDrcInterface->system_interface));
|
err = impd_sys_interface_read(it_bit_buff,
|
||||||
if (err) return(err);
|
&(uniDrcInterface->system_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->loudness_norm_ctrl_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->loudness_norm_ctrl_interface_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (uniDrcInterface->loudness_norm_ctrl_interface_flag == 1) {
|
if (uniDrcInterface->loudness_norm_ctrl_interface_flag == 1) {
|
||||||
err = impd_loudness_norm_control_interface_read(it_bit_buff, &(uniDrcInterface->loudness_norm_ctrl_interface));
|
err = impd_loudness_norm_control_interface_read(
|
||||||
if (err) return(err);
|
it_bit_buff, &(uniDrcInterface->loudness_norm_ctrl_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->loudness_norm_parameter_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->loudness_norm_parameter_interface_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (uniDrcInterface->loudness_norm_parameter_interface_flag == 1) {
|
if (uniDrcInterface->loudness_norm_parameter_interface_flag == 1) {
|
||||||
err = impd_loudness_norm_param_interface_read(it_bit_buff, &(uniDrcInterface->loudness_norm_param_interface));
|
err = impd_loudness_norm_param_interface_read(
|
||||||
if (err) return(err);
|
it_bit_buff, &(uniDrcInterface->loudness_norm_param_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->drc_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->drc_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
||||||
if(it_bit_buff->error)
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
return it_bit_buff->error;
|
|
||||||
if (uniDrcInterface->drc_interface_flag == 1) {
|
if (uniDrcInterface->drc_interface_flag == 1) {
|
||||||
err = impd_drc_interface_read(it_bit_buff, &(uniDrcInterface->drc_ctrl_interface));
|
err = impd_drc_interface_read(it_bit_buff,
|
||||||
if (err) return(err);
|
&(uniDrcInterface->drc_ctrl_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->drc_parameter_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->drc_parameter_interface_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (uniDrcInterface->drc_parameter_interface_flag == 1) {
|
if (uniDrcInterface->drc_parameter_interface_flag == 1) {
|
||||||
err = impd_drc_param_interface_read(it_bit_buff, &(uniDrcInterface->drc_parameter_interface));
|
err = impd_drc_param_interface_read(
|
||||||
if (err) return(err);
|
it_bit_buff, &(uniDrcInterface->drc_parameter_interface));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->drc_uni_interface_ext_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->drc_uni_interface_ext_flag =
|
||||||
if(it_bit_buff->error)
|
impd_read_bits_buf(it_bit_buff, 1);
|
||||||
return it_bit_buff->error;
|
if (it_bit_buff->error) return it_bit_buff->error;
|
||||||
if (uniDrcInterface->drc_uni_interface_ext_flag == 1) {
|
if (uniDrcInterface->drc_uni_interface_ext_flag == 1) {
|
||||||
err = impd_unidrc_interface_extension_read(it_bit_buff, uniDrcInterface, &(uniDrcInterface->drc_uni_interface_ext));
|
err = impd_unidrc_interface_extension_read(
|
||||||
if (err) return(err);
|
it_bit_buff, uniDrcInterface,
|
||||||
|
&(uniDrcInterface->drc_uni_interface_ext));
|
||||||
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
@ -34,36 +34,33 @@
|
||||||
#include "impd_drc_uni_process_audio.h"
|
#include "impd_drc_uni_process_audio.h"
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
|
WORD32 impd_parametric_drc_instance_reset(
|
||||||
WORD32 impd_parametric_drc_instance_reset(WORD32 instance_idx,
|
WORD32 instance_idx, ia_parametric_drc_instance_params_struct*
|
||||||
ia_parametric_drc_instance_params_struct* pstr_parametric_drc_instance_params)
|
pstr_parametric_drc_instance_params) {
|
||||||
{
|
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
|
|
||||||
if (pstr_parametric_drc_instance_params->parametric_drc_type == PARAM_DRC_TYPE_FF)
|
if (pstr_parametric_drc_instance_params->parametric_drc_type ==
|
||||||
{
|
PARAM_DRC_TYPE_FF) {
|
||||||
|
ia_parametric_drc_type_ff_params_struct*
|
||||||
|
pstr_parametric_ffwd_type_drc_params =
|
||||||
|
&(pstr_parametric_drc_instance_params
|
||||||
|
->str_parametric_drc_type_ff_params);
|
||||||
|
err = impd_parametric_ffwd_type_drc_reset(
|
||||||
|
pstr_parametric_ffwd_type_drc_params);
|
||||||
|
if (err) return (err);
|
||||||
|
|
||||||
ia_parametric_drc_type_ff_params_struct* pstr_parametric_ffwd_type_drc_params = &(pstr_parametric_drc_instance_params->str_parametric_drc_type_ff_params);
|
} else {
|
||||||
err = impd_parametric_ffwd_type_drc_reset(pstr_parametric_ffwd_type_drc_params);
|
|
||||||
if (err)
|
|
||||||
return (err);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_add_drc_band_audio(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
WORD32 impd_add_drc_band_audio(
|
||||||
|
ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_audio_band_buffer_struct* audio_band_buffer,
|
ia_audio_band_buffer_struct* audio_band_buffer, FLOAT32* audio_io_buf[]) {
|
||||||
FLOAT32* audio_io_buf[])
|
|
||||||
{
|
|
||||||
WORD32 g, b, i, c;
|
WORD32 g, b, i, c;
|
||||||
FLOAT32 sum;
|
FLOAT32 sum;
|
||||||
WORD32 signalIndex = 0;
|
WORD32 signalIndex = 0;
|
||||||
|
|
@ -75,46 +72,37 @@ WORD32 impd_add_drc_band_audio(ia_drc_instructions_struct* pstr_drc_instruction_
|
||||||
channel_audio = audio_io_buf;
|
channel_audio = audio_io_buf;
|
||||||
|
|
||||||
if (drc_instructions_index >= 0) {
|
if (drc_instructions_index >= 0) {
|
||||||
str_drc_instruction_str = &(pstr_drc_instruction_arr[drc_instructions_index]);
|
str_drc_instruction_str =
|
||||||
|
&(pstr_drc_instruction_arr[drc_instructions_index]);
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str_drc_instruction_str->drc_set_id > 0)
|
if (str_drc_instruction_str->drc_set_id > 0) {
|
||||||
{
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
g = str_drc_instruction_str->channel_group_of_ch[c];
|
g = str_drc_instruction_str->channel_group_of_ch[c];
|
||||||
if (g>=0)
|
if (g >= 0) {
|
||||||
{
|
for (i = 0; i < ia_drc_params_struct->drc_frame_size; i++) {
|
||||||
for (i=0; i<ia_drc_params_struct->drc_frame_size; i++)
|
|
||||||
{
|
|
||||||
sum = 0.0f;
|
sum = 0.0f;
|
||||||
for (b=0; b<str_drc_instruction_str->band_count_of_ch_group[g]; b++)
|
for (b = 0; b < str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
{
|
b++) {
|
||||||
sum += drcBandAudio[signalIndex+b][i];
|
sum += drcBandAudio[signalIndex + b][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_audio[c][i] = sum;
|
channel_audio[c][i] = sum;
|
||||||
|
|
||||||
}
|
}
|
||||||
signalIndex += str_drc_instruction_str->band_count_of_ch_group[g];
|
signalIndex += str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
signalIndex++;
|
signalIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
{
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
for (i=0; i<ia_drc_params_struct->drc_frame_size; i++)
|
for (i = 0; i < ia_drc_params_struct->drc_frame_size; i++) {
|
||||||
{
|
|
||||||
channel_audio[c][i] = drcBandAudio[c][i];
|
channel_audio[c][i] = drcBandAudio[c][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -122,64 +110,56 @@ WORD32 impd_add_drc_band_audio(ia_drc_instructions_struct* pstr_drc_instruction_
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 removeTables(void)
|
WORD32 removeTables(void) { return (0); }
|
||||||
{
|
|
||||||
|
|
||||||
return(0);
|
const ia_slope_code_table_struct* impd_get_slope_code_tbl_by_value(void) {
|
||||||
|
return (&(slopeCodeTableEntryByValue[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
const ia_slope_code_table_struct*
|
FLOAT32 impd_decode_slope_idx(const WORD32 slopeCodeIndex) {
|
||||||
impd_get_slope_code_tbl_by_value(void)
|
const ia_slope_code_table_struct* slopeCodeTable =
|
||||||
{
|
impd_get_slope_code_tbl_by_value();
|
||||||
return(&(slopeCodeTableEntryByValue[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
FLOAT32 impd_decode_slope_idx(const WORD32 slopeCodeIndex)
|
|
||||||
{
|
|
||||||
const ia_slope_code_table_struct* slopeCodeTable = impd_get_slope_code_tbl_by_value();
|
|
||||||
return slopeCodeTable[slopeCodeIndex].value;
|
return slopeCodeTable[slopeCodeIndex].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOAT32 impd_decode_slope_idx_magnitude(const WORD32 slopeCodeIndex)
|
FLOAT32 impd_decode_slope_idx_magnitude(const WORD32 slopeCodeIndex) {
|
||||||
{
|
const ia_slope_code_table_struct* slopeCodeTable =
|
||||||
const ia_slope_code_table_struct* slopeCodeTable = impd_get_slope_code_tbl_by_value();
|
impd_get_slope_code_tbl_by_value();
|
||||||
return (FLOAT32)fabs((FLOAT64)slopeCodeTable[slopeCodeIndex].value);
|
return (FLOAT32)fabs((FLOAT64)slopeCodeTable[slopeCodeIndex].value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_get_multi_band_drc_present(ia_drc_config* pstr_drc_config,
|
WORD32 impd_get_multi_band_drc_present(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 numSets[3],
|
WORD32 numSets[3],
|
||||||
WORD32 multiBandDrcPresent[3])
|
WORD32 multiBandDrcPresent[3]) {
|
||||||
{
|
WORD32 err = 0, k, m;
|
||||||
WORD32 err=0, k, m;
|
for (k = 0; k < pstr_drc_config->drc_instructions_uni_drc_count; k++) {
|
||||||
for(k=0; k<pstr_drc_config->drc_instructions_uni_drc_count; k++)
|
if ((pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] ==
|
||||||
{
|
ID_FOR_BASE_LAYOUT) ||
|
||||||
if ((pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] == ID_FOR_BASE_LAYOUT) || (pstr_drc_config->str_drc_instruction_str[k].drc_apply_to_dwnmix == 0))
|
(pstr_drc_config->str_drc_instruction_str[k].drc_apply_to_dwnmix ==
|
||||||
{
|
0)) {
|
||||||
numSets[0]++;
|
numSets[0]++;
|
||||||
}
|
} else if (pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] ==
|
||||||
else if (pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] == ID_FOR_ANY_DOWNMIX)
|
ID_FOR_ANY_DOWNMIX) {
|
||||||
{
|
|
||||||
numSets[1]++;
|
numSets[1]++;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
numSets[2]++;
|
numSets[2]++;
|
||||||
}
|
}
|
||||||
for (m=0; m<pstr_drc_config->str_drc_instruction_str[k].num_drc_ch_groups; m++)
|
for (m = 0;
|
||||||
{
|
m < pstr_drc_config->str_drc_instruction_str[k].num_drc_ch_groups;
|
||||||
if (pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params[pstr_drc_config->str_drc_instruction_str->gain_set_index_for_channel_group[m]].band_count > 1)
|
m++) {
|
||||||
{
|
if (pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0]
|
||||||
if ((pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] == ID_FOR_BASE_LAYOUT) || (pstr_drc_config->str_drc_instruction_str[k].drc_apply_to_dwnmix == 0))
|
.gain_set_params[pstr_drc_config->str_drc_instruction_str
|
||||||
{
|
->gain_set_index_for_channel_group[m]]
|
||||||
|
.band_count > 1) {
|
||||||
|
if ((pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] ==
|
||||||
|
ID_FOR_BASE_LAYOUT) ||
|
||||||
|
(pstr_drc_config->str_drc_instruction_str[k].drc_apply_to_dwnmix ==
|
||||||
|
0)) {
|
||||||
multiBandDrcPresent[0] = 1;
|
multiBandDrcPresent[0] = 1;
|
||||||
}
|
} else if (pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] ==
|
||||||
else if (pstr_drc_config->str_drc_instruction_str[k].downmix_id[0] == ID_FOR_ANY_DOWNMIX)
|
ID_FOR_ANY_DOWNMIX) {
|
||||||
{
|
|
||||||
multiBandDrcPresent[1] = 1;
|
multiBandDrcPresent[1] = 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
multiBandDrcPresent[2] = 1;
|
multiBandDrcPresent[2] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -187,5 +167,3 @@ WORD32 impd_get_multi_band_drc_present(ia_drc_config* pstr_drc_config,
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -25,80 +25,68 @@ extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_mixing_level_info(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_mixing_level_info(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 drc_set_id_requested,
|
||||||
WORD32 drc_set_id_requested,
|
WORD32 eq_set_id_requested, FLOAT32* mixing_level);
|
||||||
WORD32 eq_set_id_requested,
|
|
||||||
FLOAT32* mixing_level);
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_signal_peak_level_info(ia_drc_config* pstr_drc_config,
|
impd_signal_peak_level_info(ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 album_mode,
|
||||||
WORD32 album_mode,
|
|
||||||
WORD32 num_compression_eq_count,
|
WORD32 num_compression_eq_count,
|
||||||
WORD32* num_compression_eq_id,
|
WORD32* num_compression_eq_id,
|
||||||
WORD32* peak_info_count,
|
WORD32* peak_info_count, WORD32 eq_set_id[],
|
||||||
WORD32 eq_set_id[],
|
|
||||||
FLOAT32 signal_peak_level[],
|
FLOAT32 signal_peak_level[],
|
||||||
WORD32 explicit_peak_information_present[]);
|
WORD32 explicit_peak_information_present[]);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_extract_loudness_peak_to_average_info(ia_loudness_info_struct* loudness_info,
|
impd_extract_loudness_peak_to_average_info(
|
||||||
WORD32 dyn_range_measurement_type,
|
ia_loudness_info_struct* loudness_info, WORD32 dyn_range_measurement_type,
|
||||||
WORD32 * loudness_peak_2_avg_value_present,
|
WORD32* loudness_peak_2_avg_value_present,
|
||||||
FLOAT32* loudness_peak_2_avg_value);
|
FLOAT32* loudness_peak_2_avg_value);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_loudness_peak_to_average_info(
|
impd_loudness_peak_to_average_info(
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 dyn_range_measurement_type,
|
||||||
WORD32 dyn_range_measurement_type,
|
WORD32 album_mode, WORD32* loudness_peak_2_avg_value_present,
|
||||||
WORD32 album_mode,
|
|
||||||
WORD32* loudness_peak_2_avg_value_present,
|
|
||||||
FLOAT32* loudness_peak_2_avg_value);
|
FLOAT32* loudness_peak_2_avg_value);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_overall_loudness_present( ia_loudness_info_struct* loudness_info,
|
impd_overall_loudness_present(ia_loudness_info_struct* loudness_info,
|
||||||
WORD32* loudness_info_present);
|
WORD32* loudness_info_present);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_overall_loudness_info(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_find_overall_loudness_info(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 drc_set_id_requested,
|
||||||
WORD32 drc_set_id_requested,
|
WORD32* overall_loudness_info_present, WORD32* loudness_info_count,
|
||||||
WORD32* overall_loudness_info_present,
|
|
||||||
WORD32* loudness_info_count,
|
|
||||||
ia_loudness_info_struct* loudness_info[]);
|
ia_loudness_info_struct* loudness_info[]);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_high_pass_loudness_adjust_info( ia_loudness_info_struct* loudness_info,
|
impd_high_pass_loudness_adjust_info(ia_loudness_info_struct* loudness_info,
|
||||||
WORD32* loudness_hp_adjust_present,
|
WORD32* loudness_hp_adjust_present,
|
||||||
FLOAT32* loudness_hp_adjust);
|
FLOAT32* loudness_hp_adjust);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_high_pass_loudness_adjust(
|
impd_find_high_pass_loudness_adjust(
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 drc_set_id_requested, WORD32 album_mode,
|
||||||
WORD32 drc_set_id_requested,
|
FLOAT32 device_cutoff_freq, WORD32* loudness_hp_adjust_present,
|
||||||
WORD32 album_mode,
|
|
||||||
FLOAT32 device_cutoff_freq,
|
|
||||||
WORD32* loudness_hp_adjust_present,
|
|
||||||
FLOAT32* loudness_hp_adjust);
|
FLOAT32* loudness_hp_adjust);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_loudness_control (ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_init_loudness_control(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id, WORD32 drc_set_id_requested,
|
||||||
WORD32 drc_set_id_requested,
|
WORD32 num_compression_eq_count, WORD32* num_compression_eq_id,
|
||||||
WORD32 num_compression_eq_count,
|
WORD32* loudness_info_count, WORD32 eq_set_id[],
|
||||||
WORD32* num_compression_eq_id,
|
FLOAT32 loudness_normalization_gain_db[], FLOAT32 loudness[]);
|
||||||
WORD32* loudness_info_count,
|
|
||||||
WORD32 eq_set_id[],
|
|
||||||
FLOAT32 loudness_normalization_gain_db[],
|
|
||||||
FLOAT32 loudness[]);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,197 +41,214 @@
|
||||||
|
|
||||||
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
||||||
|
|
||||||
static WORD32 impd_down_mix ( ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output, FLOAT32** input_audio, WORD32 frame_len)
|
static WORD32 impd_down_mix(
|
||||||
{
|
ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output,
|
||||||
|
FLOAT32 **input_audio, WORD32 frame_len) {
|
||||||
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
||||||
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
||||||
WORD32 i, i_ch, o_ch;
|
WORD32 i, i_ch, o_ch;
|
||||||
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
||||||
|
|
||||||
if (uni_drc_sel_proc_output->downmix_matrix_present == 0)
|
if (uni_drc_sel_proc_output->downmix_matrix_present == 0) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (input_audio == 0)
|
if (input_audio == 0) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (num_target_ch > MAX_CHANNEL_COUNT)
|
if (num_target_ch > MAX_CHANNEL_COUNT) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (num_target_ch > num_base_ch)
|
if (num_target_ch > num_base_ch) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++) {
|
for (i = 0; i < frame_len; i++) {
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++)
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
{
|
|
||||||
tmp_out[o_ch] = 0.0f;
|
tmp_out[o_ch] = 0.0f;
|
||||||
for (i_ch=0; i_ch<num_base_ch; i_ch++)
|
for (i_ch = 0; i_ch < num_base_ch; i_ch++) {
|
||||||
{
|
tmp_out[o_ch] += input_audio[i_ch][i] *
|
||||||
tmp_out[o_ch] += input_audio[i_ch][i] * uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++) {
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = tmp_out[o_ch];
|
input_audio[o_ch][i] = tmp_out[o_ch];
|
||||||
}
|
}
|
||||||
for ( ; o_ch<num_base_ch; o_ch++) {
|
for (; o_ch < num_base_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = 0.0f;
|
input_audio[o_ch][i] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
WORD32 impd_init_process_audio_main_qmf(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
{
|
{
|
||||||
WORD32 error=0, i, j, num_samples_per_channel;
|
WORD32 error = 0, i, j, num_samples_per_channel;
|
||||||
FLOAT32 *input_buffer;
|
FLOAT32 *input_buffer;
|
||||||
FLOAT32 *output_buffer;
|
FLOAT32 *output_buffer;
|
||||||
FLOAT32 *audio_io_buf_real[10];
|
FLOAT32 *audio_io_buf_real[10];
|
||||||
FLOAT32 *audio_io_buf_imag[10];
|
FLOAT32 *audio_io_buf_imag[10];
|
||||||
FLOAT32 *scratch_buffer;
|
FLOAT32 *scratch_buffer;
|
||||||
WORD32 last_frame=0;
|
WORD32 last_frame = 0;
|
||||||
scratch_buffer= (FLOAT32*)p_obj_drc->pp_mem[1];
|
scratch_buffer = (FLOAT32 *)p_obj_drc->pp_mem[1];
|
||||||
input_buffer = (FLOAT32*)p_obj_drc->pp_mem[2];
|
input_buffer = (FLOAT32 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer = (FLOAT32*)p_obj_drc->pp_mem[3];
|
output_buffer = (FLOAT32 *)p_obj_drc->pp_mem[3];
|
||||||
|
|
||||||
if(p_obj_drc->p_state->ui_in_bytes<=0)
|
if (p_obj_drc->p_state->ui_in_bytes <= 0) {
|
||||||
{
|
p_obj_drc->p_state->ui_out_bytes = 0;
|
||||||
p_obj_drc->p_state->ui_out_bytes=0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
if ((p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in /
|
||||||
last_frame=1;
|
(p_obj_drc->str_config.pcm_size >> 3)) <
|
||||||
for(i=0;i<p_obj_drc->str_config.num_ch_in;i++){
|
(UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
audio_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
last_frame = 1;
|
||||||
audio_io_buf_imag[i]=scratch_buffer+p_obj_drc->str_config.num_ch_in*p_obj_drc->str_config.frame_size+p_obj_drc->str_config.num_ch_in*64+i*(p_obj_drc->str_config.frame_size+64);
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
for(j=0;j<p_obj_drc->str_config.frame_size;j++){
|
audio_io_buf_real[i] =
|
||||||
audio_io_buf_real[i][j]=input_buffer[j*p_obj_drc->str_config.num_ch_in + i];
|
scratch_buffer + i * (p_obj_drc->str_config.frame_size + 32);
|
||||||
audio_io_buf_imag[i][j]=input_buffer[p_obj_drc->str_config.num_ch_in*p_obj_drc->str_config.frame_size+j*p_obj_drc->str_config.num_ch_in + i];
|
audio_io_buf_imag[i] =
|
||||||
|
scratch_buffer +
|
||||||
|
p_obj_drc->str_config.num_ch_in * p_obj_drc->str_config.frame_size +
|
||||||
|
p_obj_drc->str_config.num_ch_in * 64 +
|
||||||
|
i * (p_obj_drc->str_config.frame_size + 64);
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
|
audio_io_buf_real[i][j] =
|
||||||
|
input_buffer[j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
|
audio_io_buf_imag[i][j] =
|
||||||
|
input_buffer[p_obj_drc->str_config.num_ch_in *
|
||||||
|
p_obj_drc->str_config.frame_size +
|
||||||
|
j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = impd_process_drc_bitstream_dec_gain(p_obj_drc->str_payload.pstr_bitstream_dec,
|
error = impd_process_drc_bitstream_dec_gain(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (error > PROC_COMPLETE) return -1;
|
if (error > PROC_COMPLETE) return -1;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_obj_drc->str_config.bitstream_file_format ==
|
||||||
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
|
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0) {
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_read_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_read_bs + 8 -
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
||||||
if (p_obj_drc->str_config.bitstream_file_format == BITSTREAM_FILE_FORMAT_SPLIT) {
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0)
|
p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
||||||
{
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_read_bs = p_obj_drc->str_bit_handler.num_bits_read_bs + 8 - p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs = p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
p_obj_drc->str_bit_handler.byte_index_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs = p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
p_obj_drc->str_bit_handler.num_bytes_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[0],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[0],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_real,
|
audio_io_buf_real, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_imag,
|
audio_io_buf_imag, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[1],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[1],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db != 0.0f)
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
{
|
->loudness_normalization_gain_db != 0.0f) {
|
||||||
FLOAT32 loudness_normalization_gain = (FLOAT32)pow(10.0,p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db/20.0);
|
FLOAT32 loudness_normalization_gain =
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
(FLOAT32)pow(10.0, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
for (j=0; j <p_obj_drc->str_config. frame_size; j++) {
|
->loudness_normalization_gain_db /
|
||||||
|
20.0);
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
||||||
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
||||||
|
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_io_buf_real[i][j];
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
output_buffer[p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+j*p_obj_drc->str_config.num_ch_out + i] = audio_io_buf_imag[i][j];
|
audio_io_buf_real[i][j];
|
||||||
|
output_buffer[p_obj_drc->str_config.frame_size *
|
||||||
|
p_obj_drc->str_config.num_ch_in +
|
||||||
|
j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
audio_io_buf_imag[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->str_config.frame_size)*4;
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in);
|
p_obj_drc->str_config.num_ch_out * (p_obj_drc->str_config.frame_size) * 4;
|
||||||
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in);
|
||||||
|
|
||||||
if(last_frame==0){
|
if (last_frame == 0) {
|
||||||
|
if (p_obj_drc->str_config.bitstream_file_format !=
|
||||||
if (p_obj_drc->str_config.bitstream_file_format != BITSTREAM_FILE_FORMAT_SPLIT) {
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
error = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
error = impd_process_drc_bitstream_dec(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (error > PROC_COMPLETE)
|
if (error > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
|
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,194 +39,216 @@
|
||||||
|
|
||||||
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
#define BITSTREAM_FILE_FORMAT_SPLIT 1
|
||||||
|
|
||||||
static WORD32 impd_down_mix(ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output, FLOAT32** input_audio, WORD32 frame_len)
|
static WORD32 impd_down_mix(
|
||||||
{
|
ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output,
|
||||||
|
FLOAT32 **input_audio, WORD32 frame_len) {
|
||||||
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
||||||
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
||||||
WORD32 i, i_ch, o_ch;
|
WORD32 i, i_ch, o_ch;
|
||||||
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
||||||
|
|
||||||
if (uni_drc_sel_proc_output->downmix_matrix_present == 0)
|
if (uni_drc_sel_proc_output->downmix_matrix_present == 0) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (input_audio == 0)
|
if (input_audio == 0) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (num_target_ch > MAX_CHANNEL_COUNT)
|
if (num_target_ch > MAX_CHANNEL_COUNT) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (num_target_ch > num_base_ch)
|
if (num_target_ch > num_base_ch) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++) {
|
for (i = 0; i < frame_len; i++) {
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++) {
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
tmp_out[o_ch] = 0.0f;
|
tmp_out[o_ch] = 0.0f;
|
||||||
for (i_ch=0; i_ch<num_base_ch; i_ch++) {
|
for (i_ch = 0; i_ch < num_base_ch; i_ch++) {
|
||||||
tmp_out[o_ch] += input_audio[i_ch][i] * uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
tmp_out[o_ch] += input_audio[i_ch][i] *
|
||||||
|
uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++) {
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = tmp_out[o_ch];
|
input_audio[o_ch][i] = tmp_out[o_ch];
|
||||||
}
|
}
|
||||||
for ( ; o_ch<num_base_ch; o_ch++) {
|
for (; o_ch < num_base_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = 0.0f;
|
input_audio[o_ch][i] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_init_process_audio_main_stft(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
WORD32 error=0, i, j, num_samples_per_channel;
|
WORD32 error = 0, i, j, num_samples_per_channel;
|
||||||
FLOAT32 *input_buffer;
|
FLOAT32 *input_buffer;
|
||||||
FLOAT32 *output_buffer;
|
FLOAT32 *output_buffer;
|
||||||
FLOAT32 *audio_io_buf_real[10];
|
FLOAT32 *audio_io_buf_real[10];
|
||||||
FLOAT32 *audio_io_buf_imag[10];
|
FLOAT32 *audio_io_buf_imag[10];
|
||||||
FLOAT32 *scratch_buffer;
|
FLOAT32 *scratch_buffer;
|
||||||
WORD32 last_frame=0;
|
WORD32 last_frame = 0;
|
||||||
scratch_buffer= (FLOAT32*)p_obj_drc->pp_mem[1];
|
scratch_buffer = (FLOAT32 *)p_obj_drc->pp_mem[1];
|
||||||
input_buffer = (FLOAT32*)p_obj_drc->pp_mem[2];
|
input_buffer = (FLOAT32 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer = (FLOAT32*)p_obj_drc->pp_mem[3];
|
output_buffer = (FLOAT32 *)p_obj_drc->pp_mem[3];
|
||||||
|
|
||||||
|
if (p_obj_drc->p_state->ui_in_bytes <= 0) {
|
||||||
if(p_obj_drc->p_state->ui_in_bytes<=0){
|
p_obj_drc->p_state->ui_out_bytes = 0;
|
||||||
p_obj_drc->p_state->ui_out_bytes=0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
if ((p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in /
|
||||||
last_frame=1;
|
(p_obj_drc->str_config.pcm_size >> 3)) <
|
||||||
for(i=0;i<p_obj_drc->str_config.num_ch_in;i++){
|
(UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
audio_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
last_frame = 1;
|
||||||
audio_io_buf_imag[i]=scratch_buffer+p_obj_drc->str_config.num_ch_in*p_obj_drc->str_config.frame_size+p_obj_drc->str_config.num_ch_in*64+i*(p_obj_drc->str_config.frame_size+64);
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
for(j=0;j<p_obj_drc->str_config.frame_size;j++){
|
audio_io_buf_real[i] =
|
||||||
audio_io_buf_real[i][j]=input_buffer[j*p_obj_drc->str_config.num_ch_in + i];
|
scratch_buffer + i * (p_obj_drc->str_config.frame_size + 32);
|
||||||
audio_io_buf_imag[i][j]=input_buffer[p_obj_drc->str_config.num_ch_in*p_obj_drc->str_config.frame_size+j*p_obj_drc->str_config.num_ch_in + i];
|
audio_io_buf_imag[i] =
|
||||||
|
scratch_buffer +
|
||||||
|
p_obj_drc->str_config.num_ch_in * p_obj_drc->str_config.frame_size +
|
||||||
|
p_obj_drc->str_config.num_ch_in * 64 +
|
||||||
|
i * (p_obj_drc->str_config.frame_size + 64);
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
|
audio_io_buf_real[i][j] =
|
||||||
|
input_buffer[j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
|
audio_io_buf_imag[i][j] =
|
||||||
|
input_buffer[p_obj_drc->str_config.num_ch_in *
|
||||||
|
p_obj_drc->str_config.frame_size +
|
||||||
|
j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = impd_process_drc_bitstream_dec_gain(p_obj_drc->str_payload.pstr_bitstream_dec,
|
error = impd_process_drc_bitstream_dec_gain(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (error > PROC_COMPLETE) return -1;
|
if (error > PROC_COMPLETE) return -1;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_obj_drc->str_config.bitstream_file_format ==
|
||||||
if (p_obj_drc->str_config.bitstream_file_format == BITSTREAM_FILE_FORMAT_SPLIT) {
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0)
|
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0) {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_bits_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_read_bs = p_obj_drc->str_bit_handler.num_bits_read_bs + 8 - p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
p_obj_drc->str_bit_handler.num_bits_read_bs + 8 -
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs = p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
p_obj_drc->str_bit_handler.byte_index_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs = p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
p_obj_drc->str_bit_handler.num_bytes_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[0],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[0],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_real,
|
audio_io_buf_real, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_imag,
|
audio_io_buf_imag, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[1],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[1],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db != 0.0f)
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
{
|
->loudness_normalization_gain_db != 0.0f) {
|
||||||
FLOAT32 loudness_normalization_gain = (FLOAT32)pow(10.0,p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db/20.0);
|
FLOAT32 loudness_normalization_gain =
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
(FLOAT32)pow(10.0, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
for (j=0; j <p_obj_drc->str_config. frame_size; j++) {
|
->loudness_normalization_gain_db /
|
||||||
|
20.0);
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
||||||
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
||||||
|
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_io_buf_real[i][j];
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
output_buffer[p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+j*p_obj_drc->str_config.num_ch_out + i] = audio_io_buf_imag[i][j];
|
audio_io_buf_real[i][j];
|
||||||
|
output_buffer[p_obj_drc->str_config.frame_size *
|
||||||
|
p_obj_drc->str_config.num_ch_in +
|
||||||
|
j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
audio_io_buf_imag[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->str_config.frame_size)*4;
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in);
|
p_obj_drc->str_config.num_ch_out * (p_obj_drc->str_config.frame_size) * 4;
|
||||||
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in);
|
||||||
|
|
||||||
if(last_frame==0){
|
if (last_frame == 0) {
|
||||||
|
if (p_obj_drc->str_config.bitstream_file_format !=
|
||||||
if (p_obj_drc->str_config.bitstream_file_format != BITSTREAM_FILE_FORMAT_SPLIT) {
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
error = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
error = impd_process_drc_bitstream_dec(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (error > PROC_COMPLETE)
|
if (error > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
|
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,274 +41,285 @@
|
||||||
#include "impd_drc_hashdefines.h"
|
#include "impd_drc_hashdefines.h"
|
||||||
#include "impd_drc_peak_limiter.h"
|
#include "impd_drc_peak_limiter.h"
|
||||||
|
|
||||||
static IA_ERRORCODE impd_down_mix ( ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output, FLOAT32** input_audio, WORD32 frame_len)
|
static IA_ERRORCODE impd_down_mix(
|
||||||
{
|
ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output,
|
||||||
|
FLOAT32 **input_audio, WORD32 frame_len) {
|
||||||
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
||||||
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
||||||
WORD32 i, i_ch, o_ch;
|
WORD32 i, i_ch, o_ch;
|
||||||
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
||||||
|
|
||||||
|
if (num_target_ch > MAX_CHANNEL_COUNT) return -1;
|
||||||
|
|
||||||
if (num_target_ch > MAX_CHANNEL_COUNT)
|
if (num_target_ch > num_base_ch) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (num_target_ch > num_base_ch)
|
for (i = 0; i < frame_len; i++) {
|
||||||
return -1;
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++)
|
|
||||||
{
|
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++)
|
|
||||||
{
|
|
||||||
tmp_out[o_ch] = 0.0f;
|
tmp_out[o_ch] = 0.0f;
|
||||||
for (i_ch=0; i_ch<num_base_ch; i_ch++)
|
for (i_ch = 0; i_ch < num_base_ch; i_ch++) {
|
||||||
{
|
tmp_out[o_ch] += input_audio[i_ch][i] *
|
||||||
tmp_out[o_ch] += input_audio[i_ch][i] * uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++)
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
{
|
|
||||||
input_audio[o_ch][i] = tmp_out[o_ch];
|
input_audio[o_ch][i] = tmp_out[o_ch];
|
||||||
}
|
}
|
||||||
for ( ; o_ch<num_base_ch; o_ch++)
|
for (; o_ch < num_base_ch; o_ch++) {
|
||||||
{
|
|
||||||
input_audio[o_ch][i] = 0.0f;
|
input_audio[o_ch][i] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc) {
|
||||||
{
|
IA_ERRORCODE err_code = IA_NO_ERROR;
|
||||||
IA_ERRORCODE err_code= IA_NO_ERROR;
|
|
||||||
WORD32 i, j;
|
WORD32 i, j;
|
||||||
FLOAT32 *input_buffer;
|
FLOAT32 *input_buffer;
|
||||||
WORD16 *input_buffer16, *output_buffer16;
|
WORD16 *input_buffer16, *output_buffer16;
|
||||||
FLOAT32 *output_buffer;
|
FLOAT32 *output_buffer;
|
||||||
FLOAT32 *audio_buff[10];
|
FLOAT32 *audio_buff[10];
|
||||||
FLOAT32 *scratch_buffer;
|
FLOAT32 *scratch_buffer;
|
||||||
WORD32 last_frame=0;
|
WORD32 last_frame = 0;
|
||||||
WORD32 num_sample_to_process;
|
WORD32 num_sample_to_process;
|
||||||
scratch_buffer = (FLOAT32*)p_obj_drc->pp_mem[1];
|
scratch_buffer = (FLOAT32 *)p_obj_drc->pp_mem[1];
|
||||||
input_buffer = (FLOAT32*)p_obj_drc->pp_mem[2];
|
input_buffer = (FLOAT32 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer = (FLOAT32*)p_obj_drc->pp_mem[3];
|
output_buffer = (FLOAT32 *)p_obj_drc->pp_mem[3];
|
||||||
input_buffer16 = (WORD16*)p_obj_drc->pp_mem[2];
|
input_buffer16 = (WORD16 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer16 = (WORD16*)p_obj_drc->pp_mem[3];
|
output_buffer16 = (WORD16 *)p_obj_drc->pp_mem[3];
|
||||||
|
|
||||||
if(p_obj_drc->p_state->ui_in_bytes<=0){
|
if (p_obj_drc->p_state->ui_in_bytes <= 0) {
|
||||||
p_obj_drc->p_state->ui_out_bytes=0;
|
p_obj_drc->p_state->ui_out_bytes = 0;
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_process_drc_bitstream_dec_gain(p_obj_drc->str_payload.pstr_bitstream_dec,
|
err_code = impd_process_drc_bitstream_dec_gain(
|
||||||
p_obj_drc->pstr_bit_buf,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (err_code > PROC_COMPLETE)
|
if (err_code > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_obj_drc->str_config.bitstream_file_format == BITSTREAM_FILE_FORMAT_SPLIT) {
|
if (p_obj_drc->str_config.bitstream_file_format ==
|
||||||
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0)
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
{
|
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0) {
|
||||||
p_obj_drc->str_bit_handler.num_bits_read_bs = p_obj_drc->str_bit_handler.num_bits_read_bs + 8
|
p_obj_drc->str_bit_handler.num_bits_read_bs =
|
||||||
- p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
p_obj_drc->str_bit_handler.num_bits_read_bs + 8 -
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs = p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
p_obj_drc->str_bit_handler.byte_index_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0)
|
p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
||||||
{
|
if (p_obj_drc->str_bit_handler.gain_stream_flag == 0) {
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs = p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
p_obj_drc->str_bit_handler.num_bytes_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
num_sample_to_process=(p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in/(p_obj_drc->str_config.pcm_size>>3));
|
num_sample_to_process =
|
||||||
|
(p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in /
|
||||||
|
(p_obj_drc->str_config.pcm_size >> 3));
|
||||||
|
|
||||||
p_obj_drc->str_config.frame_size = num_sample_to_process;
|
p_obj_drc->str_config.frame_size = num_sample_to_process;
|
||||||
|
|
||||||
if(num_sample_to_process<p_obj_drc->str_config.frame_size)
|
if (num_sample_to_process < p_obj_drc->str_config.frame_size) last_frame = 1;
|
||||||
last_frame=1;
|
|
||||||
|
|
||||||
if(p_obj_drc->str_config.pcm_size==16)
|
if (p_obj_drc->str_config.pcm_size == 16) {
|
||||||
{
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
for(i=0;i<p_obj_drc->str_config.num_ch_in;i++)
|
audio_buff[i] =
|
||||||
{
|
scratch_buffer + i * (p_obj_drc->str_config.frame_size + 32);
|
||||||
audio_buff[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
|
||||||
|
|
||||||
for(j=0;j<num_sample_to_process;j++)
|
for (j = 0; j < num_sample_to_process; j++) {
|
||||||
{
|
audio_buff[i][j] =
|
||||||
|
((FLOAT32)input_buffer16[j * p_obj_drc->str_config.num_ch_in + i]) /
|
||||||
audio_buff[i][j]=((FLOAT32)input_buffer16[j*p_obj_drc->str_config.num_ch_in + i])/32767.0f;
|
32767.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
{
|
audio_buff[i] =
|
||||||
for(i=0;i<p_obj_drc->str_config.num_ch_in;i++)
|
scratch_buffer + i * (p_obj_drc->str_config.frame_size + 32);
|
||||||
{
|
|
||||||
audio_buff[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
|
||||||
|
|
||||||
for(j=0;j<num_sample_to_process;j++)
|
for (j = 0; j < num_sample_to_process; j++) {
|
||||||
{
|
audio_buff[i][j] =
|
||||||
audio_buff[i][j]=input_buffer[j*p_obj_drc->str_config.num_ch_in + i];
|
input_buffer[j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code = impd_drc_process_time_domain(p_obj_drc->str_payload.pstr_gain_dec[0],
|
err_code = impd_drc_process_time_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[0],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_buff,
|
||||||
audio_buff,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
|
||||||
|
|
||||||
if(p_obj_drc->str_payload.pstr_drc_sel_proc_output->downmix_matrix_present!=0)
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->downmix_matrix_present !=
|
||||||
|
0)
|
||||||
err_code = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
err_code = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_buff,
|
audio_buff, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
|
||||||
|
|
||||||
err_code = impd_drc_process_time_domain(p_obj_drc->str_payload.pstr_gain_dec[1],
|
err_code = impd_drc_process_time_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[1],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_buff,
|
||||||
audio_buff,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
return err_code;
|
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db != 0.0f)
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
{
|
->loudness_normalization_gain_db != 0.0f) {
|
||||||
FLOAT32 gain_value = (FLOAT32)pow(10.0,p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db/20.0);
|
FLOAT32 gain_value =
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
(FLOAT32)pow(10.0, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
->loudness_normalization_gain_db /
|
||||||
|
20.0);
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
audio_buff[i][j] *= gain_value;
|
audio_buff[i][j] *= gain_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_obj_drc->str_config.peak_limiter)
|
if (p_obj_drc->str_config.peak_limiter) {
|
||||||
{
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_buff[i][j];
|
audio_buff[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code=impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
|
err_code =
|
||||||
output_buffer,
|
impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
|
||||||
p_obj_drc->str_config.frame_size);
|
output_buffer, p_obj_drc->str_config.frame_size);
|
||||||
|
|
||||||
|
if (err_code != IA_NO_ERROR) return err_code;
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
return err_code;
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
|
audio_buff[i][j] =
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i];
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
|
||||||
audio_buff[i][j] = output_buffer[j*p_obj_drc->str_config.num_ch_out + i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p_obj_drc->str_config.pcm_size==16)
|
if (p_obj_drc->str_config.pcm_size == 16) {
|
||||||
{
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++)
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
{
|
if (audio_buff[i][j] < -1.0f)
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++)
|
output_buffer16[j * p_obj_drc->str_config.num_ch_out + i] = -32767;
|
||||||
{
|
|
||||||
if(audio_buff[i][j]<-1.0f)
|
|
||||||
output_buffer16[j*p_obj_drc->str_config.num_ch_out + i] = -32767;
|
|
||||||
|
|
||||||
else if (audio_buff[i][j]>1.0f)
|
else if (audio_buff[i][j] > 1.0f)
|
||||||
output_buffer16[j*p_obj_drc->str_config.num_ch_out + i] = 32767;
|
output_buffer16[j * p_obj_drc->str_config.num_ch_out + i] = 32767;
|
||||||
|
|
||||||
else
|
else
|
||||||
output_buffer16[j*p_obj_drc->str_config.num_ch_out + i] = (WORD16)(audio_buff[i][j]*32767.0f);
|
output_buffer16[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
(WORD16)(audio_buff[i][j] * 32767.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
audio_buff[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in);
|
||||||
|
|
||||||
|
if (p_obj_drc->p_state->delay_in_output != 0) {
|
||||||
|
p_obj_drc->p_state->ui_out_bytes = p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->str_config.frame_size -
|
||||||
|
p_obj_drc->p_state->delay_in_output) *
|
||||||
|
(p_obj_drc->str_config.pcm_size >> 3);
|
||||||
|
if (p_obj_drc->str_config.pcm_size == 16)
|
||||||
|
memcpy(output_buffer16,
|
||||||
|
(output_buffer16 + (p_obj_drc->p_state->delay_in_output *
|
||||||
|
p_obj_drc->str_config.num_ch_out)),
|
||||||
|
p_obj_drc->p_state->ui_out_bytes);
|
||||||
else
|
else
|
||||||
{
|
memcpy(output_buffer,
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++)
|
(output_buffer + (p_obj_drc->p_state->delay_in_output *
|
||||||
{
|
p_obj_drc->str_config.num_ch_out)),
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++)
|
p_obj_drc->p_state->ui_out_bytes);
|
||||||
{
|
|
||||||
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_buff[i][j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in);
|
p_obj_drc->p_state->delay_adjust_samples =
|
||||||
|
p_obj_drc->p_state->delay_in_output;
|
||||||
if(p_obj_drc->p_state->delay_in_output!=0){
|
p_obj_drc->p_state->delay_in_output = 0;
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->str_config.frame_size-p_obj_drc->p_state->delay_in_output)*(p_obj_drc->str_config.pcm_size>>3);
|
}
|
||||||
if(p_obj_drc->str_config.pcm_size==16)
|
if (last_frame == 1) {
|
||||||
memcpy(output_buffer16,(output_buffer16+(p_obj_drc->p_state->delay_in_output*p_obj_drc->str_config.num_ch_out)),p_obj_drc->p_state->ui_out_bytes);
|
if ((num_sample_to_process + p_obj_drc->p_state->delay_adjust_samples) <=
|
||||||
|
p_obj_drc->str_config.frame_size)
|
||||||
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
|
(num_sample_to_process + p_obj_drc->p_state->delay_adjust_samples) *
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->str_config.pcm_size >> 3);
|
||||||
else
|
else
|
||||||
memcpy(output_buffer,(output_buffer+(p_obj_drc->p_state->delay_in_output*p_obj_drc->str_config.num_ch_out)),p_obj_drc->p_state->ui_out_bytes);
|
p_obj_drc->p_state->ui_out_bytes = (p_obj_drc->str_config.frame_size) *
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
p_obj_drc->p_state->delay_adjust_samples = p_obj_drc->p_state->delay_in_output;
|
(p_obj_drc->str_config.pcm_size >> 3);
|
||||||
p_obj_drc->p_state->delay_in_output=0;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(last_frame==1)
|
|
||||||
{
|
|
||||||
if((num_sample_to_process+p_obj_drc->p_state->delay_adjust_samples)<=p_obj_drc->str_config.frame_size)
|
|
||||||
p_obj_drc->p_state->ui_out_bytes = (num_sample_to_process+p_obj_drc->p_state->delay_adjust_samples)*p_obj_drc->str_config.num_ch_out*(p_obj_drc->str_config.pcm_size>>3);
|
|
||||||
else
|
|
||||||
p_obj_drc->p_state->ui_out_bytes = (p_obj_drc->str_config.frame_size)*p_obj_drc->str_config.num_ch_out*(p_obj_drc->str_config.pcm_size>>3);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(last_frame==0){
|
if (last_frame == 0) {
|
||||||
|
if (p_obj_drc->str_config.bitstream_file_format !=
|
||||||
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
|
err_code = impd_process_drc_bitstream_dec(
|
||||||
if (p_obj_drc->str_config.bitstream_file_format != BITSTREAM_FILE_FORMAT_SPLIT) {
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
err_code = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
|
||||||
p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (err_code > PROC_COMPLETE)
|
if (err_code > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
|
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,143 +39,118 @@
|
||||||
#include "impd_drc_hashdefines.h"
|
#include "impd_drc_hashdefines.h"
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
|
VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt, FLOAT64 *buff,
|
||||||
VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
FLOAT32 *input_real, FLOAT32 *input_imag,
|
||||||
FLOAT64 *buff,
|
FLOAT32 *output) {
|
||||||
FLOAT32 *input_real,
|
WORD32 i, j;
|
||||||
FLOAT32 *input_imag,
|
|
||||||
FLOAT32 *output)
|
|
||||||
{
|
|
||||||
WORD32 i,j;
|
|
||||||
FLOAT64 U[10 * QMF_NUM_FILT_BANDS];
|
FLOAT64 U[10 * QMF_NUM_FILT_BANDS];
|
||||||
FLOAT64 W[10 * QMF_NUM_FILT_BANDS];
|
FLOAT64 W[10 * QMF_NUM_FILT_BANDS];
|
||||||
|
|
||||||
FLOAT64 tmp;
|
FLOAT64 tmp;
|
||||||
|
|
||||||
for ( i=20*QMF_FILT_RESOLUTION-1; i>=2*QMF_FILT_RESOLUTION; i-- ) {
|
for (i = 20 * QMF_FILT_RESOLUTION - 1; i >= 2 * QMF_FILT_RESOLUTION; i--) {
|
||||||
buff[i] = buff[i-2*QMF_FILT_RESOLUTION];
|
buff[i] = buff[i - 2 * QMF_FILT_RESOLUTION];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 2 * QMF_FILT_RESOLUTION; i++) {
|
||||||
for ( i=0; i<2*QMF_FILT_RESOLUTION; i++ ) {
|
|
||||||
tmp = 0.0;
|
tmp = 0.0;
|
||||||
for ( j=0; j<QMF_FILT_RESOLUTION; j++ ) {
|
for (j = 0; j < QMF_FILT_RESOLUTION; j++) {
|
||||||
tmp = tmp
|
tmp = tmp + input_real[j] * qmf_filt->syn_tab_real[i][j] -
|
||||||
+ input_real[j] * qmf_filt->syn_tab_real[i][j]
|
input_imag[j] * qmf_filt->syn_tab_imag[i][j];
|
||||||
- input_imag[j] * qmf_filt->syn_tab_imag[i][j];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
buff[i] = tmp;
|
buff[i] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 5; i++) {
|
||||||
for ( i=0; i<5; i++ ) {
|
for (j = 0; j < QMF_FILT_RESOLUTION; j++) {
|
||||||
for ( j=0; j<QMF_FILT_RESOLUTION; j++ ) {
|
U[2 * QMF_FILT_RESOLUTION * i + j] =
|
||||||
U[2*QMF_FILT_RESOLUTION*i+j] = buff[4*QMF_FILT_RESOLUTION*i+j];
|
buff[4 * QMF_FILT_RESOLUTION * i + j];
|
||||||
U[2*QMF_FILT_RESOLUTION*i+QMF_FILT_RESOLUTION+j] = buff[4*QMF_FILT_RESOLUTION*i+3*QMF_FILT_RESOLUTION+j];
|
U[2 * QMF_FILT_RESOLUTION * i + QMF_FILT_RESOLUTION + j] =
|
||||||
|
buff[4 * QMF_FILT_RESOLUTION * i + 3 * QMF_FILT_RESOLUTION + j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 10 * QMF_FILT_RESOLUTION; i++) {
|
||||||
for ( i=0; i<10*QMF_FILT_RESOLUTION; i++ ) {
|
|
||||||
|
|
||||||
W[i] = U[i] * qmf_filter_coeff[i];
|
W[i] = U[i] * qmf_filter_coeff[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < QMF_FILT_RESOLUTION; i++) {
|
||||||
for ( i=0; i<QMF_FILT_RESOLUTION; i++ ) {
|
|
||||||
tmp = 0.0;
|
tmp = 0.0;
|
||||||
for ( j=0; j<10; j++ ) {
|
for (j = 0; j < 10; j++) {
|
||||||
tmp = tmp + W[QMF_FILT_RESOLUTION*j+i];
|
tmp = tmp + W[QMF_FILT_RESOLUTION * j + i];
|
||||||
}
|
}
|
||||||
output[i] = (FLOAT32) tmp;
|
output[i] = (FLOAT32)tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID process_qmf_ana_filt_bank(ia_drc_qmf_filt_struct *qmf_filt, FLOAT64 *buff,
|
||||||
VOID process_qmf_ana_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
FLOAT32 *input, FLOAT32 *output_real,
|
||||||
FLOAT64 *buff,
|
FLOAT32 *output_imag) {
|
||||||
FLOAT32 *input,
|
WORD32 i, j;
|
||||||
FLOAT32 *output_real,
|
|
||||||
FLOAT32 *output_imag)
|
|
||||||
{
|
|
||||||
WORD32 i,j;
|
|
||||||
FLOAT32 Z[10 * QMF_NUM_FILT_BANDS];
|
FLOAT32 Z[10 * QMF_NUM_FILT_BANDS];
|
||||||
FLOAT32 Y[2 * QMF_NUM_FILT_BANDS];
|
FLOAT32 Y[2 * QMF_NUM_FILT_BANDS];
|
||||||
|
|
||||||
for ( i=10*QMF_FILT_RESOLUTION-1; i>=QMF_FILT_RESOLUTION; i-- ) {
|
for (i = 10 * QMF_FILT_RESOLUTION - 1; i >= QMF_FILT_RESOLUTION; i--) {
|
||||||
buff[i] = buff[i-QMF_FILT_RESOLUTION];
|
buff[i] = buff[i - QMF_FILT_RESOLUTION];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = QMF_FILT_RESOLUTION - 1; i >= 0; i--) {
|
||||||
for ( i=QMF_FILT_RESOLUTION-1; i>=0; i-- ) {
|
buff[i] = input[QMF_FILT_RESOLUTION - 1 - i];
|
||||||
buff[i] = input[QMF_FILT_RESOLUTION-1-i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 10 * QMF_FILT_RESOLUTION; i++) {
|
||||||
for ( i=0; i<10*QMF_FILT_RESOLUTION; i++ ) {
|
Z[i] = (FLOAT32)(buff[i] * qmf_filter_coeff[i]);
|
||||||
|
|
||||||
Z[i] = (FLOAT32) (buff[i] * qmf_filter_coeff[i]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i=0; i<2*QMF_FILT_RESOLUTION; i++ ) {
|
for (i = 0; i < 2 * QMF_FILT_RESOLUTION; i++) {
|
||||||
Y[i] = 0.0f;
|
Y[i] = 0.0f;
|
||||||
for ( j=0; j<5; j++ ) {
|
for (j = 0; j < 5; j++) {
|
||||||
Y[i] += Z[i + j * 2 * QMF_FILT_RESOLUTION];
|
Y[i] += Z[i + j * 2 * QMF_FILT_RESOLUTION];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i=0; i<QMF_FILT_RESOLUTION; i++ ) {
|
for (i = 0; i < QMF_FILT_RESOLUTION; i++) {
|
||||||
output_real[i] = 0.0f;
|
output_real[i] = 0.0f;
|
||||||
output_imag[i] = 0.0f;
|
output_imag[i] = 0.0f;
|
||||||
for ( j=0; j<2*QMF_FILT_RESOLUTION; j++ ) {
|
for (j = 0; j < 2 * QMF_FILT_RESOLUTION; j++) {
|
||||||
output_real[i] += (FLOAT32) (Y[j] * qmf_filt->ana_tab_real[i][j]);
|
output_real[i] += (FLOAT32)(Y[j] * qmf_filt->ana_tab_real[i][j]);
|
||||||
output_imag[i] += (FLOAT32) (Y[j] * qmf_filt->ana_tab_imag[i][j]);
|
output_imag[i] += (FLOAT32)(Y[j] * qmf_filt->ana_tab_imag[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WORD32 impd_down_mix(
|
||||||
static WORD32 impd_down_mix ( ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output, FLOAT32** input_audio, WORD32 frame_len)
|
ia_drc_sel_proc_output_struct *uni_drc_sel_proc_output,
|
||||||
{
|
FLOAT32 **input_audio, WORD32 frame_len) {
|
||||||
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
WORD32 num_base_ch = uni_drc_sel_proc_output->base_channel_count;
|
||||||
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
WORD32 num_target_ch = uni_drc_sel_proc_output->target_channel_count;
|
||||||
WORD32 i, i_ch, o_ch;
|
WORD32 i, i_ch, o_ch;
|
||||||
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
FLOAT32 tmp_out[MAX_CHANNEL_COUNT];
|
||||||
|
|
||||||
|
if (num_target_ch > MAX_CHANNEL_COUNT) return -1;
|
||||||
|
|
||||||
if (num_target_ch > MAX_CHANNEL_COUNT)
|
if (num_target_ch > num_base_ch) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (num_target_ch > num_base_ch)
|
for (i = 0; i < frame_len; i++) {
|
||||||
return -1;
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
|
|
||||||
for (i=0; i<frame_len; i++) {
|
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++) {
|
|
||||||
tmp_out[o_ch] = 0.0f;
|
tmp_out[o_ch] = 0.0f;
|
||||||
for (i_ch=0; i_ch<num_base_ch; i_ch++) {
|
for (i_ch = 0; i_ch < num_base_ch; i_ch++) {
|
||||||
tmp_out[o_ch] += input_audio[i_ch][i] * uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
tmp_out[o_ch] += input_audio[i_ch][i] *
|
||||||
|
uni_drc_sel_proc_output->downmix_matrix[i_ch][o_ch];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (o_ch=0; o_ch<num_target_ch; o_ch++) {
|
for (o_ch = 0; o_ch < num_target_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = tmp_out[o_ch];
|
input_audio[o_ch][i] = tmp_out[o_ch];
|
||||||
}
|
}
|
||||||
for ( ; o_ch<num_base_ch; o_ch++) {
|
for (; o_ch < num_base_ch; o_ch++) {
|
||||||
input_audio[o_ch][i] = 0.0f;
|
input_audio[o_ch][i] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_init_process_audio_main_td_qmf(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
WORD32 error, i, j, num_samples_per_channel;
|
WORD32 error, i, j, num_samples_per_channel;
|
||||||
|
|
@ -186,186 +161,204 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
FLOAT32 *audio_io_buf_imag[10];
|
FLOAT32 *audio_io_buf_imag[10];
|
||||||
FLOAT32 *audio_in_out_buf[10];
|
FLOAT32 *audio_in_out_buf[10];
|
||||||
FLOAT32 *scratch_buffer;
|
FLOAT32 *scratch_buffer;
|
||||||
WORD32 last_frame=0;
|
WORD32 last_frame = 0;
|
||||||
error=0;
|
error = 0;
|
||||||
scratch_buffer= (FLOAT32*)p_obj_drc->pp_mem[1];
|
scratch_buffer = (FLOAT32 *)p_obj_drc->pp_mem[1];
|
||||||
input_buffer = (FLOAT32*)p_obj_drc->pp_mem[2];
|
input_buffer = (FLOAT32 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer = (FLOAT32*)p_obj_drc->pp_mem[3];
|
output_buffer = (FLOAT32 *)p_obj_drc->pp_mem[3];
|
||||||
|
|
||||||
input_buffer16 = (WORD16*)p_obj_drc->pp_mem[2];
|
input_buffer16 = (WORD16 *)p_obj_drc->pp_mem[2];
|
||||||
output_buffer16 = (WORD16*)p_obj_drc->pp_mem[3];
|
output_buffer16 = (WORD16 *)p_obj_drc->pp_mem[3];
|
||||||
|
|
||||||
|
if (p_obj_drc->p_state->ui_in_bytes <= 0) {
|
||||||
if(p_obj_drc->p_state->ui_in_bytes<=0){
|
p_obj_drc->p_state->ui_out_bytes = 0;
|
||||||
p_obj_drc->p_state->ui_out_bytes=0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
if ((p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in /
|
||||||
last_frame=1;
|
(p_obj_drc->str_config.pcm_size >> 3)) <
|
||||||
|
(UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
|
last_frame = 1;
|
||||||
|
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
for(i=0;i<p_obj_drc->str_config.num_ch_in;i++){
|
audio_in_out_buf[i] = scratch_buffer;
|
||||||
audio_in_out_buf[i]=scratch_buffer;
|
scratch_buffer = scratch_buffer + (p_obj_drc->str_config.frame_size + 32);
|
||||||
scratch_buffer=scratch_buffer+(p_obj_drc->str_config.frame_size+32);
|
audio_io_buf_real[i] =
|
||||||
audio_io_buf_real[i]=scratch_buffer+(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);
|
scratch_buffer +
|
||||||
audio_io_buf_imag[i]=scratch_buffer+2*(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);;
|
(p_obj_drc->str_config.frame_size * p_obj_drc->str_config.num_ch_in +
|
||||||
for(j=0;j<p_obj_drc->str_config.frame_size;j++){
|
512);
|
||||||
if(p_obj_drc->str_config.pcm_size==16){
|
audio_io_buf_imag[i] = scratch_buffer +
|
||||||
audio_in_out_buf[i][j]=((FLOAT32)input_buffer16[j*p_obj_drc->str_config.num_ch_in + i])/32767.0f;
|
2 * (p_obj_drc->str_config.frame_size *
|
||||||
}
|
p_obj_drc->str_config.num_ch_in +
|
||||||
else {
|
512);
|
||||||
audio_in_out_buf[i][j]=input_buffer[j*p_obj_drc->str_config.num_ch_in + i];
|
;
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
|
if (p_obj_drc->str_config.pcm_size == 16) {
|
||||||
|
audio_in_out_buf[i][j] =
|
||||||
|
((FLOAT32)input_buffer16[j * p_obj_drc->str_config.num_ch_in + i]) /
|
||||||
|
32767.0f;
|
||||||
|
} else {
|
||||||
|
audio_in_out_buf[i][j] =
|
||||||
|
input_buffer[j * p_obj_drc->str_config.num_ch_in + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error = impd_process_drc_bitstream_dec_gain(
|
||||||
error = impd_process_drc_bitstream_dec_gain(p_obj_drc->str_payload.pstr_bitstream_dec,
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (error > PROC_COMPLETE) return -1;
|
if (error > PROC_COMPLETE) return -1;
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
}
|
}
|
||||||
if (p_obj_drc->str_config.bitstream_file_format == BITSTREAM_FILE_FORMAT_SPLIT) {
|
if (p_obj_drc->str_config.bitstream_file_format ==
|
||||||
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
/* shift over fill-bits for frame byte alignment */
|
/* shift over fill-bits for frame byte alignment */
|
||||||
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0)
|
if (p_obj_drc->str_bit_handler.num_bits_offset_bs != 0) {
|
||||||
{
|
p_obj_drc->str_bit_handler.num_bits_read_bs =
|
||||||
p_obj_drc->str_bit_handler.num_bits_read_bs = p_obj_drc->str_bit_handler.num_bits_read_bs + 8 - p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
p_obj_drc->str_bit_handler.num_bits_read_bs + 8 -
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs + 1;
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs = p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
p_obj_drc->str_bit_handler.byte_index_bs =
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0) //ITTIAM: Flag for applying gain frame by frame
|
p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
||||||
|
if (p_obj_drc->str_bit_handler.gain_stream_flag ==
|
||||||
|
0) // ITTIAM: Flag for applying gain frame by frame
|
||||||
{
|
{
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs = p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
p_obj_drc->str_bit_handler.num_bytes_bs =
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
for (i = 0; i < p_obj_drc->str_config.num_ch_in; i++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j += 64) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j += 64) {
|
||||||
|
process_qmf_ana_filt_bank(
|
||||||
process_qmf_ana_filt_bank(p_obj_drc->str_payload.pstr_qmf_filter,
|
p_obj_drc->str_payload.pstr_qmf_filter,
|
||||||
p_obj_drc->str_payload.pstr_qmf_filter->ana_buff+i*4*p_obj_drc->str_config.frame_size,
|
p_obj_drc->str_payload.pstr_qmf_filter->ana_buff +
|
||||||
&(audio_in_out_buf[i][j]),
|
i * 4 * p_obj_drc->str_config.frame_size,
|
||||||
&(audio_io_buf_real[i][j]),
|
&(audio_in_out_buf[i][j]), &(audio_io_buf_real[i][j]),
|
||||||
&(audio_io_buf_imag[i][j]));
|
&(audio_io_buf_imag[i][j]));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[0],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[0],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
|
|
||||||
if (error) return error;
|
if (error) return error;
|
||||||
|
|
||||||
if(p_obj_drc->str_payload.pstr_drc_sel_proc_output->target_channel_count<p_obj_drc->str_payload.pstr_drc_sel_proc_output->base_channel_count){
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->target_channel_count <
|
||||||
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->base_channel_count) {
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_real,
|
audio_io_buf_real, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return error;
|
if (error) return error;
|
||||||
|
|
||||||
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
error = impd_down_mix(p_obj_drc->str_payload.pstr_drc_sel_proc_output,
|
||||||
audio_io_buf_imag,
|
audio_io_buf_imag, p_obj_drc->str_config.frame_size);
|
||||||
p_obj_drc->str_config.frame_size);
|
|
||||||
if (error) return error;
|
if (error) return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = impd_drc_process_freq_domain(p_obj_drc->str_payload.pstr_gain_dec[1],
|
error = impd_drc_process_freq_domain(
|
||||||
|
p_obj_drc->str_payload.pstr_gain_dec[1],
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_drc_gain,
|
p_obj_drc->str_payload.pstr_drc_gain, audio_io_buf_real,
|
||||||
audio_io_buf_real,
|
audio_io_buf_imag, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
audio_io_buf_imag,
|
->loudness_normalization_gain_db,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->boost,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output->compress,
|
||||||
p_obj_drc->str_payload.pstr_drc_sel_proc_output->drc_characteristic_target);
|
p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
|
->drc_characteristic_target);
|
||||||
if (error) return -1;
|
if (error) return -1;
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j += 64) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j += 64) {
|
||||||
|
process_qmf_syn_filt_bank(
|
||||||
process_qmf_syn_filt_bank(p_obj_drc->str_payload.pstr_qmf_filter,
|
p_obj_drc->str_payload.pstr_qmf_filter,
|
||||||
p_obj_drc->str_payload.pstr_qmf_filter->syn_buff+i*4*p_obj_drc->str_config.frame_size,
|
p_obj_drc->str_payload.pstr_qmf_filter->syn_buff +
|
||||||
&(audio_io_buf_real[i][j]),
|
i * 4 * p_obj_drc->str_config.frame_size,
|
||||||
&(audio_io_buf_imag[i][j]),
|
&(audio_io_buf_real[i][j]), &(audio_io_buf_imag[i][j]),
|
||||||
&(audio_in_out_buf[i][j]));
|
&(audio_in_out_buf[i][j]));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db != 0.0f)
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
{
|
->loudness_normalization_gain_db != 0.0f) {
|
||||||
FLOAT32 loudness_normalization_gain = (FLOAT32)pow(10.0,p_obj_drc->str_payload.pstr_drc_sel_proc_output->loudness_normalization_gain_db/20.0);
|
FLOAT32 loudness_normalization_gain =
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
(FLOAT32)pow(10.0, p_obj_drc->str_payload.pstr_drc_sel_proc_output
|
||||||
for (j=0; j <p_obj_drc->str_config. frame_size; j++) {
|
->loudness_normalization_gain_db /
|
||||||
|
20.0);
|
||||||
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
audio_io_buf_real[i][j] *= loudness_normalization_gain;
|
||||||
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
audio_io_buf_imag[i][j] *= loudness_normalization_gain;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
num_samples_per_channel = p_obj_drc->str_config.frame_size;
|
||||||
|
|
||||||
for (i=0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
for (i = 0; i < p_obj_drc->str_config.num_ch_out; i++) {
|
||||||
for (j=0; j < p_obj_drc->str_config.frame_size; j++) {
|
for (j = 0; j < p_obj_drc->str_config.frame_size; j++) {
|
||||||
if(p_obj_drc->str_config.pcm_size==16){
|
if (p_obj_drc->str_config.pcm_size == 16) {
|
||||||
output_buffer16[j*p_obj_drc->str_config.num_ch_out + i] = (WORD16)(audio_in_out_buf[i][j]*32767.0f);
|
output_buffer16[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
(WORD16)(audio_in_out_buf[i][j] * 32767.0f);
|
||||||
|
} else {
|
||||||
|
output_buffer[j * p_obj_drc->str_config.num_ch_out + i] =
|
||||||
|
audio_in_out_buf[i][j];
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_in_out_buf[i][j];
|
}
|
||||||
|
p_obj_drc->p_state->ui_out_bytes =
|
||||||
|
p_obj_drc->str_config.num_ch_out *
|
||||||
|
(p_obj_drc->p_state->ui_in_bytes / p_obj_drc->str_config.num_ch_in);
|
||||||
|
|
||||||
}
|
if (p_obj_drc->str_config.bitstream_file_format !=
|
||||||
}
|
BITSTREAM_FILE_FORMAT_SPLIT) {
|
||||||
}
|
error = impd_process_drc_bitstream_dec(
|
||||||
p_obj_drc->p_state->ui_out_bytes=p_obj_drc->str_config.num_ch_out*(p_obj_drc->p_state->ui_in_bytes/p_obj_drc->str_config.num_ch_in);
|
p_obj_drc->str_payload.pstr_bitstream_dec, p_obj_drc->pstr_bit_buf,
|
||||||
|
|
||||||
if (p_obj_drc->str_config.bitstream_file_format != BITSTREAM_FILE_FORMAT_SPLIT) {
|
|
||||||
error = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
|
||||||
p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_config,
|
p_obj_drc->str_payload.pstr_drc_config,
|
||||||
p_obj_drc->str_payload.pstr_loudness_info,
|
p_obj_drc->str_payload.pstr_loudness_info,
|
||||||
&p_obj_drc->str_bit_handler.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
&p_obj_drc->str_bit_handler
|
||||||
|
.it_bit_buf[p_obj_drc->str_bit_handler.byte_index_bs],
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs,
|
p_obj_drc->str_bit_handler.num_bytes_bs,
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
p_obj_drc->str_bit_handler.num_bits_offset_bs,
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
&p_obj_drc->str_bit_handler.num_bits_read_bs);
|
||||||
|
|
||||||
if (error > PROC_COMPLETE)
|
if (error > PROC_COMPLETE) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_read_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = (p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs += p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs -= p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs >> 3);
|
||||||
|
p_obj_drc->str_bit_handler.num_bits_offset_bs =
|
||||||
|
(p_obj_drc->str_bit_handler.num_bits_read_bs & 7);
|
||||||
|
p_obj_drc->str_bit_handler.byte_index_bs +=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_bs -=
|
||||||
|
p_obj_drc->str_bit_handler.num_bytes_read_bs;
|
||||||
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
#ifndef IMPD_DRC_MULTI_BAND_H
|
#ifndef IMPD_DRC_MULTI_BAND_H
|
||||||
#define IMPD_DRC_MULTI_BAND_H
|
#define IMPD_DRC_MULTI_BAND_H
|
||||||
|
|
||||||
#define DRC_SUBBAND_COUNT_WITH_AUDIO_CODEC_FILTERBANK_MAX FILTER_BANK_PARAMETER_COUNT
|
#define DRC_SUBBAND_COUNT_WITH_AUDIO_CODEC_FILTERBANK_MAX \
|
||||||
|
FILTER_BANK_PARAMETER_COUNT
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -36,35 +36,29 @@ typedef struct {
|
||||||
} ia_group_overlap_params_struct;
|
} ia_group_overlap_params_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_group_overlap_params_struct str_group_overlap_params[CHANNEL_GROUP_COUNT_MAX];
|
ia_group_overlap_params_struct
|
||||||
|
str_group_overlap_params[CHANNEL_GROUP_COUNT_MAX];
|
||||||
} ia_overlap_params_struct;
|
} ia_overlap_params_struct;
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_fcenter_norm_sb_init(WORD32 num_subbands, FLOAT32* fcenter_norm_subband);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_fcenter_norm_sb_init(WORD32 num_subbands,
|
impd_generate_slope(WORD32 num_subbands, FLOAT32* fcenter_norm_subband,
|
||||||
FLOAT32* fcenter_norm_subband);
|
FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
|
||||||
|
|
||||||
WORD32
|
|
||||||
impd_generate_slope (WORD32 num_subbands,
|
|
||||||
FLOAT32* fcenter_norm_subband,
|
|
||||||
FLOAT32 fcross_norm_lo,
|
|
||||||
FLOAT32 fcross_norm_hi,
|
|
||||||
FLOAT32* response);
|
FLOAT32* response);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_generate_overlap_weights (WORD32 num_drc_bands,
|
impd_generate_overlap_weights(
|
||||||
WORD32 drc_band_type,
|
WORD32 num_drc_bands, WORD32 drc_band_type,
|
||||||
ia_gain_params_struct* gain_params,
|
ia_gain_params_struct* gain_params, WORD32 dec_subband_count,
|
||||||
WORD32 dec_subband_count,
|
|
||||||
ia_group_overlap_params_struct* pstr_group_overlap_params);
|
ia_group_overlap_params_struct* pstr_group_overlap_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_overlap_weight ( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
impd_init_overlap_weight(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode, ia_overlap_params_struct* pstr_overlap_params);
|
||||||
ia_overlap_params_struct* pstr_overlap_params);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,51 +30,41 @@
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
IA_ERRORCODE impd_fcenter_norm_sb_init(WORD32 num_subbands,
|
IA_ERRORCODE impd_fcenter_norm_sb_init(WORD32 num_subbands,
|
||||||
FLOAT32* fcenter_norm_subband)
|
FLOAT32* fcenter_norm_subband) {
|
||||||
{
|
|
||||||
WORD32 s;
|
WORD32 s;
|
||||||
for (s=0; s<num_subbands; s++) {
|
for (s = 0; s < num_subbands; s++) {
|
||||||
fcenter_norm_subband[s] = (s + 0.5f) / (2.0f * num_subbands);
|
fcenter_norm_subband[s] = (s + 0.5f) / (2.0f * num_subbands);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
IA_ERRORCODE impd_generate_slope (WORD32 num_sub_bands,
|
IA_ERRORCODE impd_generate_slope(WORD32 num_sub_bands,
|
||||||
FLOAT32* fcenter_norm_subband,
|
FLOAT32* fcenter_norm_subband,
|
||||||
FLOAT32 fcross_norm_lo,
|
FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
|
||||||
FLOAT32 fcross_norm_hi,
|
FLOAT32* response) {
|
||||||
FLOAT32* response)
|
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 filter_slope =-24.0f;
|
FLOAT32 filter_slope = -24.0f;
|
||||||
FLOAT32 inv_log10_2 =3.32192809f;
|
FLOAT32 inv_log10_2 = 3.32192809f;
|
||||||
FLOAT32 norm = 0.05f * filter_slope * inv_log10_2;
|
FLOAT32 norm = 0.05f * filter_slope * inv_log10_2;
|
||||||
|
|
||||||
for (i=0; i<num_sub_bands; i++)
|
for (i = 0; i < num_sub_bands; i++) {
|
||||||
{
|
if (fcenter_norm_subband[i] < fcross_norm_lo) {
|
||||||
if (fcenter_norm_subband[i] < fcross_norm_lo)
|
response[i] = (FLOAT32)pow(
|
||||||
{
|
10.0, norm * log10(fcross_norm_lo / fcenter_norm_subband[i]));
|
||||||
response[i] = (FLOAT32)pow (10.0, norm * log10(fcross_norm_lo / fcenter_norm_subband[i]));
|
} else if (fcenter_norm_subband[i] < fcross_norm_hi) {
|
||||||
}
|
|
||||||
else if (fcenter_norm_subband[i] < fcross_norm_hi)
|
|
||||||
{
|
|
||||||
response[i] = 1.0f;
|
response[i] = 1.0f;
|
||||||
}
|
} else {
|
||||||
else
|
response[i] = (FLOAT32)pow(
|
||||||
{
|
10.0, norm * log10(fcenter_norm_subband[i] / fcross_norm_hi));
|
||||||
response[i] = (FLOAT32)pow (10.0, norm * log10(fcenter_norm_subband[i] / fcross_norm_hi));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IA_ERRORCODE impd_generate_overlap_weights(
|
||||||
IA_ERRORCODE impd_generate_overlap_weights (WORD32 num_drc_bands,
|
WORD32 num_drc_bands, WORD32 drc_band_type,
|
||||||
WORD32 drc_band_type,
|
ia_gain_params_struct* gain_params, WORD32 dec_subband_count,
|
||||||
ia_gain_params_struct* gain_params,
|
ia_group_overlap_params_struct* pstr_group_overlap_params) {
|
||||||
WORD32 dec_subband_count,
|
|
||||||
ia_group_overlap_params_struct* pstr_group_overlap_params)
|
|
||||||
{
|
|
||||||
FLOAT32 fcenter_norm_subband[AUDIO_CODEC_SUBBAND_COUNT_MAX];
|
FLOAT32 fcenter_norm_subband[AUDIO_CODEC_SUBBAND_COUNT_MAX];
|
||||||
FLOAT32 w_norm[AUDIO_CODEC_SUBBAND_COUNT_MAX];
|
FLOAT32 w_norm[AUDIO_CODEC_SUBBAND_COUNT_MAX];
|
||||||
FLOAT32 fcross_norm_lo, fcross_norm_hi;
|
FLOAT32 fcross_norm_lo, fcross_norm_hi;
|
||||||
|
|
@ -83,75 +73,65 @@ IA_ERRORCODE impd_generate_overlap_weights (WORD32 num_drc_bands,
|
||||||
|
|
||||||
if (drc_band_type == 1) {
|
if (drc_band_type == 1) {
|
||||||
fcross_norm_lo = 0.0f;
|
fcross_norm_lo = 0.0f;
|
||||||
for (b=0; b<num_drc_bands; b++)
|
for (b = 0; b < num_drc_bands; b++) {
|
||||||
{
|
if (b < num_drc_bands - 1) {
|
||||||
if (b<num_drc_bands - 1)
|
fcross_norm_hi =
|
||||||
{
|
normal_cross_freq[gain_params[b + 1].crossover_freq_idx]
|
||||||
fcross_norm_hi = normal_cross_freq[gain_params[b+1].crossover_freq_idx].f_cross_norm;
|
.f_cross_norm;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
fcross_norm_hi = 0.5f;
|
fcross_norm_hi = 0.5f;
|
||||||
}
|
}
|
||||||
impd_generate_slope (dec_subband_count,
|
impd_generate_slope(
|
||||||
fcenter_norm_subband,
|
dec_subband_count, fcenter_norm_subband, fcross_norm_lo,
|
||||||
fcross_norm_lo,
|
|
||||||
fcross_norm_hi,
|
fcross_norm_hi,
|
||||||
pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight);
|
pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight);
|
||||||
|
|
||||||
fcross_norm_lo = fcross_norm_hi;
|
fcross_norm_lo = fcross_norm_hi;
|
||||||
}
|
}
|
||||||
for (s=0; s<dec_subband_count; s++)
|
for (s = 0; s < dec_subband_count; s++) {
|
||||||
{
|
w_norm[s] = pstr_group_overlap_params->str_band_overlap_params[0]
|
||||||
w_norm[s] = pstr_group_overlap_params->str_band_overlap_params[0].overlap_weight[s];
|
.overlap_weight[s];
|
||||||
for (b=1; b<num_drc_bands; b++)
|
for (b = 1; b < num_drc_bands; b++) {
|
||||||
{
|
w_norm[s] += pstr_group_overlap_params->str_band_overlap_params[b]
|
||||||
w_norm[s] += pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight[s];
|
.overlap_weight[s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s=0; s<dec_subband_count; s++)
|
for (s = 0; s < dec_subband_count; s++) {
|
||||||
{
|
for (b = 0; b < num_drc_bands; b++) {
|
||||||
for (b=0; b<num_drc_bands; b++)
|
pstr_group_overlap_params->str_band_overlap_params[b]
|
||||||
{
|
.overlap_weight[s] /= w_norm[s];
|
||||||
pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight[s] /= w_norm[s];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
start_subband_index = 0;
|
start_subband_index = 0;
|
||||||
for (b=0; b<num_drc_bands; b++)
|
for (b = 0; b < num_drc_bands; b++) {
|
||||||
{
|
if (b < num_drc_bands - 1) {
|
||||||
if (b < num_drc_bands-1)
|
stop_sub_band_index = gain_params[b + 1].start_subband_index - 1;
|
||||||
{
|
} else {
|
||||||
stop_sub_band_index = gain_params[b+1].start_subband_index-1;
|
stop_sub_band_index = dec_subband_count - 1;
|
||||||
}
|
}
|
||||||
else
|
for (s = 0; s < dec_subband_count; s++) {
|
||||||
{
|
if (s >= start_subband_index && s <= stop_sub_band_index) {
|
||||||
stop_sub_band_index = dec_subband_count-1;
|
pstr_group_overlap_params->str_band_overlap_params[b]
|
||||||
}
|
.overlap_weight[s] = 1.0;
|
||||||
for (s=0; s<dec_subband_count; s++)
|
} else {
|
||||||
{
|
pstr_group_overlap_params->str_band_overlap_params[b]
|
||||||
if (s >= start_subband_index && s <= stop_sub_band_index)
|
.overlap_weight[s] = 0.0;
|
||||||
{
|
|
||||||
pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight[s] = 1.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pstr_group_overlap_params->str_band_overlap_params[b].overlap_weight[s] = 0.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
start_subband_index = stop_sub_band_index+1;
|
start_subband_index = stop_sub_band_index + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
IA_ERRORCODE impd_init_overlap_weight ( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
IA_ERRORCODE impd_init_overlap_weight(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_overlap_params_struct* pstr_overlap_params)
|
ia_overlap_params_struct* pstr_overlap_params) {
|
||||||
{
|
|
||||||
WORD32 err = 0, g;
|
WORD32 err = 0, g;
|
||||||
WORD32 dec_subband_count = 0;
|
WORD32 dec_subband_count = 0;
|
||||||
switch (sub_band_domain_mode) {
|
switch (sub_band_domain_mode) {
|
||||||
|
|
@ -166,13 +146,18 @@ IA_ERRORCODE impd_init_overlap_weight ( ia_uni_drc_coeffs_struct* str_p_loc_drc_
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
if (str_drc_instruction_str->band_count_of_ch_group[g] > 1) {
|
||||||
if (str_drc_instruction_str->band_count_of_ch_group[g] > 1)
|
err = impd_generate_overlap_weights(
|
||||||
{
|
str_drc_instruction_str->band_count_of_ch_group[g],
|
||||||
err = impd_generate_overlap_weights(str_drc_instruction_str->band_count_of_ch_group[g],
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].drc_band_type,
|
->gain_set_params[str_drc_instruction_str
|
||||||
str_p_loc_drc_coefficients_uni_drc->gain_set_params[str_drc_instruction_str->gain_set_index_for_channel_group[g]].gain_params,
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.drc_band_type,
|
||||||
|
str_p_loc_drc_coefficients_uni_drc
|
||||||
|
->gain_set_params[str_drc_instruction_str
|
||||||
|
->gain_set_index_for_channel_group[g]]
|
||||||
|
.gain_params,
|
||||||
dec_subband_count,
|
dec_subband_count,
|
||||||
&(pstr_overlap_params->str_group_overlap_params[g]));
|
&(pstr_overlap_params->str_group_overlap_params[g]));
|
||||||
if (err) return (err);
|
if (err) return (err);
|
||||||
|
|
@ -181,6 +166,3 @@ IA_ERRORCODE impd_init_overlap_weight ( ia_uni_drc_coeffs_struct* str_p_loc_drc_
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -26,72 +26,66 @@ impd_dec_ducking_scaling(ia_bit_buf_struct* it_bit_buff,
|
||||||
FLOAT32* ducking_scaling);
|
FLOAT32* ducking_scaling);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info(ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
WORD32 version,
|
|
||||||
ia_loudness_info_struct* loudness_info);
|
ia_loudness_info_struct* loudness_info);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info_set_ext(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info_set_ext(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct* loudness_info_set);
|
ia_drc_loudness_info_set_struct* loudness_info_set);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_sel_drc_coeff(ia_drc_config* drc_config,
|
impd_sel_drc_coeff(
|
||||||
WORD32 location,
|
ia_drc_config* drc_config, WORD32 location,
|
||||||
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_parse_instructions_basic(ia_bit_buf_struct* it_bit_buff,
|
impd_drc_parse_instructions_basic(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_instructions_basic_struct* str_drc_instructions_basic);
|
ia_drc_instructions_basic_struct* str_drc_instructions_basic);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_instructions_uni_drc(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_drc_instructions_uni_drc(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version, ia_drc_config* drc_config,
|
||||||
ia_drc_config* drc_config,
|
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str);
|
ia_drc_instructions_struct* str_drc_instruction_str);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_gain_set_params(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_gain_set_params(ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
WORD32 version,
|
|
||||||
WORD32* gain_seq_idx,
|
WORD32* gain_seq_idx,
|
||||||
ia_gain_set_params_struct* gain_set_params);
|
ia_gain_set_params_struct* gain_set_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_parse_coeff(ia_bit_buf_struct* it_bit_buff,
|
impd_drc_parse_coeff(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_dwnmix_instructions(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_dwnmix_instructions(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_channel_layout_struct* channel_layout,
|
ia_channel_layout_struct* channel_layout,
|
||||||
ia_downmix_instructions_struct* dwnmix_instructions);
|
ia_downmix_instructions_struct* dwnmix_instructions);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_ext_v1(
|
impd_parse_drc_ext_v1(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_drc_config* drc_config,
|
ia_drc_config* drc_config,
|
||||||
ia_drc_config_ext* str_drc_config_ext);
|
ia_drc_config_ext* str_drc_config_ext);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_config(
|
impd_parse_drc_config(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_drc_config* drc_config
|
ia_drc_config* drc_config);
|
||||||
);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info_set(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct* loudness_info_set);
|
ia_drc_loudness_info_set_struct* loudness_info_set);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_gain_sequence(
|
impd_parse_drc_gain_sequence(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* pstr_drc_uni_bs_dec,
|
||||||
ia_drc_bits_dec_struct *pstr_drc_uni_bs_dec,
|
|
||||||
ia_gain_set_params_struct* gain_set_params,
|
ia_gain_set_params_struct* gain_set_params,
|
||||||
ia_drc_gain_sequence_struct* drc_gain_sequence);
|
ia_drc_gain_sequence_struct* drc_gain_sequence);
|
||||||
|
|
||||||
|
|
@ -99,11 +93,9 @@ WORD32
|
||||||
impd_parse_uni_drc_gain_ext(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_uni_drc_gain_ext(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_uni_drc_gain_ext_struct* uni_drc_gain_ext);
|
ia_uni_drc_gain_ext_struct* uni_drc_gain_ext);
|
||||||
|
|
||||||
WORD32 impd_drc_uni_gain_read(
|
WORD32 impd_drc_uni_gain_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* pstr_drc_uni_bs_dec,
|
||||||
ia_drc_bits_dec_struct *pstr_drc_uni_bs_dec,
|
|
||||||
ia_drc_config* drc_config,
|
ia_drc_config* drc_config,
|
||||||
ia_drc_gain_struct* pstr_uni_drc_gain);
|
ia_drc_gain_struct* pstr_uni_drc_gain);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@
|
||||||
#define IMPD_DRC_PARSER_INTERFACE_H
|
#define IMPD_DRC_PARSER_INTERFACE_H
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_unidrc_interface_signature_read(ia_bit_buf_struct* it_bit_buff,
|
impd_unidrc_interface_signature_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_uni_interface_signat_struct* drc_uni_interface_signature);
|
ia_drc_uni_interface_signat_struct* drc_uni_interface_signature);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
|
|
@ -29,11 +30,13 @@ impd_sys_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_system_interface_struct* system_interface);
|
ia_system_interface_struct* system_interface);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_loudness_norm_control_interface_read(ia_bit_buf_struct* it_bit_buff,
|
impd_loudness_norm_control_interface_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_loudness_norm_ctrl_interface_struct* loudness_norm_ctrl_interface);
|
ia_loudness_norm_ctrl_interface_struct* loudness_norm_ctrl_interface);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_loudness_norm_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
impd_loudness_norm_param_interface_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_loudness_norm_parameter_interface_struct* loudness_norm_param_interface);
|
ia_loudness_norm_parameter_interface_struct* loudness_norm_param_interface);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
|
|
@ -41,11 +44,13 @@ impd_drc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_dyn_rng_ctrl_interface_struct* drc_ctrl_interface);
|
ia_dyn_rng_ctrl_interface_struct* drc_ctrl_interface);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
impd_drc_param_interface_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_parameter_interface_struct* drc_parameter_interface);
|
ia_drc_parameter_interface_struct* drc_parameter_interface);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_unidrc_interface_extension_read(ia_bit_buf_struct* it_bit_buff,
|
impd_unidrc_interface_extension_read(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_interface_struct* impd_drc_uni_interface,
|
ia_drc_interface_struct* impd_drc_uni_interface,
|
||||||
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext);
|
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,61 +32,54 @@
|
||||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
WORD32 impd_peak_limiter_init(ia_drc_peak_limiter_struct *peak_limiter,
|
||||||
|
FLOAT32 attack_time, FLOAT32 release_time,
|
||||||
WORD32 impd_peak_limiter_init( ia_drc_peak_limiter_struct *peak_limiter,
|
FLOAT32 limit_threshold, UWORD32 num_channels,
|
||||||
FLOAT32 attack_time,
|
UWORD32 sample_rate, FLOAT32 *buffer) {
|
||||||
FLOAT32 release_time,
|
|
||||||
FLOAT32 limit_threshold,
|
|
||||||
UWORD32 num_channels,
|
|
||||||
UWORD32 sample_rate,
|
|
||||||
FLOAT32 *buffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
UWORD32 attack;
|
UWORD32 attack;
|
||||||
attack = (UWORD32)(attack_time * sample_rate / 1000);
|
attack = (UWORD32)(attack_time * sample_rate / 1000);
|
||||||
|
|
||||||
if (attack < 1)
|
if (attack < 1) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
peak_limiter->max_buf=buffer;
|
peak_limiter->max_buf = buffer;
|
||||||
peak_limiter->delayed_input=buffer+attack*4+32;
|
peak_limiter->delayed_input = buffer + attack * 4 + 32;
|
||||||
|
|
||||||
peak_limiter->delayed_input_index = 0;
|
peak_limiter->delayed_input_index = 0;
|
||||||
peak_limiter->attack_time = attack_time;
|
peak_limiter->attack_time = attack_time;
|
||||||
peak_limiter->release_time = release_time;
|
peak_limiter->release_time = release_time;
|
||||||
peak_limiter->attack_time_samples = attack;
|
peak_limiter->attack_time_samples = attack;
|
||||||
peak_limiter->attack_constant = (FLOAT32)pow(0.1, 1.0 / (attack + 1));
|
peak_limiter->attack_constant = (FLOAT32)pow(0.1, 1.0 / (attack + 1));
|
||||||
peak_limiter->release_constant = (FLOAT32)pow(0.1, 1.0 / (release_time * sample_rate / 1000 + 1));
|
peak_limiter->release_constant =
|
||||||
|
(FLOAT32)pow(0.1, 1.0 / (release_time * sample_rate / 1000 + 1));
|
||||||
peak_limiter->limit_threshold = limit_threshold;
|
peak_limiter->limit_threshold = limit_threshold;
|
||||||
peak_limiter->num_channels = num_channels;
|
peak_limiter->num_channels = num_channels;
|
||||||
peak_limiter->sample_rate = sample_rate;
|
peak_limiter->sample_rate = sample_rate;
|
||||||
peak_limiter->min_gain = 1.0f;
|
peak_limiter->min_gain = 1.0f;
|
||||||
peak_limiter->limiter_on=1;
|
peak_limiter->limiter_on = 1;
|
||||||
peak_limiter->pre_smoothed_gain=1.0f;
|
peak_limiter->pre_smoothed_gain = 1.0f;
|
||||||
peak_limiter->gain_modified=1.0f;
|
peak_limiter->gain_modified = 1.0f;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_peak_limiter_reinit(ia_drc_peak_limiter_struct *peak_limiter)
|
WORD32 impd_peak_limiter_reinit(ia_drc_peak_limiter_struct *peak_limiter) {
|
||||||
{
|
if (peak_limiter) {
|
||||||
if (peak_limiter)
|
|
||||||
{
|
|
||||||
peak_limiter->delayed_input_index = 0;
|
peak_limiter->delayed_input_index = 0;
|
||||||
peak_limiter->pre_smoothed_gain=1.0f;
|
peak_limiter->pre_smoothed_gain = 1.0f;
|
||||||
peak_limiter->gain_modified=1.0f;
|
peak_limiter->gain_modified = 1.0f;
|
||||||
peak_limiter->min_gain = 1.0f;
|
peak_limiter->min_gain = 1.0f;
|
||||||
memset(peak_limiter->max_buf, 0, (peak_limiter->attack_time_samples + 1) * sizeof(FLOAT32) );
|
memset(peak_limiter->max_buf, 0,
|
||||||
memset(peak_limiter->delayed_input, 0, peak_limiter->attack_time_samples * peak_limiter->num_channels * sizeof(FLOAT32) );
|
(peak_limiter->attack_time_samples + 1) * sizeof(FLOAT32));
|
||||||
|
memset(peak_limiter->delayed_input, 0, peak_limiter->attack_time_samples *
|
||||||
|
peak_limiter->num_channels *
|
||||||
|
sizeof(FLOAT32));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter, FLOAT32 *samples, UWORD32 frame_len)
|
WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
|
||||||
{
|
FLOAT32 *samples, UWORD32 frame_len) {
|
||||||
UWORD32 i, j;
|
UWORD32 i, j;
|
||||||
FLOAT32 tmp, gain;
|
FLOAT32 tmp, gain;
|
||||||
FLOAT32 min_gain = 1;
|
FLOAT32 min_gain = 1;
|
||||||
|
|
@ -96,60 +89,60 @@ WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter, FLOAT32 *s
|
||||||
FLOAT32 attack_constant = peak_limiter->attack_constant;
|
FLOAT32 attack_constant = peak_limiter->attack_constant;
|
||||||
FLOAT32 release_constant = peak_limiter->release_constant;
|
FLOAT32 release_constant = peak_limiter->release_constant;
|
||||||
FLOAT32 limit_threshold = peak_limiter->limit_threshold;
|
FLOAT32 limit_threshold = peak_limiter->limit_threshold;
|
||||||
FLOAT32* max_buf = peak_limiter->max_buf;
|
FLOAT32 *max_buf = peak_limiter->max_buf;
|
||||||
FLOAT32 gain_modified = peak_limiter->gain_modified;
|
FLOAT32 gain_modified = peak_limiter->gain_modified;
|
||||||
FLOAT32* delayed_input = peak_limiter->delayed_input;
|
FLOAT32 *delayed_input = peak_limiter->delayed_input;
|
||||||
UWORD32 delayed_input_index = peak_limiter->delayed_input_index;
|
UWORD32 delayed_input_index = peak_limiter->delayed_input_index;
|
||||||
FLOAT64 pre_smoothed_gain = peak_limiter->pre_smoothed_gain;
|
FLOAT64 pre_smoothed_gain = peak_limiter->pre_smoothed_gain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (peak_limiter->limiter_on || (FLOAT32)pre_smoothed_gain < 1.0f) {
|
if (peak_limiter->limiter_on || (FLOAT32)pre_smoothed_gain < 1.0f) {
|
||||||
for (i = 0; i < frame_len; i++) {
|
for (i = 0; i < frame_len; i++) {
|
||||||
tmp =0.0f;
|
tmp = 0.0f;
|
||||||
for (j = 0; j < num_channels; j++) {
|
for (j = 0; j < num_channels; j++) {
|
||||||
tmp = max(tmp, (FLOAT32)fabs(samples[i * num_channels + j]));
|
tmp = max(tmp, (FLOAT32)fabs(samples[i * num_channels + j]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = attack_time_samples; j >0; j--) {
|
for (j = attack_time_samples; j > 0; j--) {
|
||||||
max_buf[j]=max_buf[j-1];
|
max_buf[j] = max_buf[j - 1];
|
||||||
}
|
}
|
||||||
max_buf[0] = tmp;
|
max_buf[0] = tmp;
|
||||||
sectionMaximum=tmp;
|
sectionMaximum = tmp;
|
||||||
for (j = 1; j < (attack_time_samples+1); j++) {
|
for (j = 1; j < (attack_time_samples + 1); j++) {
|
||||||
if (max_buf[j] > sectionMaximum)
|
if (max_buf[j] > sectionMaximum) sectionMaximum = max_buf[j];
|
||||||
sectionMaximum = max_buf[j];
|
|
||||||
}
|
}
|
||||||
maximum=sectionMaximum;
|
maximum = sectionMaximum;
|
||||||
|
|
||||||
if (maximum > limit_threshold) {
|
if (maximum > limit_threshold) {
|
||||||
gain = limit_threshold / maximum;
|
gain = limit_threshold / maximum;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
gain = 1;
|
gain = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gain < pre_smoothed_gain) {
|
if (gain < pre_smoothed_gain) {
|
||||||
gain_modified = min(gain_modified, (gain - 0.1f * (FLOAT32)pre_smoothed_gain) * 1.11111111f);
|
gain_modified =
|
||||||
}
|
min(gain_modified,
|
||||||
else {
|
(gain - 0.1f * (FLOAT32)pre_smoothed_gain) * 1.11111111f);
|
||||||
|
} else {
|
||||||
gain_modified = gain;
|
gain_modified = gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gain_modified < pre_smoothed_gain) {
|
if (gain_modified < pre_smoothed_gain) {
|
||||||
pre_smoothed_gain = attack_constant * (pre_smoothed_gain - gain_modified) + gain_modified;
|
pre_smoothed_gain =
|
||||||
|
attack_constant * (pre_smoothed_gain - gain_modified) +
|
||||||
|
gain_modified;
|
||||||
pre_smoothed_gain = max(pre_smoothed_gain, gain);
|
pre_smoothed_gain = max(pre_smoothed_gain, gain);
|
||||||
}
|
} else {
|
||||||
else {
|
pre_smoothed_gain =
|
||||||
pre_smoothed_gain = release_constant * (pre_smoothed_gain - gain_modified) + gain_modified;
|
release_constant * (pre_smoothed_gain - gain_modified) +
|
||||||
|
gain_modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
gain = (FLOAT32)pre_smoothed_gain;
|
gain = (FLOAT32)pre_smoothed_gain;
|
||||||
|
|
||||||
for (j = 0; j < num_channels; j++) {
|
for (j = 0; j < num_channels; j++) {
|
||||||
tmp = delayed_input[delayed_input_index * num_channels + j];
|
tmp = delayed_input[delayed_input_index * num_channels + j];
|
||||||
delayed_input[delayed_input_index * num_channels + j] = samples[i * num_channels + j];
|
delayed_input[delayed_input_index * num_channels + j] =
|
||||||
|
samples[i * num_channels + j];
|
||||||
|
|
||||||
tmp *= gain;
|
tmp *= gain;
|
||||||
if (tmp > limit_threshold)
|
if (tmp > limit_threshold)
|
||||||
|
|
@ -161,24 +154,21 @@ WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter, FLOAT32 *s
|
||||||
}
|
}
|
||||||
|
|
||||||
delayed_input_index++;
|
delayed_input_index++;
|
||||||
if (delayed_input_index >= attack_time_samples)
|
if (delayed_input_index >= attack_time_samples) delayed_input_index = 0;
|
||||||
delayed_input_index = 0;
|
|
||||||
|
|
||||||
if (gain < min_gain)
|
if (gain < min_gain) min_gain = gain;
|
||||||
min_gain = gain;
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (i = 0; i < frame_len; i++) {
|
for (i = 0; i < frame_len; i++) {
|
||||||
for (j = 0; j < num_channels; j++) {
|
for (j = 0; j < num_channels; j++) {
|
||||||
tmp = delayed_input[delayed_input_index * num_channels + j];
|
tmp = delayed_input[delayed_input_index * num_channels + j];
|
||||||
delayed_input[delayed_input_index * num_channels + j] = samples[i * num_channels + j];
|
delayed_input[delayed_input_index * num_channels + j] =
|
||||||
|
samples[i * num_channels + j];
|
||||||
samples[i * num_channels + j] = tmp;
|
samples[i * num_channels + j] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
delayed_input_index++;
|
delayed_input_index++;
|
||||||
if (delayed_input_index >= attack_time_samples)
|
if (delayed_input_index >= attack_time_samples) delayed_input_index = 0;
|
||||||
delayed_input_index = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,5 +179,3 @@ WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter, FLOAT32 *s
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,9 @@
|
||||||
#ifndef IMPD_DRC_PEAK_LIMITER_H
|
#ifndef IMPD_DRC_PEAK_LIMITER_H
|
||||||
#define IMPD_DRC_PEAK_LIMITER_H
|
#define IMPD_DRC_PEAK_LIMITER_H
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_ATTACK_TIME_MS (5.0f) /* default attack time in ms */
|
#define DEFAULT_ATTACK_TIME_MS (5.0f) /* default attack time in ms */
|
||||||
#define DEFAULT_RELEASE_TIME_MS (50.0f) /* default release time in ms */
|
#define DEFAULT_RELEASE_TIME_MS (50.0f) /* default release time in ms */
|
||||||
|
|
||||||
|
|
||||||
typedef struct ia_drc_peak_limiter_struct {
|
typedef struct ia_drc_peak_limiter_struct {
|
||||||
FLOAT32 attack_time;
|
FLOAT32 attack_time;
|
||||||
FLOAT32 release_time;
|
FLOAT32 release_time;
|
||||||
|
|
@ -37,21 +35,19 @@ typedef struct ia_drc_peak_limiter_struct {
|
||||||
UWORD32 limiter_on;
|
UWORD32 limiter_on;
|
||||||
FLOAT32 gain_modified;
|
FLOAT32 gain_modified;
|
||||||
FLOAT64 pre_smoothed_gain;
|
FLOAT64 pre_smoothed_gain;
|
||||||
FLOAT32* delayed_input;
|
FLOAT32 *delayed_input;
|
||||||
UWORD32 delayed_input_index;
|
UWORD32 delayed_input_index;
|
||||||
FLOAT32* max_buf;
|
FLOAT32 *max_buf;
|
||||||
FLOAT32 min_gain;
|
FLOAT32 min_gain;
|
||||||
FLOAT32* buffer;
|
FLOAT32 *buffer;
|
||||||
}ia_drc_peak_limiter_struct;
|
} ia_drc_peak_limiter_struct;
|
||||||
|
|
||||||
WORD32 impd_peak_limiter_init(ia_drc_peak_limiter_struct *peak_limiter,
|
WORD32 impd_peak_limiter_init(ia_drc_peak_limiter_struct *peak_limiter,
|
||||||
FLOAT32 attack_time,
|
FLOAT32 attack_time, FLOAT32 release_time,
|
||||||
FLOAT32 release_time,
|
FLOAT32 limit_threshold, UWORD32 num_channels,
|
||||||
FLOAT32 limit_threshold,
|
UWORD32 sample_rate, FLOAT32 *buffer);
|
||||||
UWORD32 num_channels,
|
|
||||||
UWORD32 sample_rate,
|
|
||||||
FLOAT32 *buffer);
|
|
||||||
|
|
||||||
WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter, FLOAT32 *samples, UWORD32 frame_len);
|
WORD32 impd_limiter_process(ia_drc_peak_limiter_struct *peak_limiter,
|
||||||
|
FLOAT32 *samples, UWORD32 frame_len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,9 @@
|
||||||
#ifndef IMPD_DRC_PEAK_LIMITER_STRUCT_H
|
#ifndef IMPD_DRC_PEAK_LIMITER_STRUCT_H
|
||||||
#define IMPD_DRC_PEAK_LIMITER_STRUCT_H
|
#define IMPD_DRC_PEAK_LIMITER_STRUCT_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_ATTACK_TIME_MS (5.0f) /* default attack time in ms */
|
#define DEFAULT_ATTACK_TIME_MS (5.0f) /* default attack time in ms */
|
||||||
#define DEFAULT_RELEASE_TIME_MS (50.0f) /* default release time in ms */
|
#define DEFAULT_RELEASE_TIME_MS (50.0f) /* default release time in ms */
|
||||||
|
|
||||||
|
|
||||||
typedef struct ia_drc_peak_limiter_struct {
|
typedef struct ia_drc_peak_limiter_struct {
|
||||||
FLOAT32 attack_time;
|
FLOAT32 attack_time;
|
||||||
FLOAT32 release_time;
|
FLOAT32 release_time;
|
||||||
|
|
@ -43,8 +40,6 @@ typedef struct ia_drc_peak_limiter_struct {
|
||||||
FLOAT32* max_buf;
|
FLOAT32* max_buf;
|
||||||
FLOAT32 min_gain;
|
FLOAT32 min_gain;
|
||||||
FLOAT32* buffer;
|
FLOAT32* buffer;
|
||||||
}ia_drc_peak_limiter_struct;
|
} ia_drc_peak_limiter_struct;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,14 @@
|
||||||
#include "impd_drc_gain_dec.h"
|
#include "impd_drc_gain_dec.h"
|
||||||
#include "impd_drc_process_audio.h"
|
#include "impd_drc_process_audio.h"
|
||||||
|
|
||||||
|
WORD32 impd_apply_gains_and_add(
|
||||||
WORD32 impd_apply_gains_and_add(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_gain_buffer_struct* pstr_gain_buf,
|
ia_gain_buffer_struct* pstr_gain_buf,
|
||||||
shape_filter_block shape_filter_block[],
|
shape_filter_block shape_filter_block[], FLOAT32* deinterleaved_audio[],
|
||||||
FLOAT32* deinterleaved_audio[],
|
|
||||||
|
|
||||||
FLOAT32* channel_audio[],
|
FLOAT32* channel_audio[], WORD32 impd_apply_gains) {
|
||||||
WORD32 impd_apply_gains)
|
|
||||||
{
|
|
||||||
WORD32 c, b, g, i;
|
WORD32 c, b, g, i;
|
||||||
WORD32 offset = 0, signalIndex = 0;
|
WORD32 offset = 0, signalIndex = 0;
|
||||||
WORD32 gainIndexForGroup[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 gainIndexForGroup[CHANNEL_GROUP_COUNT_MAX];
|
||||||
|
|
@ -50,93 +47,88 @@ WORD32 impd_apply_gains_and_add(ia_drc_instructions_struct* pstr_drc_instruction
|
||||||
FLOAT32 sum;
|
FLOAT32 sum;
|
||||||
FLOAT32 drc_gain_last, gainThr;
|
FLOAT32 drc_gain_last, gainThr;
|
||||||
WORD32 iEnd, iStart;
|
WORD32 iEnd, iStart;
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str = &(pstr_drc_instruction_arr[drc_instructions_index]);
|
ia_drc_instructions_struct* str_drc_instruction_str =
|
||||||
|
&(pstr_drc_instruction_arr[drc_instructions_index]);
|
||||||
|
|
||||||
if (drc_instructions_index >= 0)
|
if (drc_instructions_index >= 0) {
|
||||||
{
|
str_drc_instruction_str =
|
||||||
str_drc_instruction_str = &(pstr_drc_instruction_arr[drc_instructions_index]);
|
&(pstr_drc_instruction_arr[drc_instructions_index]);
|
||||||
{
|
|
||||||
if (str_drc_instruction_str->drc_set_id > 0)
|
|
||||||
{
|
|
||||||
if (ia_drc_params_struct->delay_mode == DELAY_MODE_LOW_DELAY)
|
|
||||||
{
|
{
|
||||||
|
if (str_drc_instruction_str->drc_set_id > 0) {
|
||||||
|
if (ia_drc_params_struct->delay_mode == DELAY_MODE_LOW_DELAY) {
|
||||||
offset = ia_drc_params_struct->drc_frame_size;
|
offset = ia_drc_params_struct->drc_frame_size;
|
||||||
}
|
}
|
||||||
gainIndexForGroup[0] = 0;
|
gainIndexForGroup[0] = 0;
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups-1; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups - 1; g++) {
|
||||||
{
|
gainIndexForGroup[g + 1] =
|
||||||
gainIndexForGroup[g+1] = gainIndexForGroup[g] + str_drc_instruction_str->band_count_of_ch_group[g];
|
gainIndexForGroup[g] +
|
||||||
|
str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
}
|
}
|
||||||
signalIndexForChannel[0] = 0;
|
signalIndexForChannel[0] = 0;
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan-1; c++)
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan - 1; c++) {
|
||||||
{
|
if (str_drc_instruction_str->channel_group_of_ch[c] >= 0) {
|
||||||
if (str_drc_instruction_str->channel_group_of_ch[c] >= 0)
|
signalIndexForChannel[c + 1] =
|
||||||
{
|
signalIndexForChannel[c] +
|
||||||
signalIndexForChannel[c+1] = signalIndexForChannel[c] + str_drc_instruction_str->band_count_of_ch_group[str_drc_instruction_str->channel_group_of_ch[c]];
|
str_drc_instruction_str->band_count_of_ch_group
|
||||||
}
|
[str_drc_instruction_str->channel_group_of_ch[c]];
|
||||||
else
|
} else {
|
||||||
{
|
signalIndexForChannel[c + 1] = signalIndexForChannel[c] + 1;
|
||||||
signalIndexForChannel[c+1] = signalIndexForChannel[c] + 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups; g++) {
|
||||||
{
|
for (b = 0; b < str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
for (b=0; b<str_drc_instruction_str->band_count_of_ch_group[g]; b++)
|
b++) {
|
||||||
{
|
|
||||||
if (str_drc_instruction_str->ch_group_parametric_drc_flag[g] == 0) {
|
if (str_drc_instruction_str->ch_group_parametric_drc_flag[g] == 0) {
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]+b].lpcm_gains + MAX_SIGNAL_DELAY - ia_drc_params_struct->gain_delay_samples - ia_drc_params_struct->audio_delay_samples + offset;
|
lpcm_gains =
|
||||||
|
pstr_gain_buf->buf_interpolation[gainIndexForGroup[g] + b]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY - ia_drc_params_struct->gain_delay_samples -
|
||||||
|
ia_drc_params_struct->audio_delay_samples + offset;
|
||||||
} else {
|
} else {
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]+b].lpcm_gains + MAX_SIGNAL_DELAY + str_drc_instruction_str->parametric_drc_look_ahead_samples[g] - ia_drc_params_struct->audio_delay_samples;
|
lpcm_gains =
|
||||||
|
pstr_gain_buf->buf_interpolation[gainIndexForGroup[g] + b]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY +
|
||||||
|
str_drc_instruction_str
|
||||||
|
->parametric_drc_look_ahead_samples[g] -
|
||||||
|
ia_drc_params_struct->audio_delay_samples;
|
||||||
}
|
}
|
||||||
iEnd = 0;
|
iEnd = 0;
|
||||||
iStart = 0;
|
iStart = 0;
|
||||||
while (iEnd < ia_drc_params_struct->drc_frame_size)
|
while (iEnd < ia_drc_params_struct->drc_frame_size) {
|
||||||
{
|
|
||||||
if (shape_filter_block[g].shape_flter_block_flag) {
|
if (shape_filter_block[g].shape_flter_block_flag) {
|
||||||
drc_gain_last = shape_filter_block[g].drc_gain_last;
|
drc_gain_last = shape_filter_block[g].drc_gain_last;
|
||||||
gainThr = 0.0001f * drc_gain_last;
|
gainThr = 0.0001f * drc_gain_last;
|
||||||
while ((iEnd<ia_drc_params_struct->drc_frame_size) && (fabs(lpcm_gains[iEnd] - drc_gain_last) <= gainThr)) iEnd++;
|
while ((iEnd < ia_drc_params_struct->drc_frame_size) &&
|
||||||
}
|
(fabs(lpcm_gains[iEnd] - drc_gain_last) <= gainThr))
|
||||||
else
|
iEnd++;
|
||||||
{
|
} else {
|
||||||
iEnd = ia_drc_params_struct->drc_frame_size;
|
iEnd = ia_drc_params_struct->drc_frame_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (g == str_drc_instruction_str->channel_group_of_ch[c])
|
if (g == str_drc_instruction_str->channel_group_of_ch[c]) {
|
||||||
{
|
|
||||||
signalIndex = signalIndexForChannel[c] + b;
|
signalIndex = signalIndexForChannel[c] + b;
|
||||||
|
|
||||||
if(impd_apply_gains == 1) {
|
if (impd_apply_gains == 1) {
|
||||||
|
impd_shape_filt_block_time_process(
|
||||||
|
&shape_filter_block[g], &lpcm_gains[0], signalIndex,
|
||||||
|
&deinterleaved_audio[signalIndex][0], iStart, iEnd);
|
||||||
|
|
||||||
impd_shape_filt_block_time_process(&shape_filter_block[g],
|
} else {
|
||||||
&lpcm_gains[0],
|
for (i = iStart; i < iEnd; i++) {
|
||||||
signalIndex,
|
|
||||||
&deinterleaved_audio[signalIndex][0],
|
|
||||||
iStart,
|
|
||||||
iEnd);
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (i=iStart; i<iEnd; i++){
|
|
||||||
deinterleaved_audio[signalIndex][i] = lpcm_gains[i];
|
deinterleaved_audio[signalIndex][i] = lpcm_gains[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((iEnd < ia_drc_params_struct->drc_frame_size) && (shape_filter_block[g].shape_flter_block_flag))
|
if ((iEnd < ia_drc_params_struct->drc_frame_size) &&
|
||||||
{
|
(shape_filter_block[g].shape_flter_block_flag)) {
|
||||||
impd_shape_filt_block_adapt(lpcm_gains[iEnd], &shape_filter_block[g]);
|
impd_shape_filt_block_adapt(lpcm_gains[iEnd],
|
||||||
|
&shape_filter_block[g]);
|
||||||
}
|
}
|
||||||
iStart = iEnd;
|
iStart = iEnd;
|
||||||
}
|
}
|
||||||
|
|
@ -146,77 +138,47 @@ WORD32 impd_apply_gains_and_add(ia_drc_instructions_struct* pstr_drc_instruction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signalIndex=0;
|
signalIndex = 0;
|
||||||
|
|
||||||
if (str_drc_instruction_str->drc_set_id > 0)
|
if (str_drc_instruction_str->drc_set_id > 0) {
|
||||||
{
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
g = str_drc_instruction_str->channel_group_of_ch[c];
|
g = str_drc_instruction_str->channel_group_of_ch[c];
|
||||||
if (g>=0)
|
if (g >= 0) {
|
||||||
{
|
for (i = 0; i < ia_drc_params_struct->drc_frame_size; i++) {
|
||||||
for (i=0; i<ia_drc_params_struct->drc_frame_size; i++)
|
|
||||||
{
|
|
||||||
sum = 0.0f;
|
sum = 0.0f;
|
||||||
for (b=0; b<str_drc_instruction_str->band_count_of_ch_group[g]; b++)
|
for (b = 0; b < str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
{
|
b++) {
|
||||||
sum += deinterleaved_audio[signalIndex+b][i];
|
sum += deinterleaved_audio[signalIndex + b][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_audio[c][i] = sum;
|
channel_audio[c][i] = sum;
|
||||||
|
|
||||||
}
|
}
|
||||||
signalIndex += str_drc_instruction_str->band_count_of_ch_group[g];
|
signalIndex += str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
}
|
} else {
|
||||||
else
|
for (i = 0; i < ia_drc_params_struct->drc_frame_size; i++) {
|
||||||
{
|
|
||||||
for (i=0; i<ia_drc_params_struct->drc_frame_size; i++)
|
|
||||||
{
|
|
||||||
channel_audio[c][i] = deinterleaved_audio[signalIndex][i];
|
channel_audio[c][i] = deinterleaved_audio[signalIndex][i];
|
||||||
}
|
}
|
||||||
signalIndex++;
|
signalIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
{
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
for (i=0; i<ia_drc_params_struct->drc_frame_size; i++)
|
for (i = 0; i < ia_drc_params_struct->drc_frame_size; i++) {
|
||||||
{
|
|
||||||
channel_audio[c][i] = deinterleaved_audio[c][i];
|
channel_audio[c][i] = deinterleaved_audio[c][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* subband-domain DRC: in-place application of DRC gains to audio frame */
|
/* subband-domain DRC: in-place application of DRC gains to audio frame */
|
||||||
WORD32
|
WORD32
|
||||||
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
ia_drc_params_struct* ia_drc_params_struct,
|
||||||
ia_gain_buffer_struct* pstr_gain_buf,
|
ia_gain_buffer_struct* pstr_gain_buf,
|
||||||
|
|
@ -224,8 +186,7 @@ WORD32
|
||||||
FLOAT32* deinterleaved_audio_delayed_re[],
|
FLOAT32* deinterleaved_audio_delayed_re[],
|
||||||
FLOAT32* deinterleaved_audio_delayed_im[],
|
FLOAT32* deinterleaved_audio_delayed_im[],
|
||||||
FLOAT32* deinterleaved_audio_re[],
|
FLOAT32* deinterleaved_audio_re[],
|
||||||
FLOAT32* deinterleaved_audio_im[])
|
FLOAT32* deinterleaved_audio_im[]) {
|
||||||
{
|
|
||||||
WORD32 c, b, g, m, s;
|
WORD32 c, b, g, m, s;
|
||||||
WORD32 gainIndexForGroup[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 gainIndexForGroup[CHANNEL_GROUP_COUNT_MAX];
|
||||||
FLOAT32* lpcm_gains;
|
FLOAT32* lpcm_gains;
|
||||||
|
|
@ -256,73 +217,130 @@ WORD32
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
drc_frame_sizeSb = ia_drc_params_struct->drc_frame_size/L;
|
drc_frame_sizeSb = ia_drc_params_struct->drc_frame_size / L;
|
||||||
|
|
||||||
if (drc_instructions_index >= 0)
|
if (drc_instructions_index >= 0) {
|
||||||
{
|
str_drc_instruction_str =
|
||||||
str_drc_instruction_str = &(pstr_drc_instruction_arr[drc_instructions_index]);
|
&(pstr_drc_instruction_arr[drc_instructions_index]);
|
||||||
{
|
|
||||||
if (str_drc_instruction_str->drc_set_id > 0)
|
|
||||||
{
|
|
||||||
if (ia_drc_params_struct->delay_mode == DELAY_MODE_LOW_DELAY)
|
|
||||||
{
|
{
|
||||||
|
if (str_drc_instruction_str->drc_set_id > 0) {
|
||||||
|
if (ia_drc_params_struct->delay_mode == DELAY_MODE_LOW_DELAY) {
|
||||||
offset = ia_drc_params_struct->drc_frame_size;
|
offset = ia_drc_params_struct->drc_frame_size;
|
||||||
}
|
}
|
||||||
gainIndexForGroup[0] = 0;
|
gainIndexForGroup[0] = 0;
|
||||||
for (g=0; g<str_drc_instruction_str->num_drc_ch_groups-1; g++)
|
for (g = 0; g < str_drc_instruction_str->num_drc_ch_groups - 1; g++) {
|
||||||
{
|
gainIndexForGroup[g + 1] =
|
||||||
gainIndexForGroup[g+1] = gainIndexForGroup[g] + str_drc_instruction_str->band_count_of_ch_group[g]; /* index of first gain sequence in channel group */
|
gainIndexForGroup[g] +
|
||||||
|
str_drc_instruction_str
|
||||||
|
->band_count_of_ch_group[g]; /* index of first gain sequence
|
||||||
|
in channel group */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
g = str_drc_instruction_str->channel_group_of_ch[c];
|
g = str_drc_instruction_str->channel_group_of_ch[c];
|
||||||
if (g>=0)
|
if (g >= 0) {
|
||||||
{
|
for (m = 0; m < drc_frame_sizeSb; m++) {
|
||||||
for (m=0; m<drc_frame_sizeSb; m++)
|
if (str_drc_instruction_str->band_count_of_ch_group[g] >
|
||||||
{
|
1) { /* multiband DRC */
|
||||||
if (str_drc_instruction_str->band_count_of_ch_group[g] > 1)
|
for (s = 0; s < nDecoderSubbands; s++) {
|
||||||
{ /* multiband DRC */
|
|
||||||
for (s=0; s<nDecoderSubbands; s++)
|
|
||||||
{
|
|
||||||
gainSb = 0.0f;
|
gainSb = 0.0f;
|
||||||
for (b=0; b<str_drc_instruction_str->band_count_of_ch_group[g]; b++)
|
for (b = 0;
|
||||||
{
|
b < str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
if (str_drc_instruction_str->ch_group_parametric_drc_flag[g] == 0) {
|
b++) {
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]+b].lpcm_gains + MAX_SIGNAL_DELAY - ia_drc_params_struct->gain_delay_samples - ia_drc_params_struct->audio_delay_samples + offset;
|
if (str_drc_instruction_str
|
||||||
|
->ch_group_parametric_drc_flag[g] == 0) {
|
||||||
|
lpcm_gains =
|
||||||
|
pstr_gain_buf
|
||||||
|
->buf_interpolation[gainIndexForGroup[g] + b]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY -
|
||||||
|
ia_drc_params_struct->gain_delay_samples -
|
||||||
|
ia_drc_params_struct->audio_delay_samples + offset;
|
||||||
} else {
|
} else {
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]+b].lpcm_gains + MAX_SIGNAL_DELAY + str_drc_instruction_str->parametric_drc_look_ahead_samples[g] - ia_drc_params_struct->audio_delay_samples + analysisDelay;
|
lpcm_gains =
|
||||||
|
pstr_gain_buf
|
||||||
|
->buf_interpolation[gainIndexForGroup[g] + b]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY +
|
||||||
|
str_drc_instruction_str
|
||||||
|
->parametric_drc_look_ahead_samples[g] -
|
||||||
|
ia_drc_params_struct->audio_delay_samples +
|
||||||
|
analysisDelay;
|
||||||
}
|
}
|
||||||
/* get gain for this timeslot by downsampling */
|
/* get gain for this timeslot by downsampling */
|
||||||
gainLr = lpcm_gains[(m*L+(L-1)/2)];
|
gainLr = lpcm_gains[(m * L + (L - 1) / 2)];
|
||||||
gainSb += pstr_overlap_params->str_group_overlap_params[g].str_band_overlap_params[b].overlap_weight[s] * gainLr;
|
gainSb += pstr_overlap_params->str_group_overlap_params[g]
|
||||||
|
.str_band_overlap_params[b]
|
||||||
|
.overlap_weight[s] *
|
||||||
|
gainLr;
|
||||||
}
|
}
|
||||||
deinterleaved_audio_re[signalIndex][m*nDecoderSubbands+s] = gainSb * deinterleaved_audio_delayed_re[signalIndex][m*nDecoderSubbands+s];
|
deinterleaved_audio_re[signalIndex][m * nDecoderSubbands +
|
||||||
if (ia_drc_params_struct->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_STFT256) { /* For STFT filterbank, the real value of the nyquist band is stored at the imag value of the first band */
|
s] =
|
||||||
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_re[signalIndex]
|
||||||
|
[m * nDecoderSubbands + s];
|
||||||
|
if (ia_drc_params_struct->sub_band_domain_mode ==
|
||||||
|
SUBBAND_DOMAIN_MODE_STFT256) { /* For STFT filterbank, the
|
||||||
|
real value of the
|
||||||
|
nyquist band is stored
|
||||||
|
at the imag value of the
|
||||||
|
first band */
|
||||||
if (s != 0)
|
if (s != 0)
|
||||||
deinterleaved_audio_im[signalIndex][m*nDecoderSubbands+s] = gainSb * deinterleaved_audio_delayed_im[signalIndex][m*nDecoderSubbands+s];
|
deinterleaved_audio_im[signalIndex][m * nDecoderSubbands +
|
||||||
if (s == (nDecoderSubbands-1))
|
s] =
|
||||||
deinterleaved_audio_im[signalIndex][m*nDecoderSubbands+0] = gainSb * deinterleaved_audio_delayed_im[signalIndex][m*nDecoderSubbands+0];
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_im[signalIndex]
|
||||||
|
[m * nDecoderSubbands +
|
||||||
|
s];
|
||||||
|
if (s == (nDecoderSubbands - 1))
|
||||||
|
deinterleaved_audio_im[signalIndex][m * nDecoderSubbands +
|
||||||
|
0] =
|
||||||
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_im[signalIndex]
|
||||||
|
[m * nDecoderSubbands +
|
||||||
|
0];
|
||||||
} else {
|
} else {
|
||||||
deinterleaved_audio_im[signalIndex][m*nDecoderSubbands+s] = gainSb * deinterleaved_audio_delayed_im[signalIndex][m*nDecoderSubbands+s];
|
deinterleaved_audio_im[signalIndex][m * nDecoderSubbands +
|
||||||
|
s] =
|
||||||
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_im[signalIndex]
|
||||||
|
[m * nDecoderSubbands +
|
||||||
|
s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else { /* single-band DRC */
|
||||||
else
|
if (str_drc_instruction_str->ch_group_parametric_drc_flag[g] ==
|
||||||
{ /* single-band DRC */
|
0) {
|
||||||
if (str_drc_instruction_str->ch_group_parametric_drc_flag[g] == 0) {
|
lpcm_gains =
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]].lpcm_gains + MAX_SIGNAL_DELAY - ia_drc_params_struct->gain_delay_samples - ia_drc_params_struct->audio_delay_samples + offset;
|
pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY -
|
||||||
|
ia_drc_params_struct->gain_delay_samples -
|
||||||
|
ia_drc_params_struct->audio_delay_samples + offset;
|
||||||
} else {
|
} else {
|
||||||
lpcm_gains = pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]].lpcm_gains + MAX_SIGNAL_DELAY + str_drc_instruction_str->parametric_drc_look_ahead_samples[g] - ia_drc_params_struct->audio_delay_samples + analysisDelay;
|
lpcm_gains =
|
||||||
|
pstr_gain_buf->buf_interpolation[gainIndexForGroup[g]]
|
||||||
|
.lpcm_gains +
|
||||||
|
MAX_SIGNAL_DELAY +
|
||||||
|
str_drc_instruction_str
|
||||||
|
->parametric_drc_look_ahead_samples[g] -
|
||||||
|
ia_drc_params_struct->audio_delay_samples + analysisDelay;
|
||||||
}
|
}
|
||||||
/* get gain for this timeslot by downsampling */
|
/* get gain for this timeslot by downsampling */
|
||||||
gainSb = lpcm_gains[(m*L+(L-1)/2)];
|
gainSb = lpcm_gains[(m * L + (L - 1) / 2)];
|
||||||
for (s=0; s<nDecoderSubbands; s++)
|
for (s = 0; s < nDecoderSubbands; s++) {
|
||||||
{
|
deinterleaved_audio_re[signalIndex][m * nDecoderSubbands +
|
||||||
deinterleaved_audio_re[signalIndex][m*nDecoderSubbands+s] = gainSb * deinterleaved_audio_delayed_re[signalIndex][m*nDecoderSubbands+s];
|
s] =
|
||||||
deinterleaved_audio_im[signalIndex][m*nDecoderSubbands+s] = gainSb * deinterleaved_audio_delayed_im[signalIndex][m*nDecoderSubbands+s];
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_re[signalIndex]
|
||||||
|
[m * nDecoderSubbands + s];
|
||||||
|
deinterleaved_audio_im[signalIndex][m * nDecoderSubbands +
|
||||||
|
s] =
|
||||||
|
gainSb *
|
||||||
|
deinterleaved_audio_delayed_im[signalIndex]
|
||||||
|
[m * nDecoderSubbands + s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -342,10 +360,9 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
FLOAT32* audio_io_buf[],
|
FLOAT32* audio_io_buf[],
|
||||||
ia_audio_band_buffer_struct* audio_band_buffer,
|
ia_audio_band_buffer_struct* audio_band_buffer,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
ia_filter_banks_struct* ia_filter_banks_struct,
|
||||||
const WORD32 passThru)
|
const WORD32 passThru) {
|
||||||
{
|
|
||||||
WORD32 c, g, e, i, num_bands;
|
WORD32 c, g, e, i, num_bands;
|
||||||
//WORD32 err = 0;
|
// WORD32 err = 0;
|
||||||
FLOAT32* audio_in;
|
FLOAT32* audio_in;
|
||||||
FLOAT32** audio_out;
|
FLOAT32** audio_out;
|
||||||
ia_drc_filter_bank_struct* str_drc_filter_bank;
|
ia_drc_filter_bank_struct* str_drc_filter_bank;
|
||||||
|
|
@ -353,14 +370,15 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
WORD32 drc_frame_size = ia_drc_params_struct->drc_frame_size;
|
WORD32 drc_frame_size = ia_drc_params_struct->drc_frame_size;
|
||||||
|
|
||||||
if (drc_instructions_index >= 0) {
|
if (drc_instructions_index >= 0) {
|
||||||
str_drc_instruction_str = &(pstr_drc_instruction_arr[drc_instructions_index]);
|
str_drc_instruction_str =
|
||||||
|
&(pstr_drc_instruction_arr[drc_instructions_index]);
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
e=0;
|
e = 0;
|
||||||
|
|
||||||
for (c=0; c<str_drc_instruction_str->audio_num_chan; c++)
|
for (c = 0; c < str_drc_instruction_str->audio_num_chan; c++)
|
||||||
|
|
||||||
{
|
{
|
||||||
str_drc_filter_bank = NULL;
|
str_drc_filter_bank = NULL;
|
||||||
|
|
@ -368,75 +386,62 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
audio_in = audio_io_buf[c];
|
audio_in = audio_io_buf[c];
|
||||||
|
|
||||||
audio_out = &(audio_band_buffer->non_interleaved_audio[e]);
|
audio_out = &(audio_band_buffer->non_interleaved_audio[e]);
|
||||||
if ((passThru == 0) && (drc_instructions_index >= 0))
|
if ((passThru == 0) && (drc_instructions_index >= 0)) {
|
||||||
{
|
if (str_drc_instruction_str->drc_set_id < 0) {
|
||||||
if (str_drc_instruction_str->drc_set_id < 0)
|
|
||||||
{
|
|
||||||
num_bands = 1;
|
num_bands = 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
g = str_drc_instruction_str->channel_group_of_ch[c];
|
g = str_drc_instruction_str->channel_group_of_ch[c];
|
||||||
if (g== -1)
|
if (g == -1) {
|
||||||
{
|
|
||||||
num_bands = 1;
|
num_bands = 1;
|
||||||
//if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
// if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
||||||
//{
|
//{
|
||||||
str_drc_filter_bank = &(ia_filter_banks_struct->str_drc_filter_bank[str_drc_instruction_str->num_drc_ch_groups]);
|
str_drc_filter_bank =
|
||||||
|
&(ia_filter_banks_struct->str_drc_filter_bank
|
||||||
|
[str_drc_instruction_str->num_drc_ch_groups]);
|
||||||
//}
|
//}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
num_bands = str_drc_instruction_str->band_count_of_ch_group[g];
|
num_bands = str_drc_instruction_str->band_count_of_ch_group[g];
|
||||||
//if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
// if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
||||||
//{
|
//{
|
||||||
str_drc_filter_bank = &(ia_filter_banks_struct->str_drc_filter_bank[g]);
|
str_drc_filter_bank =
|
||||||
|
&(ia_filter_banks_struct->str_drc_filter_bank[g]);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
//if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
// if (ia_filter_banks_struct->str_drc_filter_bank != NULL)
|
||||||
//{
|
//{
|
||||||
//if (&str_drc_filter_bank->str_all_pass_cascade != NULL)
|
// if (&str_drc_filter_bank->str_all_pass_cascade != NULL)
|
||||||
//{
|
//{
|
||||||
impd_all_pass_cascade_process(&str_drc_filter_bank->str_all_pass_cascade, c, drc_frame_size, audio_in);
|
impd_all_pass_cascade_process(
|
||||||
|
&str_drc_filter_bank->str_all_pass_cascade, c, drc_frame_size,
|
||||||
|
audio_in);
|
||||||
//}
|
//}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
num_bands = 1;
|
num_bands = 1;
|
||||||
}
|
}
|
||||||
switch (num_bands) {
|
switch (num_bands) {
|
||||||
case 1:
|
case 1:
|
||||||
for (i=0; i<drc_frame_size; i++)
|
for (i = 0; i < drc_frame_size; i++) {
|
||||||
{
|
|
||||||
audio_out[0][i] = audio_in[i];
|
audio_out[0][i] = audio_in[i];
|
||||||
}
|
}
|
||||||
e++;
|
e++;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
impd_two_band_filter_process(&str_drc_filter_bank->str_two_band_bank,
|
impd_two_band_filter_process(&str_drc_filter_bank->str_two_band_bank, c,
|
||||||
c,
|
drc_frame_size, audio_in, audio_out);
|
||||||
drc_frame_size,
|
e += 2;
|
||||||
audio_in,
|
|
||||||
audio_out);
|
|
||||||
e+=2;
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
impd_three_band_filter_process(&str_drc_filter_bank->str_three_band_bank,
|
impd_three_band_filter_process(
|
||||||
c,
|
&str_drc_filter_bank->str_three_band_bank, c, drc_frame_size,
|
||||||
drc_frame_size,
|
audio_in, audio_out);
|
||||||
audio_in,
|
e += 3;
|
||||||
audio_out);
|
|
||||||
e+=3;
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
impd_four_band_filter_process(&str_drc_filter_bank->str_four_band_bank,
|
impd_four_band_filter_process(&str_drc_filter_bank->str_four_band_bank,
|
||||||
c,
|
c, drc_frame_size, audio_in, audio_out);
|
||||||
drc_frame_size,
|
e += 4;
|
||||||
audio_in,
|
|
||||||
audio_out);
|
|
||||||
e+=4;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (PARAM_ERROR);
|
return (PARAM_ERROR);
|
||||||
|
|
@ -447,18 +452,17 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_store_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
impd_store_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
||||||
ia_audio_in_out_buf* audio_io_buf_internal)
|
ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
WORD32 i, j;
|
||||||
WORD32 i,j;
|
|
||||||
|
|
||||||
if (audio_io_buf_internal->audio_delay_samples) {
|
if (audio_io_buf_internal->audio_delay_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
for (j=0; j<audio_io_buf_internal->frame_size; j++) {
|
for (j = 0; j < audio_io_buf_internal->frame_size; j++) {
|
||||||
audio_io_buf_internal->audio_io_buffer_delayed[i][audio_io_buf_internal->audio_delay_samples+j] = audio_in_out_buf[i][j];
|
audio_io_buf_internal->audio_io_buffer_delayed
|
||||||
|
[i][audio_io_buf_internal->audio_delay_samples + j] =
|
||||||
|
audio_in_out_buf[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -472,15 +476,22 @@ impd_store_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
||||||
WORD32
|
WORD32
|
||||||
impd_store_audio_io_buffer_freq(FLOAT32* audio_real_buff[],
|
impd_store_audio_io_buffer_freq(FLOAT32* audio_real_buff[],
|
||||||
FLOAT32* audio_imag_buff[],
|
FLOAT32* audio_imag_buff[],
|
||||||
ia_audio_in_out_buf* audio_io_buf_internal)
|
ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
WORD32 i, j;
|
||||||
WORD32 i,j;
|
|
||||||
|
|
||||||
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
for (j=0; j<audio_io_buf_internal->audio_sub_band_frame_size*audio_io_buf_internal->audio_sub_band_count; j++) {
|
for (j = 0; j < audio_io_buf_internal->audio_sub_band_frame_size *
|
||||||
audio_io_buf_internal->audio_buffer_delayed_real[i][audio_io_buf_internal->audio_delay_sub_band_samples*audio_io_buf_internal->audio_sub_band_count+j] = audio_real_buff[i][j];
|
audio_io_buf_internal->audio_sub_band_count;
|
||||||
audio_io_buf_internal->audio_buffer_delayed_imag[i][audio_io_buf_internal->audio_delay_sub_band_samples*audio_io_buf_internal->audio_sub_band_count+j] = audio_imag_buff[i][j];
|
j++) {
|
||||||
|
audio_io_buf_internal->audio_buffer_delayed_real
|
||||||
|
[i][audio_io_buf_internal->audio_delay_sub_band_samples *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count +
|
||||||
|
j] = audio_real_buff[i][j];
|
||||||
|
audio_io_buf_internal->audio_buffer_delayed_imag
|
||||||
|
[i][audio_io_buf_internal->audio_delay_sub_band_samples *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count +
|
||||||
|
j] = audio_imag_buff[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -495,14 +506,14 @@ impd_store_audio_io_buffer_freq(FLOAT32* audio_real_buff[],
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_retrieve_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
impd_retrieve_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
||||||
ia_audio_in_out_buf* audio_io_buf_internal)
|
ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
WORD32 i, j;
|
||||||
WORD32 i,j;
|
|
||||||
|
|
||||||
if (audio_io_buf_internal->audio_delay_samples) {
|
if (audio_io_buf_internal->audio_delay_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
for (j=0; j<audio_io_buf_internal->frame_size; j++) {
|
for (j = 0; j < audio_io_buf_internal->frame_size; j++) {
|
||||||
audio_in_out_buf[i][j] = audio_io_buf_internal->audio_io_buffer_delayed[i][j];
|
audio_in_out_buf[i][j] =
|
||||||
|
audio_io_buf_internal->audio_io_buffer_delayed[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -513,15 +524,20 @@ impd_retrieve_audio_io_buffer_time(FLOAT32* audio_in_out_buf[],
|
||||||
WORD32
|
WORD32
|
||||||
impd_retrieve_audio_buffer_freq(FLOAT32* audio_real_buff[],
|
impd_retrieve_audio_buffer_freq(FLOAT32* audio_real_buff[],
|
||||||
FLOAT32* audio_imag_buff[],
|
FLOAT32* audio_imag_buff[],
|
||||||
ia_audio_in_out_buf* audio_io_buf_internal)
|
ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
WORD32 i, j;
|
||||||
WORD32 i,j;
|
|
||||||
|
|
||||||
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
for (j=0; j<audio_io_buf_internal->audio_sub_band_frame_size*audio_io_buf_internal->audio_sub_band_count; j++) {
|
for (j = 0; j < audio_io_buf_internal->audio_sub_band_frame_size *
|
||||||
audio_real_buff[i][j] = audio_io_buf_internal->audio_buffer_delayed_real[i][audio_io_buf_internal->audio_sub_band_count+j];
|
audio_io_buf_internal->audio_sub_band_count;
|
||||||
audio_imag_buff[i][j] = audio_io_buf_internal->audio_buffer_delayed_imag[i][audio_io_buf_internal->audio_sub_band_count+j];
|
j++) {
|
||||||
|
audio_real_buff[i][j] =
|
||||||
|
audio_io_buf_internal->audio_buffer_delayed_real
|
||||||
|
[i][audio_io_buf_internal->audio_sub_band_count + j];
|
||||||
|
audio_imag_buff[i][j] =
|
||||||
|
audio_io_buf_internal->audio_buffer_delayed_imag
|
||||||
|
[i][audio_io_buf_internal->audio_sub_band_count + j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -530,12 +546,15 @@ impd_retrieve_audio_buffer_freq(FLOAT32* audio_real_buff[],
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_advance_audio_io_buffer_time(ia_audio_in_out_buf* audio_io_buf_internal)
|
impd_advance_audio_io_buffer_time(ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
if (audio_io_buf_internal->audio_delay_samples) {
|
if (audio_io_buf_internal->audio_delay_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
memmove(audio_io_buf_internal->audio_io_buffer_delayed[i], &audio_io_buf_internal->audio_io_buffer_delayed[i][audio_io_buf_internal->frame_size],sizeof(FLOAT32) * audio_io_buf_internal->audio_delay_samples);
|
memmove(
|
||||||
|
audio_io_buf_internal->audio_io_buffer_delayed[i],
|
||||||
|
&audio_io_buf_internal
|
||||||
|
->audio_io_buffer_delayed[i][audio_io_buf_internal->frame_size],
|
||||||
|
sizeof(FLOAT32) * audio_io_buf_internal->audio_delay_samples);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -543,15 +562,25 @@ impd_advance_audio_io_buffer_time(ia_audio_in_out_buf* audio_io_buf_internal)
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_advance_audio_buff_freq(ia_audio_in_out_buf* audio_io_buf_internal)
|
impd_advance_audio_buff_freq(ia_audio_in_out_buf* audio_io_buf_internal) {
|
||||||
{
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
if (audio_io_buf_internal->audio_delay_sub_band_samples) {
|
||||||
for (i=0; i<audio_io_buf_internal->audio_num_chan; i++) {
|
for (i = 0; i < audio_io_buf_internal->audio_num_chan; i++) {
|
||||||
memmove(audio_io_buf_internal->audio_buffer_delayed_real[i], &audio_io_buf_internal->audio_buffer_delayed_real[i][audio_io_buf_internal->audio_sub_band_frame_size * audio_io_buf_internal->audio_sub_band_count],sizeof(FLOAT32) * audio_io_buf_internal->audio_delay_sub_band_samples * audio_io_buf_internal->audio_sub_band_count);
|
memmove(audio_io_buf_internal->audio_buffer_delayed_real[i],
|
||||||
memmove(audio_io_buf_internal->audio_buffer_delayed_imag[i], &audio_io_buf_internal->audio_buffer_delayed_imag[i][audio_io_buf_internal->audio_sub_band_frame_size * audio_io_buf_internal->audio_sub_band_count],sizeof(FLOAT32) * audio_io_buf_internal->audio_delay_sub_band_samples * audio_io_buf_internal->audio_sub_band_count);
|
&audio_io_buf_internal->audio_buffer_delayed_real
|
||||||
|
[i][audio_io_buf_internal->audio_sub_band_frame_size *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count],
|
||||||
|
sizeof(FLOAT32) *
|
||||||
|
audio_io_buf_internal->audio_delay_sub_band_samples *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count);
|
||||||
|
memmove(audio_io_buf_internal->audio_buffer_delayed_imag[i],
|
||||||
|
&audio_io_buf_internal->audio_buffer_delayed_imag
|
||||||
|
[i][audio_io_buf_internal->audio_sub_band_frame_size *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count],
|
||||||
|
sizeof(FLOAT32) *
|
||||||
|
audio_io_buf_internal->audio_delay_sub_band_samples *
|
||||||
|
audio_io_buf_internal->audio_sub_band_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@
|
||||||
#define IMPD_DRC_PROCESS_AUDIO_H
|
#define IMPD_DRC_PROCESS_AUDIO_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -46,7 +45,6 @@ typedef struct {
|
||||||
FLOAT32** audio_imag_buff;
|
FLOAT32** audio_imag_buff;
|
||||||
} ia_audio_in_out_buf;
|
} ia_audio_in_out_buf;
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
|
|
@ -58,7 +56,6 @@ impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
FLOAT32* deinterleaved_audio_re[],
|
FLOAT32* deinterleaved_audio_re[],
|
||||||
FLOAT32* deinterleaved_audio_im[]);
|
FLOAT32* deinterleaved_audio_im[]);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
|
|
|
||||||
|
|
@ -20,21 +20,17 @@
|
||||||
#ifndef IMPD_DRC_QMF_FILTER_H
|
#ifndef IMPD_DRC_QMF_FILTER_H
|
||||||
#define IMPD_DRC_QMF_FILTER_H
|
#define IMPD_DRC_QMF_FILTER_H
|
||||||
|
|
||||||
|
|
||||||
#define QMF_NUM_FILT_BANDS 64
|
#define QMF_NUM_FILT_BANDS 64
|
||||||
#define QMF_FILT_RESOLUTION 64
|
#define QMF_FILT_RESOLUTION 64
|
||||||
|
|
||||||
|
typedef struct ia_drc_qmf_filt_struct {
|
||||||
|
FLOAT64* ana_buff;
|
||||||
|
FLOAT64* syn_buff;
|
||||||
|
FLOAT64 ana_tab_real[QMF_NUM_FILT_BANDS][2 * QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 ana_tab_imag[QMF_NUM_FILT_BANDS][2 * QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 syn_tab_real[2 * QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
||||||
|
FLOAT64 syn_tab_imag[2 * QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
||||||
|
|
||||||
typedef struct ia_drc_qmf_filt_struct
|
} ia_drc_qmf_filt_struct;
|
||||||
{
|
|
||||||
|
|
||||||
FLOAT64* ana_buff;
|
|
||||||
FLOAT64* syn_buff;
|
|
||||||
FLOAT64 ana_tab_real[QMF_NUM_FILT_BANDS][2*QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 ana_tab_imag[QMF_NUM_FILT_BANDS][2*QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 syn_tab_real[2*QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
|
||||||
FLOAT64 syn_tab_imag[2*QMF_NUM_FILT_BANDS][QMF_NUM_FILT_BANDS];
|
|
||||||
|
|
||||||
}ia_drc_qmf_filt_struct;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -27,14 +27,16 @@
|
||||||
|
|
||||||
extern const FLOAT32 samp_rate_tbl[13][12];
|
extern const FLOAT32 samp_rate_tbl[13][12];
|
||||||
|
|
||||||
extern const ia_delta_gain_code_table_struct ia_drc_gain_tbls_prof_0_1[NUM_GAIN_TBL_PROF_0_1_ENTRIES];
|
extern const ia_delta_gain_code_table_struct
|
||||||
|
ia_drc_gain_tbls_prof_0_1[NUM_GAIN_TBL_PROF_0_1_ENTRIES];
|
||||||
|
|
||||||
extern const ia_delta_gain_code_table_struct ia_drc_gain_tbls_prof_2[NUM_GAIN_TBL_PROF_2_ENTRIES];
|
extern const ia_delta_gain_code_table_struct
|
||||||
|
ia_drc_gain_tbls_prof_2[NUM_GAIN_TBL_PROF_2_ENTRIES];
|
||||||
|
|
||||||
extern const FLOAT32 channel_weight[];
|
extern const FLOAT32 channel_weight[];
|
||||||
|
|
||||||
extern const FLOAT32 dwnmix_coeff_v1[];
|
extern const FLOAT32 dwnmix_coeff_v1[];
|
||||||
extern const FLOAT32 eq_slope_tbl [];
|
extern const FLOAT32 eq_slope_tbl[];
|
||||||
|
|
||||||
extern const FLOAT32 eq_gain_delta_tbl[];
|
extern const FLOAT32 eq_gain_delta_tbl[];
|
||||||
|
|
||||||
|
|
@ -54,14 +56,14 @@ extern const FLOAT32 shape_filt_hf_radius_tbl[];
|
||||||
|
|
||||||
extern const FLOAT32 shape_filt_cutoff_freq_norm_hf_tbl[];
|
extern const FLOAT32 shape_filt_cutoff_freq_norm_hf_tbl[];
|
||||||
|
|
||||||
extern const ia_cicp_sigmoid_characteristic_param_struct pstr_cicp_sigmoid_characteristic_param[];
|
extern const ia_cicp_sigmoid_characteristic_param_struct
|
||||||
|
pstr_cicp_sigmoid_characteristic_param[];
|
||||||
|
|
||||||
|
extern const ia_slope_code_table_struct
|
||||||
extern const ia_slope_code_table_struct slope_code_tbl_entries_by_size[NUM_SLOPE_TBL_ENTRIES];
|
slope_code_tbl_entries_by_size[NUM_SLOPE_TBL_ENTRIES];
|
||||||
|
|
||||||
extern const FLOAT32 dwnmix_coeff[];
|
extern const FLOAT32 dwnmix_coeff[];
|
||||||
|
|
||||||
|
|
||||||
extern const FLOAT32 dwnmix_coeff_lfe[];
|
extern const FLOAT32 dwnmix_coeff_lfe[];
|
||||||
|
|
||||||
extern WORD32 drc_characteristic_order_default[][3];
|
extern WORD32 drc_characteristic_order_default[][3];
|
||||||
|
|
@ -89,7 +91,6 @@ typedef struct {
|
||||||
WORD32 requested_target_ch_count;
|
WORD32 requested_target_ch_count;
|
||||||
} ia_loc_sys_interface_struct;
|
} ia_loc_sys_interface_struct;
|
||||||
|
|
||||||
|
|
||||||
extern const ia_loc_sys_interface_struct loc_sys_interface[];
|
extern const ia_loc_sys_interface_struct loc_sys_interface[];
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -97,7 +98,8 @@ typedef struct {
|
||||||
FLOAT32 target_loudness;
|
FLOAT32 target_loudness;
|
||||||
} ia_loc_loudness_norm_ctrl_interface_struct;
|
} ia_loc_loudness_norm_ctrl_interface_struct;
|
||||||
|
|
||||||
extern const ia_loc_loudness_norm_ctrl_interface_struct loc_loudness_norm_ctrl_interface[];
|
extern const ia_loc_loudness_norm_ctrl_interface_struct
|
||||||
|
loc_loudness_norm_ctrl_interface[];
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 album_mode;
|
WORD32 album_mode;
|
||||||
|
|
@ -112,7 +114,8 @@ typedef struct {
|
||||||
FLOAT32 output_peak_level_max;
|
FLOAT32 output_peak_level_max;
|
||||||
} ia_loc_loudness_norm_param_interface_struct;
|
} ia_loc_loudness_norm_param_interface_struct;
|
||||||
|
|
||||||
extern const ia_loc_loudness_norm_param_interface_struct loc_loudness_norm_param_interface[];
|
extern const ia_loc_loudness_norm_param_interface_struct
|
||||||
|
loc_loudness_norm_param_interface[];
|
||||||
|
|
||||||
#define MAX_NUM_DRC_FEATURE_REQUESTS_LOCAL 3
|
#define MAX_NUM_DRC_FEATURE_REQUESTS_LOCAL 3
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -136,7 +139,8 @@ typedef struct {
|
||||||
WORD32 requested_drc_effect_type[MAX_NUM_DRC_EFFECT_TYPE_REQUESTS_LOCAL];
|
WORD32 requested_drc_effect_type[MAX_NUM_DRC_EFFECT_TYPE_REQUESTS_LOCAL];
|
||||||
} ia_loc_requested_drc_effect_struct;
|
} ia_loc_requested_drc_effect_struct;
|
||||||
|
|
||||||
extern const ia_loc_requested_drc_effect_struct loc_requested_drc_effect_type_str[];
|
extern const ia_loc_requested_drc_effect_struct
|
||||||
|
loc_requested_drc_effect_type_str[];
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FLOAT32 compress;
|
FLOAT32 compress;
|
||||||
|
|
@ -144,7 +148,8 @@ typedef struct {
|
||||||
WORD32 drc_characteristic_target;
|
WORD32 drc_characteristic_target;
|
||||||
} ia_loc_drc_parameter_interface_struct;
|
} ia_loc_drc_parameter_interface_struct;
|
||||||
|
|
||||||
extern const ia_loc_drc_parameter_interface_struct loc_drc_parameter_interface[];
|
extern const ia_loc_drc_parameter_interface_struct
|
||||||
|
loc_drc_parameter_interface[];
|
||||||
|
|
||||||
extern FLOAT32 f_bands_nrm_QMF71[71];
|
extern FLOAT32 f_bands_nrm_QMF71[71];
|
||||||
extern FLOAT32 f_bands_nrm_QMF64[64];
|
extern FLOAT32 f_bands_nrm_QMF64[64];
|
||||||
|
|
@ -152,5 +157,6 @@ extern FLOAT32 f_bands_nrm_STFT256[257];
|
||||||
|
|
||||||
FLOAT64 qmf_filter_coeff[640];
|
FLOAT64 qmf_filter_coeff[640];
|
||||||
|
|
||||||
extern const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT];
|
extern const ia_filter_bank_params_struct
|
||||||
|
normal_cross_freq[FILTER_BANK_PARAMETER_COUNT];
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#define SELECTION_FLAG_DRC_TARGET_LOUDNESS_MATCH (1 << 0)
|
||||||
#define SELECTION_FLAG_DRC_TARGET_LOUDNESS_MATCH (1<<0)
|
#define SELECTION_FLAG_EXPLICIT_PEAK_INFO_PRESENT (1 << 1)
|
||||||
#define SELECTION_FLAG_EXPLICIT_PEAK_INFO_PRESENT (1<<1)
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_instructions_index;
|
WORD32 drc_instructions_index;
|
||||||
|
|
@ -39,9 +38,9 @@ typedef struct {
|
||||||
WORD32 selection_flags;
|
WORD32 selection_flags;
|
||||||
} ia_selection_candidate_info_struct;
|
} ia_selection_candidate_info_struct;
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_validate_requested_drc_feature(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
impd_validate_requested_drc_feature(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_map_requested_effect_bit_idx(WORD32 requested_effect_type,
|
impd_map_requested_effect_bit_idx(WORD32 requested_effect_type,
|
||||||
|
|
@ -61,20 +60,21 @@ WORD32
|
||||||
impd_get_dependent_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
impd_get_dependent_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_dependent_drc_instructions(const ia_drc_config* drc_config,
|
impd_get_dependent_drc_instructions(
|
||||||
|
const ia_drc_config* drc_config,
|
||||||
const ia_drc_instructions_struct* str_drc_instruction_str,
|
const ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
ia_drc_instructions_struct** ppstr_drc_instructions_dependent);
|
ia_drc_instructions_struct** ppstr_drc_instructions_dependent);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_manage_drc_complexity (ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_manage_drc_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config);
|
ia_drc_config* pstr_drc_config);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_manage_eq_complexity (ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_manage_eq_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config);
|
ia_drc_config* pstr_drc_config);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_manage_complexity (ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_manage_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
WORD32* repeat_selection);
|
WORD32* repeat_selection);
|
||||||
|
|
||||||
|
|
@ -89,52 +89,51 @@ impd_get_selected_loud_eq_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
WORD32 loudEqSetIdSelected);
|
WORD32 loudEqSetIdSelected);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_select_drcs_without_compr_effects (ia_drc_config* pstr_drc_config,
|
impd_select_drcs_without_compr_effects(
|
||||||
WORD32* match_found_flag,
|
ia_drc_config* pstr_drc_config, WORD32* match_found_flag,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_effect_type_attempt(ia_drc_config* pstr_drc_config,
|
impd_match_effect_type_attempt(
|
||||||
WORD32 requested_effect_type,
|
ia_drc_config* pstr_drc_config, WORD32 requested_effect_type,
|
||||||
WORD32 stateRequested,
|
WORD32 stateRequested, WORD32* match_found_flag,
|
||||||
WORD32* match_found_flag,
|
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_effect_types(ia_drc_config* pstr_drc_config,
|
impd_match_effect_types(
|
||||||
WORD32 total_effect_type_requested,
|
ia_drc_config* pstr_drc_config, WORD32 total_effect_type_requested,
|
||||||
WORD32 desired_effect_type_requested,
|
WORD32 desired_effect_type_requested, WORD32* requested_effect_type,
|
||||||
WORD32* requested_effect_type,
|
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32 impd_match_dynamic_range(ia_drc_config* pstr_drc_config,
|
WORD32 impd_match_dynamic_range(
|
||||||
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
WORD32 num_drc_requests,
|
WORD32 num_drc_requests, WORD32* selection_candidate_count,
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_drc_characteristic_attempt(ia_drc_config* pstr_drc_config,
|
impd_match_drc_characteristic_attempt(
|
||||||
WORD32 requested_drc_characteristic,
|
ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
|
||||||
WORD32* match_found_flag,
|
WORD32* match_found_flag, WORD32* selection_candidate_count,
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_drc_characteristic(ia_drc_config* pstr_drc_config,
|
impd_match_drc_characteristic(
|
||||||
WORD32 requested_drc_characteristic,
|
ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
VOID impd_select_drc_coeff3(ia_drc_config* drc_config,
|
VOID impd_select_drc_coeff3(
|
||||||
|
ia_drc_config* drc_config,
|
||||||
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_set_preselection(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_drc_set_preselection(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 restrict_to_drc_with_album_loudness,
|
WORD32 restrict_to_drc_with_album_loudness,
|
||||||
|
|
@ -142,41 +141,37 @@ impd_drc_set_preselection(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_param
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32 impd_drc_set_final_selection(ia_drc_config* pstr_drc_config,
|
WORD32 impd_drc_set_final_selection(
|
||||||
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info
|
|
||||||
, WORD32* eq_set_id_valid_flag
|
|
||||||
);
|
|
||||||
|
|
||||||
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
|
||||||
WORD32 eq_set_purpose_requested,
|
|
||||||
WORD32* eq_set_id_valid_flag,
|
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info,
|
ia_selection_candidate_info_struct* selection_candidate_info,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info_step_2
|
WORD32* eq_set_id_valid_flag);
|
||||||
);
|
|
||||||
|
WORD32 impd_match_eq_set_purpose(
|
||||||
|
ia_drc_config* drc_config, WORD32 eq_set_purpose_requested,
|
||||||
|
WORD32* eq_set_id_valid_flag, WORD32* selection_candidate_count,
|
||||||
|
ia_selection_candidate_info_struct* selection_candidate_info,
|
||||||
|
ia_selection_candidate_info_struct* selection_candidate_info_step_2);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_select_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_select_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
WORD32* drc_set_id_selected
|
WORD32* drc_set_id_selected, WORD32* eq_set_id_selected,
|
||||||
, WORD32* eq_set_id_selected
|
WORD32* loud_eq_id_sel);
|
||||||
, WORD32* loud_eq_id_sel
|
|
||||||
);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_sel_proc_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_sel_proc_params(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_interface_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_interface_params(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_interface_struct* pstr_drc_interface);
|
ia_drc_interface_struct* pstr_drc_interface);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef IMPD_DRC_SECLECTION_PROCESS_H
|
#ifndef IMPD_DRC_SECLECTION_PROCESS_H
|
||||||
#define IMPD_DRC_SECLECTION_PROCESS_H
|
#define IMPD_DRC_SECLECTION_PROCESS_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
@ -40,9 +39,7 @@ extern "C" {
|
||||||
#define MATCH_DYNAMIC_RANGE 1
|
#define MATCH_DYNAMIC_RANGE 1
|
||||||
#define MATCH_DRC_CHARACTERISTIC 2
|
#define MATCH_DRC_CHARACTERISTIC 2
|
||||||
|
|
||||||
|
typedef struct ia_drc_sel_proc_params_struct {
|
||||||
typedef struct ia_drc_sel_proc_params_struct
|
|
||||||
{
|
|
||||||
WORD32 base_channel_count;
|
WORD32 base_channel_count;
|
||||||
WORD32 base_layout;
|
WORD32 base_layout;
|
||||||
WORD32 target_config_request_type;
|
WORD32 target_config_request_type;
|
||||||
|
|
@ -71,7 +68,8 @@ typedef struct ia_drc_sel_proc_params_struct
|
||||||
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS][MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS]
|
||||||
|
[MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
||||||
WORD32 requested_dyn_range_measur_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_range_measur_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_dyn_range_range_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_range_range_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
|
|
@ -79,7 +77,6 @@ typedef struct ia_drc_sel_proc_params_struct
|
||||||
FLOAT32 requested_dyn_range_max_val[MAX_NUM_DRC_FEATURE_REQUESTS];
|
FLOAT32 requested_dyn_range_max_val[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_drc_characteristic[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_drc_characteristic[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
|
|
||||||
|
|
||||||
WORD32 loudness_eq_request;
|
WORD32 loudness_eq_request;
|
||||||
FLOAT32 sensitivity;
|
FLOAT32 sensitivity;
|
||||||
FLOAT32 playback_gain;
|
FLOAT32 playback_gain;
|
||||||
|
|
@ -90,9 +87,7 @@ typedef struct ia_drc_sel_proc_params_struct
|
||||||
WORD32 drc_characteristic_target;
|
WORD32 drc_characteristic_target;
|
||||||
} ia_drc_sel_proc_params_struct;
|
} ia_drc_sel_proc_params_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_sel_pro_struct
|
typedef struct ia_drc_sel_pro_struct {
|
||||||
{
|
|
||||||
|
|
||||||
WORD32 first_frame;
|
WORD32 first_frame;
|
||||||
WORD32 drc_config_flag;
|
WORD32 drc_config_flag;
|
||||||
WORD32 loudness_info_set_flag;
|
WORD32 loudness_info_set_flag;
|
||||||
|
|
@ -122,56 +117,48 @@ typedef struct ia_drc_sel_pro_struct
|
||||||
|
|
||||||
} ia_drc_sel_pro_struct;
|
} ia_drc_sel_pro_struct;
|
||||||
|
|
||||||
WORD32 impd_map_target_config_req_downmix_id(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
WORD32 impd_map_target_config_req_downmix_id(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config);
|
ia_drc_config* pstr_drc_config);
|
||||||
|
|
||||||
VOID impd_sel_downmix_matrix(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
VOID impd_sel_downmix_matrix(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config);
|
ia_drc_config* pstr_drc_config);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_drc_instructions_uni_drc(ia_drc_config* drc_config,
|
impd_find_drc_instructions_uni_drc(
|
||||||
WORD32 drc_set_id_requested,
|
ia_drc_config* drc_config, WORD32 drc_set_id_requested,
|
||||||
ia_drc_instructions_struct** str_drc_instruction_str);
|
ia_drc_instructions_struct** str_drc_instruction_str);
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_eq_instructions(ia_drc_config* drc_config,
|
impd_find_eq_instructions(ia_drc_config* drc_config, WORD32 eq_set_id_requested,
|
||||||
WORD32 eq_set_id_requested,
|
|
||||||
ia_eq_instructions_struct** str_eq_instructions);
|
ia_eq_instructions_struct** str_eq_instructions);
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_downmix(ia_drc_config* drc_config,
|
impd_find_downmix(ia_drc_config* drc_config, WORD32 requested_dwnmix_id,
|
||||||
WORD32 requested_dwnmix_id,
|
|
||||||
ia_downmix_instructions_struct** dwnmix_instructions);
|
ia_downmix_instructions_struct** dwnmix_instructions);
|
||||||
|
|
||||||
|
WORD32
|
||||||
WORD32
|
|
||||||
impd_find_eq_set_no_compression(ia_drc_config* pstr_drc_config,
|
impd_find_eq_set_no_compression(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id,
|
||||||
WORD32* no_compression_eq_cnt,
|
WORD32* no_compression_eq_cnt,
|
||||||
WORD32* no_compression_eq_id);
|
WORD32* no_compression_eq_id);
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_eq_set(ia_drc_config* drc_config,
|
impd_match_eq_set(ia_drc_config* drc_config, WORD32 downmix_id,
|
||||||
WORD32 downmix_id,
|
WORD32 drc_set_id, WORD32* eq_set_id_valid_flag,
|
||||||
WORD32 drc_set_id,
|
WORD32* matching_eq_set_cnt, WORD32* matching_eq_set_idx);
|
||||||
WORD32* eq_set_id_valid_flag,
|
|
||||||
WORD32* matching_eq_set_cnt,
|
|
||||||
WORD32* matching_eq_set_idx);
|
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_select_loud_eq(ia_drc_config* pstr_drc_config, WORD32 requested_dwnmix_id,
|
||||||
WORD32
|
WORD32 drc_set_id_requested, WORD32 eq_set_id_requested,
|
||||||
impd_select_loud_eq(ia_drc_config* pstr_drc_config,
|
|
||||||
WORD32 requested_dwnmix_id,
|
|
||||||
WORD32 drc_set_id_requested,
|
|
||||||
WORD32 eq_set_id_requested,
|
|
||||||
WORD32* loud_eq_id_selected);
|
WORD32* loud_eq_id_selected);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_uni_selction_proc_init(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_uni_selction_proc_init(
|
||||||
ia_drc_sel_proc_params_struct * pstr_drc_sel_proc_params_struct,
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_interface_struct* pstr_drc_interface,
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
WORD32 sub_band_domain_mode);
|
ia_drc_interface_struct* pstr_drc_interface, WORD32 sub_band_domain_mode);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_uni_sel_proc_process(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_uni_sel_proc_process(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_sel_proc_output_struct* hia_drc_sel_proc_output_struct);
|
ia_drc_sel_proc_output_struct* hia_drc_sel_proc_output_struct);
|
||||||
|
|
@ -181,8 +168,6 @@ impd_find_loud_eq_instructions_idx_for_id(ia_drc_config* drc_config,
|
||||||
WORD32 loud_eq_set_id_requested,
|
WORD32 loud_eq_set_id_requested,
|
||||||
WORD32* instructions_idx);
|
WORD32* instructions_idx);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -27,37 +27,44 @@
|
||||||
#include "impd_drc_interface.h"
|
#include "impd_drc_interface.h"
|
||||||
#include "impd_drc_selection_process.h"
|
#include "impd_drc_selection_process.h"
|
||||||
|
|
||||||
WORD32 impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc)
|
WORD32 impd_drc_sel_proc_init_dflt(
|
||||||
{
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc) {
|
||||||
if (pstr_drc_uni_sel_proc != NULL) {
|
if (pstr_drc_uni_sel_proc != NULL) {
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->first_frame = 0;
|
pstr_drc_uni_sel_proc->first_frame = 0;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_channel_count = -1;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_channel_count = -1;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_layout = -1;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_layout = -1;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type =
|
||||||
|
0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests = 0;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode = 0;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter = 0;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on =
|
||||||
|
0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness = -24.0f;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness = -24.0f;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_deviation_max = LOUDNESS_DEVIATION_MAX_DEFAULT;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_deviation_max =
|
||||||
|
LOUDNESS_DEVIATION_MAX_DEFAULT;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_method = USER_METHOD_DEFINITION_DEFAULT;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_method =
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_system = USER_MEASUREMENT_SYSTEM_DEFAULT;
|
USER_METHOD_DEFINITION_DEFAULT;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_pre_proc = USER_LOUDNESS_PREPROCESSING_DEFAULT;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_system =
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.device_cut_off_frequency = 500;
|
USER_MEASUREMENT_SYSTEM_DEFAULT;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_db_max = LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_modification_db = 0.0f;
|
.loudness_measurement_pre_proc = USER_LOUDNESS_PREPROCESSING_DEFAULT;
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.device_cut_off_frequency =
|
||||||
|
500;
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_db_max =
|
||||||
|
LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_norm_gain_modification_db = 0.0f;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max = 0.0f;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max = 0.0f;
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter == 1) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter == 1) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max =
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max = 6.0f;
|
6.0f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on = 1;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on = 1;
|
||||||
|
|
@ -66,11 +73,15 @@ WORD32 impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc)
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost = 1.f;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost = 1.f;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress = 1.f;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress = 1.f;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_characteristic_target = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_characteristic_target =
|
||||||
|
0;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request = LOUD_EQ_REQUEST_OFF;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request =
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request = EQ_PURPOSE_EQ_OFF;
|
LOUD_EQ_REQUEST_OFF;
|
||||||
pstr_drc_uni_sel_proc->compl_level_supported_total = COMPLEXITY_LEVEL_SUPPORTED_TOTAL;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request =
|
||||||
|
EQ_PURPOSE_EQ_OFF;
|
||||||
|
pstr_drc_uni_sel_proc->compl_level_supported_total =
|
||||||
|
COMPLEXITY_LEVEL_SUPPORTED_TOTAL;
|
||||||
|
|
||||||
pstr_drc_uni_sel_proc->drc_inst_index_sel = -1;
|
pstr_drc_uni_sel_proc->drc_inst_index_sel = -1;
|
||||||
pstr_drc_uni_sel_proc->drc_coef_index_sel = -1;
|
pstr_drc_uni_sel_proc->drc_coef_index_sel = -1;
|
||||||
|
|
@ -80,8 +91,10 @@ WORD32 impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc)
|
||||||
pstr_drc_uni_sel_proc->drc_instructions_index[2] = -1;
|
pstr_drc_uni_sel_proc->drc_instructions_index[2] = -1;
|
||||||
pstr_drc_uni_sel_proc->drc_instructions_index[3] = -1;
|
pstr_drc_uni_sel_proc->drc_instructions_index[3] = -1;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_peak_level_db = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_peak_level_db = 0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.loudness_normalization_gain_db = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_loudness = UNDEFINED_LOUDNESS_VALUE;
|
.loudness_normalization_gain_db = 0;
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_loudness =
|
||||||
|
UNDEFINED_LOUDNESS_VALUE;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = 0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.active_downmix_id = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.active_downmix_id = 0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.base_channel_count = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.base_channel_count = 0;
|
||||||
|
|
@ -98,15 +111,16 @@ WORD32 impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_sel_proc_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_sel_proc_params(
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct)
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
{
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct) {
|
||||||
|
if (pstr_drc_uni_sel_proc != NULL &&
|
||||||
if (pstr_drc_uni_sel_proc != NULL && pstr_drc_sel_proc_params_struct != NULL) {
|
pstr_drc_sel_proc_params_struct != NULL) {
|
||||||
|
if (memcmp(&pstr_drc_uni_sel_proc->uni_drc_sel_proc_params,
|
||||||
if ( memcmp ( &pstr_drc_uni_sel_proc->uni_drc_sel_proc_params, pstr_drc_sel_proc_params_struct, sizeof(ia_drc_sel_proc_params_struct) ))
|
pstr_drc_sel_proc_params_struct,
|
||||||
{
|
sizeof(ia_drc_sel_proc_params_struct))) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params = *pstr_drc_sel_proc_params_struct;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params =
|
||||||
|
*pstr_drc_sel_proc_params_struct;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -114,178 +128,343 @@ impd_drc_sel_proc_init_sel_proc_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_p
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_interface_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_interface_params(
|
||||||
ia_drc_interface_struct* pstr_drc_interface)
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
{
|
ia_drc_interface_struct* pstr_drc_interface) {
|
||||||
WORD32 i,j;
|
WORD32 i, j;
|
||||||
|
|
||||||
if (pstr_drc_uni_sel_proc != NULL && pstr_drc_interface != NULL) {
|
if (pstr_drc_uni_sel_proc != NULL && pstr_drc_interface != NULL) {
|
||||||
|
|
||||||
if (pstr_drc_interface->system_interface_flag) {
|
if (pstr_drc_interface->system_interface_flag) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type != pstr_drc_interface->system_interface.target_config_request_type) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type = pstr_drc_interface->system_interface.target_config_request_type;
|
.target_config_request_type !=
|
||||||
|
pstr_drc_interface->system_interface.target_config_request_type) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.target_config_request_type =
|
||||||
|
pstr_drc_interface->system_interface.target_config_request_type;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type) {
|
switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.target_config_request_type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests != pstr_drc_interface->system_interface.num_downmix_id_requests) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests = pstr_drc_interface->system_interface.num_downmix_id_requests;
|
.num_downmix_id_requests !=
|
||||||
|
pstr_drc_interface->system_interface.num_downmix_id_requests) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.num_downmix_id_requests =
|
||||||
|
pstr_drc_interface->system_interface.num_downmix_id_requests;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
for (i=0; i<pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests; i++) {
|
for (i = 0; i < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dwnmix_id[i] != pstr_drc_interface->system_interface.requested_dwnmix_id[i]) {
|
.num_downmix_id_requests;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dwnmix_id[i] = pstr_drc_interface->system_interface.requested_dwnmix_id[i];
|
i++) {
|
||||||
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dwnmix_id[i] !=
|
||||||
|
pstr_drc_interface->system_interface.requested_dwnmix_id[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dwnmix_id[i] =
|
||||||
|
pstr_drc_interface->system_interface.requested_dwnmix_id[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_target_layout != pstr_drc_interface->system_interface.requested_target_layout) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_target_layout = pstr_drc_interface->system_interface.requested_target_layout;
|
.requested_target_layout !=
|
||||||
|
pstr_drc_interface->system_interface.requested_target_layout) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_target_layout =
|
||||||
|
pstr_drc_interface->system_interface.requested_target_layout;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_target_ch_count != pstr_drc_interface->system_interface.requested_target_ch_count) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_target_ch_count = pstr_drc_interface->system_interface.requested_target_ch_count;
|
.requested_target_ch_count !=
|
||||||
|
pstr_drc_interface->system_interface.requested_target_ch_count) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_target_ch_count =
|
||||||
|
pstr_drc_interface->system_interface.requested_target_ch_count;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_ctrl_interface_flag) {
|
if (pstr_drc_interface->loudness_norm_ctrl_interface_flag) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on != pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on = pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on;
|
.loudness_normalization_on !=
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface
|
||||||
|
.loudness_normalization_on) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_normalization_on =
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface
|
||||||
|
.loudness_normalization_on;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness != pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness) {
|
.loudness_normalization_on) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness = pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness !=
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness =
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_parameter_interface_flag) {
|
if (pstr_drc_interface->loudness_norm_parameter_interface_flag) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode != pstr_drc_interface->loudness_norm_param_interface.album_mode) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode !=
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode = pstr_drc_interface->loudness_norm_param_interface.album_mode;
|
pstr_drc_interface->loudness_norm_param_interface.album_mode) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.album_mode;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter != pstr_drc_interface->loudness_norm_param_interface.peak_limiter) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter !=
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter = pstr_drc_interface->loudness_norm_param_interface.peak_limiter;
|
pstr_drc_interface->loudness_norm_param_interface.peak_limiter) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.peak_limiter;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_deviation_max) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_deviation_max != pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max) {
|
.change_loudness_deviation_max) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_deviation_max = pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_deviation_max !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_deviation_max) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_deviation_max =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_deviation_max;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_method) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_method != pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_method) {
|
.change_loudness_measur_method) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_method = pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_method;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_method !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_method) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_method =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_method;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_pre_proc) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_pre_proc != pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_pre_proc) {
|
.change_loudness_measur_pre_proc) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_pre_proc = pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_pre_proc;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_pre_proc !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_pre_proc) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_pre_proc =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_pre_proc;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_system) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_system != pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_system) {
|
.change_loudness_measur_system) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_system = pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_system;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_system !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_system) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_measurement_system =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_measurement_system;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_device_cut_off_freq) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.device_cut_off_frequency != pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency) {
|
.change_device_cut_off_freq) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.device_cut_off_frequency = pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.device_cut_off_frequency !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.device_cut_off_frequency) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.device_cut_off_frequency =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.device_cut_off_frequency;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_db_max) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_db_max != pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_db_max) {
|
.change_loudness_norm_gain_db_max) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_db_max = pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_db_max;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_norm_gain_db_max !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_db_max) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_norm_gain_db_max =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_db_max;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_modification_db ) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_modification_db != pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_modification_db) {
|
.change_loudness_norm_gain_modification_db) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_modification_db = pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_modification_db;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_norm_gain_modification_db !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_modification_db) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.loudness_norm_gain_modification_db =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.loudness_norm_gain_modification_db;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->loudness_norm_param_interface.change_output_peak_level_max) {
|
if (pstr_drc_interface->loudness_norm_param_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max != pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max) {
|
.change_output_peak_level_max) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max = pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.output_peak_level_max !=
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.output_peak_level_max) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max =
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface
|
||||||
|
.output_peak_level_max;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->drc_interface_flag) {
|
if (pstr_drc_interface->drc_interface_flag) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on != pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on = pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on;
|
.dynamic_range_control_on !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.dynamic_range_control_on =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
if (!pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on) {
|
if (!pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_drc_feature_requests = 0;
|
.dynamic_range_control_on) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.num_drc_feature_requests = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_drc_feature_requests != pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests) {
|
.dynamic_range_control_on) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_drc_feature_requests = pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.num_drc_feature_requests !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.num_drc_feature_requests =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
for (i=0; i<pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_drc_feature_requests; i++) {
|
for (i = 0; i < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_feature_req_type[i] != pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i]) {
|
.num_drc_feature_requests;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_feature_req_type[i] = pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i];
|
i++) {
|
||||||
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.drc_feature_req_type[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.drc_feature_req_type[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_feature_req_type[i]) {
|
switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.drc_feature_req_type[i]) {
|
||||||
case 0:
|
case 0:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_num_drc_effects[i] != pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_num_drc_effects[i] = pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[i];
|
.requested_num_drc_effects[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_num_drc_effects[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_num_drc_effects[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_num_drc_effects[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.desired_num_drc_effects_of_requested[i] != pstr_drc_interface->drc_ctrl_interface.desired_num_drc_effects_of_requested[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.desired_num_drc_effects_of_requested[i] = pstr_drc_interface->drc_ctrl_interface.desired_num_drc_effects_of_requested[i];
|
.desired_num_drc_effects_of_requested[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.desired_num_drc_effects_of_requested[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.desired_num_drc_effects_of_requested[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.desired_num_drc_effects_of_requested[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
for (j=0; j<pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_num_drc_effects[i]; j++) {
|
for (j = 0; j < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_drc_effect_type[i][j] != pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[i][j]) {
|
.requested_num_drc_effects[i];
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_drc_effect_type[i][j] = pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[i][j];
|
j++) {
|
||||||
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_drc_effect_type[i][j] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_drc_effect_type[i][j]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_drc_effect_type[i][j] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_drc_effect_type[i][j];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_measur_type[i] != pstr_drc_interface->drc_ctrl_interface.requested_dyn_rng_measurement_type[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_measur_type[i] = pstr_drc_interface->drc_ctrl_interface.requested_dyn_rng_measurement_type[i];
|
.requested_dyn_range_measur_type[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_rng_measurement_type[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_measur_type[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_rng_measurement_type[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_range_flag[i] != pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_range_flag[i] = pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[i];
|
.requested_dyn_range_range_flag[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_is_single_val_flag[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_range_flag[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_is_single_val_flag[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_range_flag[i] == 0) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_value[i] != pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_value[i]) {
|
.requested_dyn_range_range_flag[i] == 0) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_value[i] = pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_value[i];
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_value[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_value[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_value[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_value[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_min_val[i] != pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_min_val[i] = pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[i];
|
.requested_dyn_range_min_val[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_min_val[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_min_val[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_min_val[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_max_val[i] != pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_dyn_range_max_val[i] = pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[i];
|
.requested_dyn_range_max_val[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_max_val[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_dyn_range_max_val[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_dyn_range_max_val[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_drc_characteristic[i] != pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[i]) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.requested_drc_characteristic[i] = pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[i];
|
.requested_drc_characteristic[i] !=
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_drc_characteristic[i]) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.requested_drc_characteristic[i] =
|
||||||
|
pstr_drc_interface->drc_ctrl_interface
|
||||||
|
.requested_drc_characteristic[i];
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -295,42 +474,57 @@ impd_drc_sel_proc_init_interface_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->drc_parameter_interface_flag) {
|
if (pstr_drc_interface->drc_parameter_interface_flag) {
|
||||||
if (pstr_drc_interface->drc_parameter_interface.change_compress) {
|
if (pstr_drc_interface->drc_parameter_interface.change_compress) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress != pstr_drc_interface->drc_parameter_interface.compress) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress !=
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress = pstr_drc_interface->drc_parameter_interface.compress;
|
pstr_drc_interface->drc_parameter_interface.compress) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress =
|
||||||
|
pstr_drc_interface->drc_parameter_interface.compress;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->drc_parameter_interface.change_boost) {
|
if (pstr_drc_interface->drc_parameter_interface.change_boost) {
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost != pstr_drc_interface->drc_parameter_interface.boost) {
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost !=
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost = pstr_drc_interface->drc_parameter_interface.boost;
|
pstr_drc_interface->drc_parameter_interface.boost) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost =
|
||||||
|
pstr_drc_interface->drc_parameter_interface.boost;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->drc_parameter_interface.change_drc_characteristic_target) {
|
if (pstr_drc_interface->drc_parameter_interface
|
||||||
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_characteristic_target != pstr_drc_interface->drc_parameter_interface.drc_characteristic_target) {
|
.change_drc_characteristic_target) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_characteristic_target = pstr_drc_interface->drc_parameter_interface.drc_characteristic_target;
|
if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.drc_characteristic_target !=
|
||||||
|
pstr_drc_interface->drc_parameter_interface
|
||||||
|
.drc_characteristic_target) {
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
|
||||||
|
.drc_characteristic_target =
|
||||||
|
pstr_drc_interface->drc_parameter_interface
|
||||||
|
.drc_characteristic_target;
|
||||||
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pstr_drc_interface->drc_uni_interface_ext_flag) {
|
if (pstr_drc_interface->drc_uni_interface_ext_flag) {
|
||||||
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext = &pstr_drc_interface->drc_uni_interface_ext;
|
ia_drc_uni_interface_ext_struct* drc_uni_interface_ext =
|
||||||
|
&pstr_drc_interface->drc_uni_interface_ext;
|
||||||
if (drc_uni_interface_ext->loudness_eq_parameter_interface_flag) {
|
if (drc_uni_interface_ext->loudness_eq_parameter_interface_flag) {
|
||||||
ia_loudness_eq_parameter_interface_struct* loudness_eq_parameter_interface = &drc_uni_interface_ext->loudness_eq_parameter_interface;
|
ia_loudness_eq_parameter_interface_struct*
|
||||||
|
loudness_eq_parameter_interface =
|
||||||
|
&drc_uni_interface_ext->loudness_eq_parameter_interface;
|
||||||
if (loudness_eq_parameter_interface->loudness_eq_request_flag) {
|
if (loudness_eq_parameter_interface->loudness_eq_request_flag) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request = loudness_eq_parameter_interface->loudness_eq_request;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request =
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.sensitivity = loudness_eq_parameter_interface->sensitivity;
|
loudness_eq_parameter_interface->loudness_eq_request;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.playback_gain = loudness_eq_parameter_interface->playback_gain;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.sensitivity =
|
||||||
|
loudness_eq_parameter_interface->sensitivity;
|
||||||
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.playback_gain =
|
||||||
|
loudness_eq_parameter_interface->playback_gain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (drc_uni_interface_ext->eq_ctrl_interface_flag) {
|
if (drc_uni_interface_ext->eq_ctrl_interface_flag) {
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request = drc_uni_interface_ext->eq_ctrl_interface.eq_set_purpose_request;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request =
|
||||||
|
drc_uni_interface_ext->eq_ctrl_interface.eq_set_purpose_request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,76 +38,76 @@
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
WORD32 impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
|
WORD32 impd_shape_filt_block_adapt(const FLOAT32 drc_gain,
|
||||||
shape_filter_block* shape_filter_block)
|
shape_filter_block* shape_filter_block) {
|
||||||
{
|
// WORD32 err = 0;
|
||||||
// WORD32 err = 0;
|
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 warpedGain, x1, y1;
|
FLOAT32 warpedGain, x1, y1;
|
||||||
shape_filter_block->drc_gain_last = drc_gain;
|
shape_filter_block->drc_gain_last = drc_gain;
|
||||||
for (i=0; i<4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
if (shape_filter_block->shape_filter[i].type == SHAPE_FILTER_TYPE_OFF)
|
||||||
if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_OFF)
|
|
||||||
continue;
|
continue;
|
||||||
else if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_LF_CUT||shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_HF_CUT)
|
else if (shape_filter_block->shape_filter[i].type ==
|
||||||
{
|
SHAPE_FILTER_TYPE_LF_CUT ||
|
||||||
|
shape_filter_block->shape_filter[i].type ==
|
||||||
|
SHAPE_FILTER_TYPE_HF_CUT) {
|
||||||
if (drc_gain < 1.0f)
|
if (drc_gain < 1.0f)
|
||||||
warpedGain = -1.0f;
|
warpedGain = -1.0f;
|
||||||
else
|
else
|
||||||
warpedGain = (drc_gain - 1.0f) / (drc_gain - 1.0f + shape_filter_block->shape_filter[i].gain_offset);
|
warpedGain =
|
||||||
|
(drc_gain - 1.0f) /
|
||||||
|
(drc_gain - 1.0f + shape_filter_block->shape_filter[i].gain_offset);
|
||||||
x1 = shape_filter_block->shape_filter[i].a1;
|
x1 = shape_filter_block->shape_filter[i].a1;
|
||||||
}
|
} else if (shape_filter_block->shape_filter[i].type ==
|
||||||
else if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_LF_BOOST||shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_HF_BOOST)
|
SHAPE_FILTER_TYPE_LF_BOOST ||
|
||||||
{
|
shape_filter_block->shape_filter[i].type ==
|
||||||
|
SHAPE_FILTER_TYPE_HF_BOOST) {
|
||||||
if (drc_gain >= 1.0f)
|
if (drc_gain >= 1.0f)
|
||||||
warpedGain = -1.0f;
|
warpedGain = -1.0f;
|
||||||
else
|
else
|
||||||
warpedGain = (1.0f - drc_gain) / (1.0f + drc_gain * (shape_filter_block->shape_filter[i].gain_offset - 1.0f));
|
warpedGain =
|
||||||
|
(1.0f - drc_gain) /
|
||||||
|
(1.0f +
|
||||||
|
drc_gain *
|
||||||
|
(shape_filter_block->shape_filter[i].gain_offset - 1.0f));
|
||||||
x1 = shape_filter_block->shape_filter[i].b1;
|
x1 = shape_filter_block->shape_filter[i].b1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warpedGain <= 0.0f)
|
if (warpedGain <= 0.0f) {
|
||||||
{
|
|
||||||
y1 = x1;
|
y1 = x1;
|
||||||
}
|
} else if (warpedGain <
|
||||||
else if (warpedGain < shape_filter_block->shape_filter[i].warped_gain_max) {
|
shape_filter_block->shape_filter[i].warped_gain_max) {
|
||||||
y1 = x1 + shape_filter_block->shape_filter[i].factor * warpedGain;
|
y1 = x1 + shape_filter_block->shape_filter[i].factor * warpedGain;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
y1 = shape_filter_block->shape_filter[i].y1_bound;
|
y1 = shape_filter_block->shape_filter[i].y1_bound;
|
||||||
}
|
}
|
||||||
if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_LF_CUT)
|
if (shape_filter_block->shape_filter[i].type == SHAPE_FILTER_TYPE_LF_CUT) {
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[i].b1 = y1;
|
shape_filter_block->shape_filter[i].b1 = y1;
|
||||||
}
|
} else if (shape_filter_block->shape_filter[i].type ==
|
||||||
else if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_HF_CUT)
|
SHAPE_FILTER_TYPE_HF_CUT) {
|
||||||
{
|
shape_filter_block->shape_filter[i].g_norm =
|
||||||
shape_filter_block->shape_filter[i].g_norm = shape_filter_block->shape_filter[i].coeff_sum / (shape_filter_block->shape_filter[i].partial_coeff_sum + y1);
|
shape_filter_block->shape_filter[i].coeff_sum /
|
||||||
|
(shape_filter_block->shape_filter[i].partial_coeff_sum + y1);
|
||||||
shape_filter_block->shape_filter[i].b1 = y1;
|
shape_filter_block->shape_filter[i].b1 = y1;
|
||||||
}
|
} else if (shape_filter_block->shape_filter[i].type ==
|
||||||
else if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_HF_BOOST)
|
SHAPE_FILTER_TYPE_HF_BOOST) {
|
||||||
{
|
shape_filter_block->shape_filter[i].g_norm =
|
||||||
shape_filter_block->shape_filter[i].g_norm = (shape_filter_block->shape_filter[i].partial_coeff_sum + y1) / shape_filter_block->shape_filter[i].coeff_sum;
|
(shape_filter_block->shape_filter[i].partial_coeff_sum + y1) /
|
||||||
|
shape_filter_block->shape_filter[i].coeff_sum;
|
||||||
|
shape_filter_block->shape_filter[i].a1 = y1;
|
||||||
|
} else if (shape_filter_block->shape_filter[i].type ==
|
||||||
|
SHAPE_FILTER_TYPE_LF_BOOST) {
|
||||||
shape_filter_block->shape_filter[i].a1 = y1;
|
shape_filter_block->shape_filter[i].a1 = y1;
|
||||||
}
|
}
|
||||||
else if(shape_filter_block->shape_filter[i].type==SHAPE_FILTER_TYPE_LF_BOOST)
|
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[i].a1 = y1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 resetshape_flter_block(shape_filter_block* shape_filter_block)
|
WORD32 resetshape_flter_block(shape_filter_block* shape_filter_block) {
|
||||||
{
|
|
||||||
WORD32 i, c;
|
WORD32 i, c;
|
||||||
shape_filter_block->drc_gain_last = -1.0f;
|
shape_filter_block->drc_gain_last = -1.0f;
|
||||||
impd_shape_filt_block_adapt(1.0f, shape_filter_block);
|
impd_shape_filt_block_adapt(1.0f, shape_filter_block);
|
||||||
for (i=0; i<4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
for (c=0; c<MAX_CHANNEL_COUNT; c++)
|
for (c = 0; c < MAX_CHANNEL_COUNT; c++) {
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[i].audio_in_state_1[c] = 0.0f;
|
shape_filter_block->shape_filter[i].audio_in_state_1[c] = 0.0f;
|
||||||
shape_filter_block->shape_filter[i].audio_in_state_2[c] = 0.0f;
|
shape_filter_block->shape_filter[i].audio_in_state_2[c] = 0.0f;
|
||||||
shape_filter_block->shape_filter[i].audio_out_state_1[c] = 0.0f;
|
shape_filter_block->shape_filter[i].audio_out_state_1[c] = 0.0f;
|
||||||
|
|
@ -117,88 +117,120 @@ WORD32 resetshape_flter_block(shape_filter_block* shape_filter_block)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_shape_filt_block_init(
|
||||||
WORD32 impd_shape_filt_block_init(ia_shape_filter_block_params_struct* shape_flter_block_params,
|
ia_shape_filter_block_params_struct* shape_flter_block_params,
|
||||||
shape_filter_block* shape_filter_block)
|
shape_filter_block* shape_filter_block) {
|
||||||
{
|
// WORD32 err = 0;
|
||||||
//WORD32 err = 0;
|
|
||||||
FLOAT32 x1;
|
FLOAT32 x1;
|
||||||
FLOAT32 x2 = 0.0f;
|
FLOAT32 x2 = 0.0f;
|
||||||
FLOAT32 radius;
|
FLOAT32 radius;
|
||||||
if (shape_flter_block_params->lf_cut_filter_present) {
|
if (shape_flter_block_params->lf_cut_filter_present) {
|
||||||
|
ia_shape_filter_params_struct* params =
|
||||||
ia_shape_filter_params_struct* params = &shape_flter_block_params->str_lf_cut_params;
|
&shape_flter_block_params->str_lf_cut_params;
|
||||||
shape_filter_block->shape_filter[0].type = SHAPE_FILTER_TYPE_LF_CUT;
|
shape_filter_block->shape_filter[0].type = SHAPE_FILTER_TYPE_LF_CUT;
|
||||||
shape_filter_block->shape_filter[0].gain_offset = shape_filt_lf_gain_offset_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filter_block->shape_filter[0].gain_offset =
|
||||||
shape_filter_block->shape_filter[0].y1_bound = shape_filt_lf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filt_lf_gain_offset_tbl[params->corner_freq_index]
|
||||||
x1 = - shape_filt_lf_radius_tbl[params->corner_freq_index];
|
[params->filter_strength_index];
|
||||||
shape_filter_block->shape_filter[0].warped_gain_max = SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE / (SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE + shape_filter_block->shape_filter[0].gain_offset);
|
shape_filter_block->shape_filter[0].y1_bound =
|
||||||
shape_filter_block->shape_filter[0].factor = (shape_filter_block->shape_filter[0].y1_bound - x1) / shape_filter_block->shape_filter[0].warped_gain_max;
|
shape_filt_lf_y1_bound_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
|
x1 = -shape_filt_lf_radius_tbl[params->corner_freq_index];
|
||||||
|
shape_filter_block->shape_filter[0].warped_gain_max =
|
||||||
|
SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE /
|
||||||
|
(SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE +
|
||||||
|
shape_filter_block->shape_filter[0].gain_offset);
|
||||||
|
shape_filter_block->shape_filter[0].factor =
|
||||||
|
(shape_filter_block->shape_filter[0].y1_bound - x1) /
|
||||||
|
shape_filter_block->shape_filter[0].warped_gain_max;
|
||||||
shape_filter_block->shape_filter[0].a1 = x1;
|
shape_filter_block->shape_filter[0].a1 = x1;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[0].type = SHAPE_FILTER_TYPE_OFF;
|
shape_filter_block->shape_filter[0].type = SHAPE_FILTER_TYPE_OFF;
|
||||||
}
|
}
|
||||||
if (shape_flter_block_params->lf_boost_filter_present) {
|
if (shape_flter_block_params->lf_boost_filter_present) {
|
||||||
|
ia_shape_filter_params_struct* params =
|
||||||
ia_shape_filter_params_struct* params = &shape_flter_block_params->str_lf_boost_params;
|
&shape_flter_block_params->str_lf_boost_params;
|
||||||
shape_filter_block->shape_filter[1].type = SHAPE_FILTER_TYPE_LF_BOOST;
|
shape_filter_block->shape_filter[1].type = SHAPE_FILTER_TYPE_LF_BOOST;
|
||||||
shape_filter_block->shape_filter[1].gain_offset = shape_filt_lf_gain_offset_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filter_block->shape_filter[1].gain_offset =
|
||||||
shape_filter_block->shape_filter[1].y1_bound = shape_filt_lf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filt_lf_gain_offset_tbl[params->corner_freq_index]
|
||||||
x1 = - shape_filt_lf_radius_tbl[params->corner_freq_index];
|
[params->filter_strength_index];
|
||||||
shape_filter_block->shape_filter[1].warped_gain_max = SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE / (SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE + shape_filter_block->shape_filter[1].gain_offset);
|
shape_filter_block->shape_filter[1].y1_bound =
|
||||||
shape_filter_block->shape_filter[1].factor = (shape_filter_block->shape_filter[1].y1_bound - x1) / shape_filter_block->shape_filter[1].warped_gain_max;
|
shape_filt_lf_y1_bound_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
|
x1 = -shape_filt_lf_radius_tbl[params->corner_freq_index];
|
||||||
|
shape_filter_block->shape_filter[1].warped_gain_max =
|
||||||
|
SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE /
|
||||||
|
(SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE +
|
||||||
|
shape_filter_block->shape_filter[1].gain_offset);
|
||||||
|
shape_filter_block->shape_filter[1].factor =
|
||||||
|
(shape_filter_block->shape_filter[1].y1_bound - x1) /
|
||||||
|
shape_filter_block->shape_filter[1].warped_gain_max;
|
||||||
shape_filter_block->shape_filter[1].b1 = x1;
|
shape_filter_block->shape_filter[1].b1 = x1;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[1].type = SHAPE_FILTER_TYPE_OFF;
|
shape_filter_block->shape_filter[1].type = SHAPE_FILTER_TYPE_OFF;
|
||||||
}
|
}
|
||||||
if (shape_flter_block_params->hf_cut_filter_present) {
|
if (shape_flter_block_params->hf_cut_filter_present) {
|
||||||
|
ia_shape_filter_params_struct* params =
|
||||||
ia_shape_filter_params_struct* params = &shape_flter_block_params->str_hfCutParams;
|
&shape_flter_block_params->str_hfCutParams;
|
||||||
shape_filter_block->shape_filter[2].type = SHAPE_FILTER_TYPE_HF_CUT;
|
shape_filter_block->shape_filter[2].type = SHAPE_FILTER_TYPE_HF_CUT;
|
||||||
shape_filter_block->shape_filter[2].gain_offset = shape_filt_hf_gain_offset_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filter_block->shape_filter[2].gain_offset =
|
||||||
shape_filter_block->shape_filter[2].y1_bound = shape_filt_hf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filt_hf_gain_offset_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
|
shape_filter_block->shape_filter[2].y1_bound =
|
||||||
|
shape_filt_hf_y1_bound_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
radius = shape_filt_hf_radius_tbl[params->corner_freq_index];
|
radius = shape_filt_hf_radius_tbl[params->corner_freq_index];
|
||||||
x1 = (FLOAT32)(- 2.0f * radius * cos(2.0f * M_PI * shape_filt_cutoff_freq_norm_hf_tbl[params->corner_freq_index]));
|
x1 = (FLOAT32)(
|
||||||
|
-2.0f * radius *
|
||||||
|
cos(2.0f * M_PI *
|
||||||
|
shape_filt_cutoff_freq_norm_hf_tbl[params->corner_freq_index]));
|
||||||
x2 = radius * radius;
|
x2 = radius * radius;
|
||||||
shape_filter_block->shape_filter[2].warped_gain_max = SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE / (SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE + shape_filter_block->shape_filter[2].gain_offset);
|
shape_filter_block->shape_filter[2].warped_gain_max =
|
||||||
shape_filter_block->shape_filter[2].factor = (shape_filter_block->shape_filter[2].y1_bound - x1) / shape_filter_block->shape_filter[2].warped_gain_max;
|
SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE /
|
||||||
|
(SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE +
|
||||||
|
shape_filter_block->shape_filter[2].gain_offset);
|
||||||
|
shape_filter_block->shape_filter[2].factor =
|
||||||
|
(shape_filter_block->shape_filter[2].y1_bound - x1) /
|
||||||
|
shape_filter_block->shape_filter[2].warped_gain_max;
|
||||||
shape_filter_block->shape_filter[2].coeff_sum = 1.0f + x1 + x2;
|
shape_filter_block->shape_filter[2].coeff_sum = 1.0f + x1 + x2;
|
||||||
shape_filter_block->shape_filter[2].partial_coeff_sum = 1.0f + x2;
|
shape_filter_block->shape_filter[2].partial_coeff_sum = 1.0f + x2;
|
||||||
shape_filter_block->shape_filter[2].a1 = x1;
|
shape_filter_block->shape_filter[2].a1 = x1;
|
||||||
shape_filter_block->shape_filter[2].a2 = x2;
|
shape_filter_block->shape_filter[2].a2 = x2;
|
||||||
shape_filter_block->shape_filter[2].b2 = x2;
|
shape_filter_block->shape_filter[2].b2 = x2;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[2].type = SHAPE_FILTER_TYPE_OFF;
|
shape_filter_block->shape_filter[2].type = SHAPE_FILTER_TYPE_OFF;
|
||||||
}
|
}
|
||||||
if (shape_flter_block_params->hf_boost_filter_present) {
|
if (shape_flter_block_params->hf_boost_filter_present) {
|
||||||
|
ia_shape_filter_params_struct* params =
|
||||||
ia_shape_filter_params_struct* params = &shape_flter_block_params->str_hf_boost_params;
|
&shape_flter_block_params->str_hf_boost_params;
|
||||||
shape_filter_block->shape_filter[3].type = SHAPE_FILTER_TYPE_HF_BOOST;
|
shape_filter_block->shape_filter[3].type = SHAPE_FILTER_TYPE_HF_BOOST;
|
||||||
shape_filter_block->shape_filter[3].gain_offset = shape_filt_hf_gain_offset_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filter_block->shape_filter[3].gain_offset =
|
||||||
shape_filter_block->shape_filter[3].y1_bound = shape_filt_hf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filt_hf_gain_offset_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
|
shape_filter_block->shape_filter[3].y1_bound =
|
||||||
|
shape_filt_hf_y1_bound_tbl[params->corner_freq_index]
|
||||||
|
[params->filter_strength_index];
|
||||||
radius = shape_filt_hf_radius_tbl[params->corner_freq_index];
|
radius = shape_filt_hf_radius_tbl[params->corner_freq_index];
|
||||||
x1 = (FLOAT32)(- 2.0f * radius * cos(2.0f * M_PI * shape_filt_cutoff_freq_norm_hf_tbl[params->corner_freq_index]));
|
x1 = (FLOAT32)(
|
||||||
|
-2.0f * radius *
|
||||||
|
cos(2.0f * M_PI *
|
||||||
|
shape_filt_cutoff_freq_norm_hf_tbl[params->corner_freq_index]));
|
||||||
x2 = radius * radius;
|
x2 = radius * radius;
|
||||||
shape_filter_block->shape_filter[3].warped_gain_max = SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE / (SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE + shape_filter_block->shape_filter[3].gain_offset);
|
shape_filter_block->shape_filter[3].warped_gain_max =
|
||||||
shape_filter_block->shape_filter[3].factor = (shape_filter_block->shape_filter[3].y1_bound - x1) / shape_filter_block->shape_filter[3].warped_gain_max;
|
SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE /
|
||||||
|
(SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE +
|
||||||
|
shape_filter_block->shape_filter[3].gain_offset);
|
||||||
|
shape_filter_block->shape_filter[3].factor =
|
||||||
|
(shape_filter_block->shape_filter[3].y1_bound - x1) /
|
||||||
|
shape_filter_block->shape_filter[3].warped_gain_max;
|
||||||
shape_filter_block->shape_filter[3].coeff_sum = 1.0f + x1 + x2;
|
shape_filter_block->shape_filter[3].coeff_sum = 1.0f + x1 + x2;
|
||||||
shape_filter_block->shape_filter[3].partial_coeff_sum = 1.0f + x2;
|
shape_filter_block->shape_filter[3].partial_coeff_sum = 1.0f + x2;
|
||||||
shape_filter_block->shape_filter[3].b1 = x1;
|
shape_filter_block->shape_filter[3].b1 = x1;
|
||||||
shape_filter_block->shape_filter[3].b2 = x2;
|
shape_filter_block->shape_filter[3].b2 = x2;
|
||||||
shape_filter_block->shape_filter[3].a2 = x2;
|
shape_filter_block->shape_filter[3].a2 = x2;
|
||||||
|
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
shape_filter_block->shape_filter[3].type = SHAPE_FILTER_TYPE_OFF;
|
shape_filter_block->shape_filter[3].type = SHAPE_FILTER_TYPE_OFF;
|
||||||
}
|
}
|
||||||
resetshape_flter_block(shape_filter_block);
|
resetshape_flter_block(shape_filter_block);
|
||||||
|
|
@ -206,59 +238,69 @@ WORD32 impd_shape_filt_block_init(ia_shape_filter_block_params_struct* shape_flt
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 impd_shape_filt_block_time_process(
|
||||||
|
shape_filter_block* shape_filter_block, FLOAT32* drc_gain,
|
||||||
WORD32 impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block,
|
const WORD32 channel, FLOAT32* audio_in, WORD32 start, WORD32 end) {
|
||||||
FLOAT32* drc_gain,
|
WORD32 i, j, err = 0;
|
||||||
const WORD32 channel,
|
|
||||||
FLOAT32 *audio_in,
|
|
||||||
WORD32 start,
|
|
||||||
WORD32 end)
|
|
||||||
{
|
|
||||||
WORD32 i,j, err=0;
|
|
||||||
FLOAT32 audio_out;
|
FLOAT32 audio_out;
|
||||||
|
|
||||||
if(shape_filter_block->shape_flter_block_flag){
|
if (shape_filter_block->shape_flter_block_flag) {
|
||||||
for (i=start; i<end; i++)
|
for (i = start; i < end; i++) {
|
||||||
{
|
|
||||||
FLOAT32 tmp = audio_in[i];
|
FLOAT32 tmp = audio_in[i];
|
||||||
for (j=0; j<4; j++) {
|
for (j = 0; j < 4; j++) {
|
||||||
if(shape_filter_block->shape_filter[j].type==SHAPE_FILTER_TYPE_LF_CUT||shape_filter_block->shape_filter[j].type==SHAPE_FILTER_TYPE_LF_BOOST){
|
if (shape_filter_block->shape_filter[j].type ==
|
||||||
|
SHAPE_FILTER_TYPE_LF_CUT ||
|
||||||
audio_out = tmp + shape_filter_block->shape_filter[j].b1 * shape_filter_block->shape_filter[j].audio_in_state_1[channel]
|
shape_filter_block->shape_filter[j].type ==
|
||||||
- shape_filter_block->shape_filter[j].a1 * shape_filter_block->shape_filter[j].audio_out_state_1[channel];
|
SHAPE_FILTER_TYPE_LF_BOOST) {
|
||||||
|
audio_out = tmp +
|
||||||
|
shape_filter_block->shape_filter[j].b1 *
|
||||||
|
shape_filter_block->shape_filter[j]
|
||||||
|
.audio_in_state_1[channel] -
|
||||||
|
shape_filter_block->shape_filter[j].a1 *
|
||||||
|
shape_filter_block->shape_filter[j]
|
||||||
|
.audio_out_state_1[channel];
|
||||||
shape_filter_block->shape_filter[j].audio_in_state_1[channel] = tmp;
|
shape_filter_block->shape_filter[j].audio_in_state_1[channel] = tmp;
|
||||||
shape_filter_block->shape_filter[j].audio_out_state_1[channel] = audio_out;
|
shape_filter_block->shape_filter[j].audio_out_state_1[channel] =
|
||||||
|
audio_out;
|
||||||
|
|
||||||
}
|
} else if (shape_filter_block->shape_filter[j].type ==
|
||||||
else if(shape_filter_block->shape_filter[j].type==SHAPE_FILTER_TYPE_HF_CUT||shape_filter_block->shape_filter[j].type==SHAPE_FILTER_TYPE_HF_BOOST){
|
SHAPE_FILTER_TYPE_HF_CUT ||
|
||||||
|
shape_filter_block->shape_filter[j].type ==
|
||||||
audio_out = shape_filter_block->shape_filter[j].g_norm * tmp + shape_filter_block->shape_filter[j].b1 * shape_filter_block->shape_filter[j].audio_in_state_1[channel]
|
SHAPE_FILTER_TYPE_HF_BOOST) {
|
||||||
+ shape_filter_block->shape_filter[j].b2 * shape_filter_block->shape_filter[j].audio_in_state_2[channel]
|
audio_out = shape_filter_block->shape_filter[j].g_norm * tmp +
|
||||||
- shape_filter_block->shape_filter[j].a1 * shape_filter_block->shape_filter[j].audio_out_state_1[channel]
|
shape_filter_block->shape_filter[j].b1 *
|
||||||
- shape_filter_block->shape_filter[j].a2 * shape_filter_block->shape_filter[j].audio_out_state_2[channel];
|
shape_filter_block->shape_filter[j]
|
||||||
shape_filter_block->shape_filter[j].audio_in_state_2[channel] = shape_filter_block->shape_filter[j].audio_in_state_1[channel];
|
.audio_in_state_1[channel] +
|
||||||
shape_filter_block->shape_filter[j].audio_in_state_1[channel] = shape_filter_block->shape_filter[j].g_norm * tmp;
|
shape_filter_block->shape_filter[j].b2 *
|
||||||
shape_filter_block->shape_filter[j].audio_out_state_2[channel] = shape_filter_block->shape_filter[j].audio_out_state_1[channel];
|
shape_filter_block->shape_filter[j]
|
||||||
shape_filter_block->shape_filter[j].audio_out_state_1[channel] = audio_out;
|
.audio_in_state_2[channel] -
|
||||||
}
|
shape_filter_block->shape_filter[j].a1 *
|
||||||
else
|
shape_filter_block->shape_filter[j]
|
||||||
{
|
.audio_out_state_1[channel] -
|
||||||
|
shape_filter_block->shape_filter[j].a2 *
|
||||||
|
shape_filter_block->shape_filter[j]
|
||||||
|
.audio_out_state_2[channel];
|
||||||
|
shape_filter_block->shape_filter[j].audio_in_state_2[channel] =
|
||||||
|
shape_filter_block->shape_filter[j].audio_in_state_1[channel];
|
||||||
|
shape_filter_block->shape_filter[j].audio_in_state_1[channel] =
|
||||||
|
shape_filter_block->shape_filter[j].g_norm * tmp;
|
||||||
|
shape_filter_block->shape_filter[j].audio_out_state_2[channel] =
|
||||||
|
shape_filter_block->shape_filter[j].audio_out_state_1[channel];
|
||||||
|
shape_filter_block->shape_filter[j].audio_out_state_1[channel] =
|
||||||
|
audio_out;
|
||||||
|
} else {
|
||||||
audio_out = tmp;
|
audio_out = tmp;
|
||||||
}
|
}
|
||||||
tmp = audio_out;
|
tmp = audio_out;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
audio_in[i] = audio_out * drc_gain[i];
|
audio_in[i] = audio_out * drc_gain[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else{
|
for (i = start; i < end; i++) {
|
||||||
for (i=start; i<end; i++){
|
|
||||||
audio_in[i] = audio_in[i] * drc_gain[i];
|
audio_in[i] = audio_in[i] * drc_gain[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -20,10 +20,8 @@
|
||||||
#ifndef IMPD_DRC_STURCT_H
|
#ifndef IMPD_DRC_STURCT_H
|
||||||
#define IMPD_DRC_STURCT_H
|
#define IMPD_DRC_STURCT_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define METHOD_DEFINITION_UNKNOWN_OTHER 0
|
#define METHOD_DEFINITION_UNKNOWN_OTHER 0
|
||||||
|
|
@ -42,7 +40,8 @@ extern "C"
|
||||||
#define MEASUREMENT_SYSTEM_BS_1770_4 2
|
#define MEASUREMENT_SYSTEM_BS_1770_4 2
|
||||||
#define MEASUREMENT_SYSTEM_BS_1770_3 MEASUREMENT_SYSTEM_BS_1770_4
|
#define MEASUREMENT_SYSTEM_BS_1770_3 MEASUREMENT_SYSTEM_BS_1770_4
|
||||||
#define MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING 3
|
#define MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING 3
|
||||||
#define MEASUREMENT_SYSTEM_BS_1770_3_PRE_PROCESSING MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING
|
#define MEASUREMENT_SYSTEM_BS_1770_3_PRE_PROCESSING \
|
||||||
|
MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING
|
||||||
#define MEASUREMENT_SYSTEM_USER 4
|
#define MEASUREMENT_SYSTEM_USER 4
|
||||||
#define MEASUREMENT_SYSTEM_EXPERT_PANEL 5
|
#define MEASUREMENT_SYSTEM_EXPERT_PANEL 5
|
||||||
#define MEASUREMENT_SYSTEM_BS_1771_1 6
|
#define MEASUREMENT_SYSTEM_BS_1771_1 6
|
||||||
|
|
@ -219,7 +218,8 @@ typedef struct {
|
||||||
WORD32 parametric_drc_preset_id;
|
WORD32 parametric_drc_preset_id;
|
||||||
WORD32 parametric_drc_type;
|
WORD32 parametric_drc_type;
|
||||||
WORD32 len_bit_size;
|
WORD32 len_bit_size;
|
||||||
ia_parametric_drc_type_feed_forward_struct str_parametric_drc_type_feed_forward;
|
ia_parametric_drc_type_feed_forward_struct
|
||||||
|
str_parametric_drc_type_feed_forward;
|
||||||
ia_parametric_drc_lim_struct parametric_drc_lim;
|
ia_parametric_drc_lim_struct parametric_drc_lim;
|
||||||
|
|
||||||
WORD32 drc_characteristic;
|
WORD32 drc_characteristic;
|
||||||
|
|
@ -246,7 +246,8 @@ typedef struct {
|
||||||
WORD32 parametric_drc_delay_max;
|
WORD32 parametric_drc_delay_max;
|
||||||
WORD32 reset_parametric_drc;
|
WORD32 reset_parametric_drc;
|
||||||
WORD32 parametric_drc_gain_set_count;
|
WORD32 parametric_drc_gain_set_count;
|
||||||
ia_parametric_drc_gain_set_params_struct str_parametric_drc_gain_set_params[SEQUENCE_COUNT_MAX];
|
ia_parametric_drc_gain_set_params_struct
|
||||||
|
str_parametric_drc_gain_set_params[SEQUENCE_COUNT_MAX];
|
||||||
} ia_drc_coeff_parametric_drc_struct;
|
} ia_drc_coeff_parametric_drc_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -282,17 +283,17 @@ typedef struct {
|
||||||
} ia_ducking_modifiers_struct;
|
} ia_ducking_modifiers_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 target_characteristic_left_present [DRC_BAND_COUNT_MAX];
|
WORD32 target_characteristic_left_present[DRC_BAND_COUNT_MAX];
|
||||||
WORD32 target_characteristic_left_index [DRC_BAND_COUNT_MAX];
|
WORD32 target_characteristic_left_index[DRC_BAND_COUNT_MAX];
|
||||||
WORD32 target_characteristic_right_present[DRC_BAND_COUNT_MAX];
|
WORD32 target_characteristic_right_present[DRC_BAND_COUNT_MAX];
|
||||||
WORD32 target_characteristic_right_index [DRC_BAND_COUNT_MAX];
|
WORD32 target_characteristic_right_index[DRC_BAND_COUNT_MAX];
|
||||||
WORD32 shape_filter_flag;
|
WORD32 shape_filter_flag;
|
||||||
WORD32 shape_filter_idx;
|
WORD32 shape_filter_idx;
|
||||||
WORD32 gain_scaling_flag [BAND_COUNT_MAX];
|
WORD32 gain_scaling_flag[BAND_COUNT_MAX];
|
||||||
FLOAT32 attn_scaling [BAND_COUNT_MAX];
|
FLOAT32 attn_scaling[BAND_COUNT_MAX];
|
||||||
FLOAT32 ampl_scaling[BAND_COUNT_MAX];
|
FLOAT32 ampl_scaling[BAND_COUNT_MAX];
|
||||||
WORD32 gain_offset_flag [BAND_COUNT_MAX];
|
WORD32 gain_offset_flag[BAND_COUNT_MAX];
|
||||||
FLOAT32 gain_offset [BAND_COUNT_MAX];
|
FLOAT32 gain_offset[BAND_COUNT_MAX];
|
||||||
} ia_gain_modifiers_struct;
|
} ia_gain_modifiers_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -318,8 +319,8 @@ typedef struct {
|
||||||
FLOAT32 exp;
|
FLOAT32 exp;
|
||||||
WORD32 flip_sign;
|
WORD32 flip_sign;
|
||||||
WORD32 characteristic_node_count;
|
WORD32 characteristic_node_count;
|
||||||
FLOAT32 node_level[SPLIT_CHARACTERISTIC_NODE_COUNT_MAX+1];
|
FLOAT32 node_level[SPLIT_CHARACTERISTIC_NODE_COUNT_MAX + 1];
|
||||||
FLOAT32 node_gain [SPLIT_CHARACTERISTIC_NODE_COUNT_MAX+1];
|
FLOAT32 node_gain[SPLIT_CHARACTERISTIC_NODE_COUNT_MAX + 1];
|
||||||
} ia_split_drc_characteristic_struct;
|
} ia_split_drc_characteristic_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -352,13 +353,16 @@ typedef struct {
|
||||||
ia_gain_set_params_struct gain_set_params[GAIN_SET_COUNT_MAX];
|
ia_gain_set_params_struct gain_set_params[GAIN_SET_COUNT_MAX];
|
||||||
WORD32 drc_characteristic_left_present;
|
WORD32 drc_characteristic_left_present;
|
||||||
WORD32 characteristic_left_count;
|
WORD32 characteristic_left_count;
|
||||||
ia_split_drc_characteristic_struct str_split_characteristic_left [SPLIT_CHARACTERISTIC_COUNT_MAX];
|
ia_split_drc_characteristic_struct
|
||||||
|
str_split_characteristic_left[SPLIT_CHARACTERISTIC_COUNT_MAX];
|
||||||
WORD32 drc_characteristic_right_present;
|
WORD32 drc_characteristic_right_present;
|
||||||
WORD32 characteristic_right_count;
|
WORD32 characteristic_right_count;
|
||||||
ia_split_drc_characteristic_struct str_split_characteristic_right[SPLIT_CHARACTERISTIC_COUNT_MAX];
|
ia_split_drc_characteristic_struct
|
||||||
|
str_split_characteristic_right[SPLIT_CHARACTERISTIC_COUNT_MAX];
|
||||||
WORD32 shape_filters_present;
|
WORD32 shape_filters_present;
|
||||||
WORD32 shape_num_filter;
|
WORD32 shape_num_filter;
|
||||||
ia_shape_filter_block_params_struct str_shape_filter_block_params[SHAPE_FILTER_COUNT_MAX+1];
|
ia_shape_filter_block_params_struct
|
||||||
|
str_shape_filter_block_params[SHAPE_FILTER_COUNT_MAX + 1];
|
||||||
WORD32 gain_sequence_count;
|
WORD32 gain_sequence_count;
|
||||||
WORD32 gain_set_params_index_for_gain_sequence[SEQUENCE_COUNT_MAX];
|
WORD32 gain_set_params_index_for_gain_sequence[SEQUENCE_COUNT_MAX];
|
||||||
WORD32 gain_set_count_plus;
|
WORD32 gain_set_count_plus;
|
||||||
|
|
@ -392,8 +396,10 @@ typedef struct {
|
||||||
WORD32 no_independent_use;
|
WORD32 no_independent_use;
|
||||||
WORD32 drc_set_effect;
|
WORD32 drc_set_effect;
|
||||||
WORD32 gain_set_index[MAX_CHANNEL_COUNT];
|
WORD32 gain_set_index[MAX_CHANNEL_COUNT];
|
||||||
ia_gain_modifiers_struct str_gain_modifiers_of_ch_group[CHANNEL_GROUP_COUNT_MAX];
|
ia_gain_modifiers_struct
|
||||||
ia_ducking_modifiers_struct str_ducking_modifiers_for_channel[MAX_CHANNEL_COUNT];
|
str_gain_modifiers_of_ch_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
|
ia_ducking_modifiers_struct
|
||||||
|
str_ducking_modifiers_for_channel[MAX_CHANNEL_COUNT];
|
||||||
WORD32 limiter_peak_target_present;
|
WORD32 limiter_peak_target_present;
|
||||||
FLOAT32 limiter_peak_target;
|
FLOAT32 limiter_peak_target;
|
||||||
WORD32 drc_set_target_loudness_present;
|
WORD32 drc_set_target_loudness_present;
|
||||||
|
|
@ -408,7 +414,8 @@ typedef struct {
|
||||||
WORD32 gain_interpolation_type_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 gain_interpolation_type_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 time_delta_min_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 time_delta_min_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 time_alignment_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 time_alignment_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
ia_ducking_modifiers_struct str_ducking_modifiers_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
ia_ducking_modifiers_struct
|
||||||
|
str_ducking_modifiers_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 channel_group_of_ch[MAX_CHANNEL_COUNT];
|
WORD32 channel_group_of_ch[MAX_CHANNEL_COUNT];
|
||||||
WORD32 num_chan_per_ch_group[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 num_chan_per_ch_group[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 gain_element_count;
|
WORD32 gain_element_count;
|
||||||
|
|
@ -444,22 +451,22 @@ typedef struct {
|
||||||
WORD32 loud_eq_set_id;
|
WORD32 loud_eq_set_id;
|
||||||
WORD32 drc_location;
|
WORD32 drc_location;
|
||||||
WORD32 dwnmix_id_count;
|
WORD32 dwnmix_id_count;
|
||||||
WORD32 downmix_id [DOWNMIX_ID_COUNT_MAX];
|
WORD32 downmix_id[DOWNMIX_ID_COUNT_MAX];
|
||||||
WORD32 drc_set_id_count;
|
WORD32 drc_set_id_count;
|
||||||
WORD32 drc_set_id [DRC_SET_ID_COUNT_MAX];
|
WORD32 drc_set_id[DRC_SET_ID_COUNT_MAX];
|
||||||
WORD32 eq_set_id_count;
|
WORD32 eq_set_id_count;
|
||||||
WORD32 eq_set_id [EQ_SET_ID_COUNT_MAX];
|
WORD32 eq_set_id[EQ_SET_ID_COUNT_MAX];
|
||||||
WORD32 loudness_after_drc;
|
WORD32 loudness_after_drc;
|
||||||
WORD32 loudness_after_eq;
|
WORD32 loudness_after_eq;
|
||||||
WORD32 loud_eq_gain_sequence_count;
|
WORD32 loud_eq_gain_sequence_count;
|
||||||
WORD32 gain_seq_idx [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 gain_seq_idx[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
WORD32 drc_characteristic_format_is_cicp [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 drc_characteristic_format_is_cicp[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
WORD32 drc_characteristic [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 drc_characteristic[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
WORD32 drc_characteristic_left_index [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 drc_characteristic_left_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
WORD32 drc_characteristic_right_index [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 drc_characteristic_right_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
WORD32 frequency_range_index [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
WORD32 frequency_range_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
FLOAT32 loud_eq_scaling [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
FLOAT32 loud_eq_scaling[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
FLOAT32 loud_eq_offset [LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
FLOAT32 loud_eq_offset[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
|
||||||
} ia_loud_eq_instructions_struct;
|
} ia_loud_eq_instructions_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -480,43 +487,45 @@ typedef struct {
|
||||||
WORD32 generic_zero_count;
|
WORD32 generic_zero_count;
|
||||||
WORD32 real_pole_count;
|
WORD32 real_pole_count;
|
||||||
WORD32 cmplx_pole_count;
|
WORD32 cmplx_pole_count;
|
||||||
WORD32 zero_sign [REAL_ZERO_RADIUS_ONE_COUNT_MAX];
|
WORD32 zero_sign[REAL_ZERO_RADIUS_ONE_COUNT_MAX];
|
||||||
FLOAT32 real_zero_radius [REAL_ZERO_COUNT_MAX];
|
FLOAT32 real_zero_radius[REAL_ZERO_COUNT_MAX];
|
||||||
FLOAT32 generic_zero_radius [COMPLEX_ZERO_COUNT_MAX];
|
FLOAT32 generic_zero_radius[COMPLEX_ZERO_COUNT_MAX];
|
||||||
FLOAT32 generic_zero_angle [COMPLEX_ZERO_COUNT_MAX];
|
FLOAT32 generic_zero_angle[COMPLEX_ZERO_COUNT_MAX];
|
||||||
FLOAT32 real_pole_radius [REAL_POLE_COUNT_MAX];
|
FLOAT32 real_pole_radius[REAL_POLE_COUNT_MAX];
|
||||||
FLOAT32 complex_pole_radius [COMPLEX_POLE_COUNT_MAX];
|
FLOAT32 complex_pole_radius[COMPLEX_POLE_COUNT_MAX];
|
||||||
FLOAT32 complex_pole_angle [COMPLEX_POLE_COUNT_MAX];
|
FLOAT32 complex_pole_angle[COMPLEX_POLE_COUNT_MAX];
|
||||||
WORD32 fir_filt_order;
|
WORD32 fir_filt_order;
|
||||||
WORD32 fir_symmetry;
|
WORD32 fir_symmetry;
|
||||||
FLOAT32 fir_coeff [FIR_ORDER_MAX/2];
|
FLOAT32 fir_coeff[FIR_ORDER_MAX / 2];
|
||||||
} ia_unique_td_filt_element;
|
} ia_unique_td_filt_element;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 num_eq_nodes;
|
WORD32 num_eq_nodes;
|
||||||
FLOAT32 eq_slope [EQ_NODE_COUNT_MAX];
|
FLOAT32 eq_slope[EQ_NODE_COUNT_MAX];
|
||||||
WORD32 eq_freq_delta [EQ_NODE_COUNT_MAX];
|
WORD32 eq_freq_delta[EQ_NODE_COUNT_MAX];
|
||||||
FLOAT32 eq_gain_initial;
|
FLOAT32 eq_gain_initial;
|
||||||
FLOAT32 eq_gain_delta [EQ_NODE_COUNT_MAX];
|
FLOAT32 eq_gain_delta[EQ_NODE_COUNT_MAX];
|
||||||
} ia_eq_subband_gain_spline_struct;
|
} ia_eq_subband_gain_spline_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FLOAT32 eq_subband_gain [EQ_SUBBAND_GAIN_COUNT_MAX];
|
FLOAT32 eq_subband_gain[EQ_SUBBAND_GAIN_COUNT_MAX];
|
||||||
} ia_eq_subband_gain_vector;
|
} ia_eq_subband_gain_vector;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 eq_delay_max_present;
|
WORD32 eq_delay_max_present;
|
||||||
WORD32 eq_delay_max;
|
WORD32 eq_delay_max;
|
||||||
WORD32 unique_filter_block_count;
|
WORD32 unique_filter_block_count;
|
||||||
ia_filt_block_struct str_filter_block [FILTER_BLOCK_COUNT_MAX];
|
ia_filt_block_struct str_filter_block[FILTER_BLOCK_COUNT_MAX];
|
||||||
WORD32 unique_td_filter_element_count;
|
WORD32 unique_td_filter_element_count;
|
||||||
ia_unique_td_filt_element unique_td_filt_ele [FILTER_ELEMENT_COUNT_MAX];
|
ia_unique_td_filt_element unique_td_filt_ele[FILTER_ELEMENT_COUNT_MAX];
|
||||||
WORD32 unique_eq_subband_gains_count;
|
WORD32 unique_eq_subband_gains_count;
|
||||||
WORD32 eq_subband_gain_representation;
|
WORD32 eq_subband_gain_representation;
|
||||||
WORD32 eq_subband_gain_format;
|
WORD32 eq_subband_gain_format;
|
||||||
WORD32 eq_subband_gain_count;
|
WORD32 eq_subband_gain_count;
|
||||||
ia_eq_subband_gain_spline_struct str_eq_subband_gain_spline [UNIQUE_SUBBAND_GAIN_COUNT_MAX];
|
ia_eq_subband_gain_spline_struct
|
||||||
ia_eq_subband_gain_vector str_eq_subband_gain_vector [UNIQUE_SUBBAND_GAIN_COUNT_MAX];
|
str_eq_subband_gain_spline[UNIQUE_SUBBAND_GAIN_COUNT_MAX];
|
||||||
|
ia_eq_subband_gain_vector
|
||||||
|
str_eq_subband_gain_vector[UNIQUE_SUBBAND_GAIN_COUNT_MAX];
|
||||||
} ia_eq_coeff_struct;
|
} ia_eq_coeff_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -525,11 +534,12 @@ typedef struct {
|
||||||
} ia_filter_block_refs_struct;
|
} ia_filter_block_refs_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 eq_cascade_gain_present [EQ_CHANNEL_GROUP_COUNT_MAX];
|
WORD32 eq_cascade_gain_present[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
FLOAT32 eq_cascade_gain [EQ_CHANNEL_GROUP_COUNT_MAX];
|
FLOAT32 eq_cascade_gain[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
ia_filter_block_refs_struct str_filter_block_refs [EQ_CHANNEL_GROUP_COUNT_MAX];
|
ia_filter_block_refs_struct str_filter_block_refs[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 eq_phase_alignment_present;
|
WORD32 eq_phase_alignment_present;
|
||||||
WORD32 eq_phase_alignment [EQ_CHANNEL_GROUP_COUNT_MAX][EQ_CHANNEL_GROUP_COUNT_MAX];
|
WORD32 eq_phase_alignment[EQ_CHANNEL_GROUP_COUNT_MAX]
|
||||||
|
[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
} ia_td_filter_cascade_struct;
|
} ia_td_filter_cascade_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -546,34 +556,36 @@ typedef struct {
|
||||||
WORD32 no_independent_eq_use;
|
WORD32 no_independent_eq_use;
|
||||||
WORD32 eq_channel_count;
|
WORD32 eq_channel_count;
|
||||||
WORD32 eq_ch_group_count;
|
WORD32 eq_ch_group_count;
|
||||||
WORD32 eq_ch_group_of_channel [MAX_CHANNEL_COUNT];
|
WORD32 eq_ch_group_of_channel[MAX_CHANNEL_COUNT];
|
||||||
WORD32 td_filter_cascade_present;
|
WORD32 td_filter_cascade_present;
|
||||||
ia_td_filter_cascade_struct str_td_filter_cascade;
|
ia_td_filter_cascade_struct str_td_filter_cascade;
|
||||||
WORD32 subband_gains_present;
|
WORD32 subband_gains_present;
|
||||||
WORD32 subband_gains_index [EQ_CHANNEL_GROUP_COUNT_MAX];
|
WORD32 subband_gains_index[EQ_CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 eq_transition_duration_present;
|
WORD32 eq_transition_duration_present;
|
||||||
WORD32 eq_transition_duration;
|
WORD32 eq_transition_duration;
|
||||||
} ia_eq_instructions_struct;
|
} ia_eq_instructions_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_config_ext_type[EXT_COUNT_MAX];
|
WORD32 drc_config_ext_type[EXT_COUNT_MAX];
|
||||||
WORD32 ext_bit_size[EXT_COUNT_MAX-1];
|
WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
|
||||||
|
|
||||||
WORD32 parametric_drc_present;
|
WORD32 parametric_drc_present;
|
||||||
ia_drc_coeff_parametric_drc_struct str_drc_coeff_param_drc;
|
ia_drc_coeff_parametric_drc_struct str_drc_coeff_param_drc;
|
||||||
WORD32 parametric_drc_instructions_count;
|
WORD32 parametric_drc_instructions_count;
|
||||||
ia_parametric_drc_instructions_struct str_parametric_drc_instructions[PARAM_DRC_INSTRUCTIONS_COUNT_MAX];
|
ia_parametric_drc_instructions_struct
|
||||||
|
str_parametric_drc_instructions[PARAM_DRC_INSTRUCTIONS_COUNT_MAX];
|
||||||
WORD32 drc_extension_v1_present;
|
WORD32 drc_extension_v1_present;
|
||||||
WORD32 loud_eq_instructions_flag;
|
WORD32 loud_eq_instructions_flag;
|
||||||
WORD32 loud_eq_instructions_count;
|
WORD32 loud_eq_instructions_count;
|
||||||
ia_loud_eq_instructions_struct loud_eq_instructions [LOUD_EQ_INSTRUCTIONS_COUNT_MAX];
|
ia_loud_eq_instructions_struct
|
||||||
|
loud_eq_instructions[LOUD_EQ_INSTRUCTIONS_COUNT_MAX];
|
||||||
WORD32 eq_flag;
|
WORD32 eq_flag;
|
||||||
ia_eq_coeff_struct str_eq_coeff;
|
ia_eq_coeff_struct str_eq_coeff;
|
||||||
WORD32 eq_instructions_count;
|
WORD32 eq_instructions_count;
|
||||||
ia_eq_instructions_struct str_eq_instructions [EQ_INSTRUCTIONS_COUNT_MAX];
|
ia_eq_instructions_struct str_eq_instructions[EQ_INSTRUCTIONS_COUNT_MAX];
|
||||||
} ia_drc_config_ext;
|
} ia_drc_config_ext;
|
||||||
|
|
||||||
typedef struct ia_drc_config{
|
typedef struct ia_drc_config {
|
||||||
WORD32 sample_rate_present;
|
WORD32 sample_rate_present;
|
||||||
WORD32 sampling_rate;
|
WORD32 sampling_rate;
|
||||||
WORD32 dwnmix_instructions_count;
|
WORD32 dwnmix_instructions_count;
|
||||||
|
|
@ -586,20 +598,25 @@ typedef struct ia_drc_config{
|
||||||
WORD32 drc_config_ext_present;
|
WORD32 drc_config_ext_present;
|
||||||
WORD32 apply_drc;
|
WORD32 apply_drc;
|
||||||
ia_drc_config_ext str_drc_config_ext;
|
ia_drc_config_ext str_drc_config_ext;
|
||||||
ia_drc_coefficients_basic_struct str_drc_coefficients_basic[DRC_COEFF_COUNT_MAX];
|
ia_drc_coefficients_basic_struct
|
||||||
ia_drc_instructions_basic_struct str_drc_instructions_basic[DRC_INSTRUCTIONS_COUNT_MAX];
|
str_drc_coefficients_basic[DRC_COEFF_COUNT_MAX];
|
||||||
ia_uni_drc_coeffs_struct str_p_loc_drc_coefficients_uni_drc[DRC_COEFF_COUNT_MAX];
|
ia_drc_instructions_basic_struct
|
||||||
ia_drc_instructions_struct str_drc_instruction_str[DRC_INSTRUCTIONS_COUNT_MAX];
|
str_drc_instructions_basic[DRC_INSTRUCTIONS_COUNT_MAX];
|
||||||
|
ia_uni_drc_coeffs_struct
|
||||||
|
str_p_loc_drc_coefficients_uni_drc[DRC_COEFF_COUNT_MAX];
|
||||||
|
ia_drc_instructions_struct
|
||||||
|
str_drc_instruction_str[DRC_INSTRUCTIONS_COUNT_MAX];
|
||||||
ia_channel_layout_struct channel_layout;
|
ia_channel_layout_struct channel_layout;
|
||||||
ia_downmix_instructions_struct dwnmix_instructions[DOWNMIX_INSTRUCTION_COUNT_MAX];
|
ia_downmix_instructions_struct
|
||||||
|
dwnmix_instructions[DOWNMIX_INSTRUCTION_COUNT_MAX];
|
||||||
} ia_drc_config;
|
} ia_drc_config;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 loudness_info_set_ext_type[EXT_COUNT_MAX];
|
WORD32 loudness_info_set_ext_type[EXT_COUNT_MAX];
|
||||||
WORD32 ext_bit_size[EXT_COUNT_MAX-1];
|
WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
|
||||||
} ia_loudness_info_set_ext_struct;
|
} ia_loudness_info_set_ext_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_loudness_info_set_struct{
|
typedef struct ia_drc_loudness_info_set_struct {
|
||||||
WORD32 loudness_info_album_count;
|
WORD32 loudness_info_album_count;
|
||||||
WORD32 loudness_info_count;
|
WORD32 loudness_info_count;
|
||||||
WORD32 loudness_info_set_ext_present;
|
WORD32 loudness_info_set_ext_present;
|
||||||
|
|
@ -621,15 +638,15 @@ typedef struct {
|
||||||
} ia_spline_nodes_struct;
|
} ia_spline_nodes_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_spline_nodes_struct str_spline_nodes [1];
|
ia_spline_nodes_struct str_spline_nodes[1];
|
||||||
} ia_drc_gain_sequence_struct;
|
} ia_drc_gain_sequence_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 uni_drc_gain_ext_type[EXT_COUNT_MAX];
|
WORD32 uni_drc_gain_ext_type[EXT_COUNT_MAX];
|
||||||
WORD32 ext_bit_size[EXT_COUNT_MAX-1];
|
WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
|
||||||
} ia_uni_drc_gain_ext_struct;
|
} ia_uni_drc_gain_ext_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_gain_struct{
|
typedef struct ia_drc_gain_struct {
|
||||||
WORD32 num_drc_gain_sequences;
|
WORD32 num_drc_gain_sequences;
|
||||||
ia_drc_gain_sequence_struct drc_gain_sequence[SEQUENCE_COUNT_MAX];
|
ia_drc_gain_sequence_struct drc_gain_sequence[SEQUENCE_COUNT_MAX];
|
||||||
WORD32 uni_drc_gain_ext_flag;
|
WORD32 uni_drc_gain_ext_flag;
|
||||||
|
|
@ -645,14 +662,11 @@ typedef struct {
|
||||||
WORD32 lfe_channel_map[MAX_CHANNEL_COUNT];
|
WORD32 lfe_channel_map[MAX_CHANNEL_COUNT];
|
||||||
} ia_drc_params_bs_dec_struct;
|
} ia_drc_params_bs_dec_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_bits_dec_struct
|
typedef struct ia_drc_bits_dec_struct {
|
||||||
{
|
|
||||||
|
|
||||||
ia_tables_struct tables_default;
|
ia_tables_struct tables_default;
|
||||||
ia_drc_params_bs_dec_struct ia_drc_params_struct;
|
ia_drc_params_bs_dec_struct ia_drc_params_struct;
|
||||||
|
|
||||||
}ia_drc_bits_dec_struct;
|
} ia_drc_bits_dec_struct;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,47 +28,39 @@
|
||||||
#include "impd_drc_rom.h"
|
#include "impd_drc_rom.h"
|
||||||
|
|
||||||
WORD32 impd_init_tbls(const WORD32 num_gain_max_values,
|
WORD32 impd_init_tbls(const WORD32 num_gain_max_values,
|
||||||
ia_tables_struct* str_tables)
|
ia_tables_struct* str_tables) {
|
||||||
{
|
impd_gen_delta_time_code_tbl(num_gain_max_values,
|
||||||
impd_gen_delta_time_code_tbl (num_gain_max_values,
|
|
||||||
str_tables->delta_time_code_table);
|
str_tables->delta_time_code_table);
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void impd_get_slope_code_tbl_and_size(ia_slope_code_table_struct const** slope_code_tbl_entry,
|
void impd_get_slope_code_tbl_and_size(
|
||||||
WORD32* num_slope_code_tbl_entries)
|
ia_slope_code_table_struct const** slope_code_tbl_entry,
|
||||||
{
|
WORD32* num_slope_code_tbl_entries) {
|
||||||
*slope_code_tbl_entry = &(slopeCodeTableEntryBySize[0]);
|
*slope_code_tbl_entry = &(slopeCodeTableEntryBySize[0]);
|
||||||
*num_slope_code_tbl_entries = kNumSlopeValuesTable;
|
*num_slope_code_tbl_entries = kNumSlopeValuesTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void impd_get_delta_gain_code_tbl(
|
||||||
void
|
const WORD32 gain_coding_profile,
|
||||||
impd_get_delta_gain_code_tbl(const WORD32 gain_coding_profile,
|
|
||||||
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
||||||
WORD32 *num_entries)
|
WORD32* num_entries) {
|
||||||
{
|
if (gain_coding_profile == GAIN_CODING_PROFILE_CLIPPING) {
|
||||||
if (gain_coding_profile==GAIN_CODING_PROFILE_CLIPPING)
|
|
||||||
{
|
|
||||||
*delta_time_code_tbl = deltaGainCodeTableProfile2BySize;
|
*delta_time_code_tbl = deltaGainCodeTableProfile2BySize;
|
||||||
*num_entries = kNumDeltaGainValuesTableProfile2;
|
*num_entries = kNumDeltaGainValuesTableProfile2;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
*delta_time_code_tbl = deltaGainCodeTableBySize;
|
*delta_time_code_tbl = deltaGainCodeTableBySize;
|
||||||
*num_entries = kNumDeltaGainValuesTable;
|
*num_entries = kNumDeltaGainValuesTable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void impd_gen_delta_time_code_tbl(
|
||||||
impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
const WORD32 num_gain_max_values,
|
||||||
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item)
|
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item) {
|
||||||
{
|
|
||||||
WORD32 n, k;
|
WORD32 n, k;
|
||||||
|
|
||||||
WORD32 Z = 1;
|
WORD32 Z = 1;
|
||||||
while((1<<Z)<2*num_gain_max_values)
|
while ((1 << Z) < 2 * num_gain_max_values) {
|
||||||
{
|
|
||||||
Z++;
|
Z++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,42 +71,32 @@ impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
||||||
delta_time_code_tbl_item[1].size = 2;
|
delta_time_code_tbl_item[1].size = 2;
|
||||||
delta_time_code_tbl_item[1].code = 0x0;
|
delta_time_code_tbl_item[1].code = 0x0;
|
||||||
delta_time_code_tbl_item[1].value = 1;
|
delta_time_code_tbl_item[1].value = 1;
|
||||||
for (n=0; n<4; n++)
|
for (n = 0; n < 4; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 2].size = 4;
|
||||||
delta_time_code_tbl_item[n+2].size = 4;
|
delta_time_code_tbl_item[n + 2].code = 0x4 + n;
|
||||||
delta_time_code_tbl_item[n+2].code = 0x4 + n;
|
delta_time_code_tbl_item[n + 2].value = n + 2;
|
||||||
delta_time_code_tbl_item[n+2].value = n+2;
|
|
||||||
}
|
}
|
||||||
for (n=0; n<8; n++)
|
for (n = 0; n < 8; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 6].size = 5;
|
||||||
delta_time_code_tbl_item[n+6].size = 5;
|
delta_time_code_tbl_item[n + 6].code = 0x10 + n;
|
||||||
delta_time_code_tbl_item[n+6].code = 0x10 + n;
|
delta_time_code_tbl_item[n + 6].value = n + 6;
|
||||||
delta_time_code_tbl_item[n+6].value = n+6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
k = 2*num_gain_max_values-14+1;
|
k = 2 * num_gain_max_values - 14 + 1;
|
||||||
for (n=0; n<k; n++)
|
for (n = 0; n < k; n++) {
|
||||||
{
|
delta_time_code_tbl_item[n + 14].size = 2 + Z;
|
||||||
delta_time_code_tbl_item[n+14].size = 2+Z;
|
delta_time_code_tbl_item[n + 14].code = (0x3 << Z) + n;
|
||||||
delta_time_code_tbl_item[n+14].code = (0x3<<Z) + n;
|
delta_time_code_tbl_item[n + 14].value = n + 14;
|
||||||
delta_time_code_tbl_item[n+14].value = n+14;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_delta_tmin (const WORD32 sampling_rate)
|
impd_get_delta_tmin(const WORD32 sampling_rate) {
|
||||||
{
|
WORD32 lowerBound = (WORD32)(0.5f + 0.0005f * sampling_rate);
|
||||||
WORD32 lowerBound = (WORD32) (0.5f + 0.0005f * sampling_rate);
|
|
||||||
WORD32 result = 1;
|
WORD32 result = 1;
|
||||||
if (sampling_rate < 1000)
|
if (sampling_rate < 1000) {
|
||||||
{
|
return (UNEXPECTED_ERROR);
|
||||||
return(UNEXPECTED_ERROR);
|
|
||||||
}
|
}
|
||||||
while (result <= lowerBound) result = result << 1;
|
while (result <= lowerBound) result = result << 1;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,23 +20,24 @@
|
||||||
#ifndef IMPD_DRC_TABLES_H
|
#ifndef IMPD_DRC_TABLES_H
|
||||||
#define IMPD_DRC_TABLES_H
|
#define IMPD_DRC_TABLES_H
|
||||||
|
|
||||||
const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = {
|
const ia_filter_bank_params_struct
|
||||||
{2.0f/1024.0f, 0.0000373252f, 0.9913600345f},
|
normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = {
|
||||||
{3.0f/1024.0f, 0.0000836207f, 0.9870680830f},
|
{2.0f / 1024.0f, 0.0000373252f, 0.9913600345f},
|
||||||
{4.0f/1024.0f, 0.0001480220f, 0.9827947083f},
|
{3.0f / 1024.0f, 0.0000836207f, 0.9870680830f},
|
||||||
{5.0f/1024.0f, 0.0002302960f, 0.9785398263f},
|
{4.0f / 1024.0f, 0.0001480220f, 0.9827947083f},
|
||||||
{6.0f/1024.0f, 0.0003302134f, 0.9743033527f},
|
{5.0f / 1024.0f, 0.0002302960f, 0.9785398263f},
|
||||||
{2.0f/256.0f, 0.0005820761f, 0.9658852897f},
|
{6.0f / 1024.0f, 0.0003302134f, 0.9743033527f},
|
||||||
{3.0f/256.0f, 0.0012877837f, 0.9492662926f},
|
{2.0f / 256.0f, 0.0005820761f, 0.9658852897f},
|
||||||
{2.0f/128.0f, 0.0022515827f, 0.9329321561f},
|
{3.0f / 256.0f, 0.0012877837f, 0.9492662926f},
|
||||||
{3.0f/128.0f, 0.0049030350f, 0.9010958535f},
|
{2.0f / 128.0f, 0.0022515827f, 0.9329321561f},
|
||||||
{2.0f/64.0f, 0.0084426929f, 0.8703307793f},
|
{3.0f / 128.0f, 0.0049030350f, 0.9010958535f},
|
||||||
{3.0f/64.0f, 0.0178631928f, 0.8118317459f},
|
{2.0f / 64.0f, 0.0084426929f, 0.8703307793f},
|
||||||
{2.0f/32.0f, 0.0299545822f, 0.7570763753f},
|
{3.0f / 64.0f, 0.0178631928f, 0.8118317459f},
|
||||||
{3.0f/32.0f, 0.0604985076f, 0.6574551915f},
|
{2.0f / 32.0f, 0.0299545822f, 0.7570763753f},
|
||||||
{2.0f/16.0f, 0.0976310729f, 0.5690355937f},
|
{3.0f / 32.0f, 0.0604985076f, 0.6574551915f},
|
||||||
{3.0f/16.0f, 0.1866943331f, 0.4181633458f},
|
{2.0f / 16.0f, 0.0976310729f, 0.5690355937f},
|
||||||
{2.0f/8.0f, 0.2928932188f, 0.2928932188f},
|
{3.0f / 16.0f, 0.1866943331f, 0.4181633458f},
|
||||||
|
{2.0f / 8.0f, 0.2928932188f, 0.2928932188f},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,45 +20,32 @@
|
||||||
#ifndef IMPD_DRC_UNI_BITSTREAM_DEC_API_H
|
#ifndef IMPD_DRC_UNI_BITSTREAM_DEC_API_H
|
||||||
#define IMPD_DRC_UNI_BITSTREAM_DEC_API_H
|
#define IMPD_DRC_UNI_BITSTREAM_DEC_API_H
|
||||||
|
|
||||||
|
WORD32 impd_init_drc_bitstream_dec(
|
||||||
WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct, WORD32 sample_rate,
|
||||||
WORD32 sample_rate,
|
WORD32 frame_size, WORD32 delay_mode, WORD32 lfe_channel_map_count,
|
||||||
WORD32 frame_size,
|
|
||||||
WORD32 delay_mode,
|
|
||||||
WORD32 lfe_channel_map_count,
|
|
||||||
WORD32* lfe_channel_map);
|
WORD32* lfe_channel_map);
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
UWORD8* bitstream_config,
|
UWORD8* bitstream_config, WORD32 num_bytes, WORD32 num_bits_offset,
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read);
|
WORD32* num_bits_read);
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_config(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_config(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
UWORD8* bitstream_config,
|
UWORD8* bitstream_config, WORD32 num_bytes);
|
||||||
WORD32 num_bytes);
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_gain(
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_gain_struct* pstr_drc_gain, UWORD8* bitstream_gain, WORD32 num_bytes,
|
||||||
UWORD8* bitstream_gain,
|
WORD32 num_bits_offset, WORD32* num_bits_read);
|
||||||
WORD32 num_bytes,
|
|
||||||
WORD32 num_bits_offset,
|
|
||||||
WORD32* num_bits_read);
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_loudness_info_set(
|
||||||
|
ia_drc_bits_dec_struct* p_uni_drc_bs_dec_struct,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
UWORD8* bitstream_loudness,
|
UWORD8* bitstream_loudness, WORD32 num_bytes_loudness);
|
||||||
WORD32 num_bytes_loudness
|
|
||||||
);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@
|
||||||
#define IMPD_DRC_UNI_COMMON_H
|
#define IMPD_DRC_UNI_COMMON_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define AMD1_SYNTAX 0
|
#define AMD1_SYNTAX 0
|
||||||
|
|
@ -43,7 +42,7 @@ extern "C"
|
||||||
#define ENABLE_ADDITIONAL_TESTS 1
|
#define ENABLE_ADDITIONAL_TESTS 1
|
||||||
|
|
||||||
#define SPEAKER_POS_COUNT_MAX 128
|
#define SPEAKER_POS_COUNT_MAX 128
|
||||||
#define DOWNMIX_COEFF_COUNT_MAX 32*32
|
#define DOWNMIX_COEFF_COUNT_MAX 32 * 32
|
||||||
#define MAX_CHANNEL_COUNT 128
|
#define MAX_CHANNEL_COUNT 128
|
||||||
#define BAND_COUNT_MAX 8
|
#define BAND_COUNT_MAX 8
|
||||||
#define SEQUENCE_COUNT_MAX 24
|
#define SEQUENCE_COUNT_MAX 24
|
||||||
|
|
@ -54,7 +53,7 @@ extern "C"
|
||||||
#define DRC_INSTRUCTIONS_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
#define DRC_INSTRUCTIONS_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
||||||
#define LOUDNESS_INFO_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
#define LOUDNESS_INFO_COUNT_MAX (DOWNMIX_INSTRUCTION_COUNT_MAX + 20)
|
||||||
#define AUDIO_CODEC_FRAME_SIZE_MAX 4096
|
#define AUDIO_CODEC_FRAME_SIZE_MAX 4096
|
||||||
#define DRC_CODEC_FRAME_SIZE_MAX (AUDIO_CODEC_FRAME_SIZE_MAX/8)
|
#define DRC_CODEC_FRAME_SIZE_MAX (AUDIO_CODEC_FRAME_SIZE_MAX / 8)
|
||||||
#define NODE_COUNT_MAX DRC_CODEC_FRAME_SIZE_MAX
|
#define NODE_COUNT_MAX DRC_CODEC_FRAME_SIZE_MAX
|
||||||
#define CHANNEL_GROUP_COUNT_MAX SEQUENCE_COUNT_MAX
|
#define CHANNEL_GROUP_COUNT_MAX SEQUENCE_COUNT_MAX
|
||||||
#define SUB_DRC_COUNT 4
|
#define SUB_DRC_COUNT 4
|
||||||
|
|
@ -62,7 +61,6 @@ extern "C"
|
||||||
#define DOWNMIX_ID_COUNT_MAX 8
|
#define DOWNMIX_ID_COUNT_MAX 8
|
||||||
#define MAX_SIGNAL_DELAY 4500
|
#define MAX_SIGNAL_DELAY 4500
|
||||||
|
|
||||||
|
|
||||||
#define DELAY_MODE_REGULAR_DELAY 0
|
#define DELAY_MODE_REGULAR_DELAY 0
|
||||||
#define DELAY_MODE_LOW_DELAY 1
|
#define DELAY_MODE_LOW_DELAY 1
|
||||||
#define DELAY_MODE_DEFAULT DELAY_MODE_REGULAR_DELAY
|
#define DELAY_MODE_DEFAULT DELAY_MODE_REGULAR_DELAY
|
||||||
|
|
@ -104,7 +102,7 @@ extern "C"
|
||||||
|
|
||||||
#define AUDIO_CODEC_SUBBAND_COUNT_QMF71 71
|
#define AUDIO_CODEC_SUBBAND_COUNT_QMF71 71
|
||||||
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71 64
|
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71 64
|
||||||
#define AUDIO_CODEC_SUBBAND_ANALYSE_DELAY_QMF71 320+384
|
#define AUDIO_CODEC_SUBBAND_ANALYSE_DELAY_QMF71 320 + 384
|
||||||
|
|
||||||
#define AUDIO_CODEC_SUBBAND_COUNT_STFT256 256
|
#define AUDIO_CODEC_SUBBAND_COUNT_STFT256 256
|
||||||
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256 256
|
#define AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256 256
|
||||||
|
|
@ -121,9 +119,6 @@ extern "C"
|
||||||
#define UNIDRCCONFEXT_TERM 0x0
|
#define UNIDRCCONFEXT_TERM 0x0
|
||||||
#define UNIDRCINTERFACEEXT_TERM 0x0
|
#define UNIDRCINTERFACEEXT_TERM 0x0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MAXPACKETLOSSTIME 2.5f
|
#define MAXPACKETLOSSTIME 2.5f
|
||||||
|
|
||||||
#define SLOPE_FACTOR_DB_TO_LINEAR 0.1151f
|
#define SLOPE_FACTOR_DB_TO_LINEAR 0.1151f
|
||||||
|
|
@ -139,8 +134,7 @@ extern "C"
|
||||||
#define bool WORD32
|
#define bool WORD32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct ia_drc_sel_proc_output_struct
|
typedef struct ia_drc_sel_proc_output_struct {
|
||||||
{
|
|
||||||
FLOAT32 output_peak_level_db;
|
FLOAT32 output_peak_level_db;
|
||||||
FLOAT32 loudness_normalization_gain_db;
|
FLOAT32 loudness_normalization_gain_db;
|
||||||
FLOAT32 output_loudness;
|
FLOAT32 output_loudness;
|
||||||
|
|
@ -160,7 +154,6 @@ typedef struct ia_drc_sel_proc_output_struct
|
||||||
FLOAT32 compress;
|
FLOAT32 compress;
|
||||||
WORD32 drc_characteristic_target;
|
WORD32 drc_characteristic_target;
|
||||||
|
|
||||||
|
|
||||||
} ia_drc_sel_proc_output_struct;
|
} ia_drc_sel_proc_output_struct;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -21,22 +21,18 @@
|
||||||
#define IMPD_DRC_UNI_DEC_H
|
#define IMPD_DRC_UNI_DEC_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WORD32 impd_select_drc_coefficients(ia_drc_config* drc_config,
|
WORD32 impd_select_drc_coefficients(
|
||||||
ia_uni_drc_coeffs_struct** drc_coefficients_drc,
|
ia_drc_config* drc_config, ia_uni_drc_coeffs_struct** drc_coefficients_drc,
|
||||||
WORD32* drc_coefficients_selected);
|
WORD32* drc_coefficients_selected);
|
||||||
|
|
||||||
WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
WORD32 impd_init_selected_drc_set(
|
||||||
ia_drc_params_struct* ia_drc_params_struct,
|
ia_drc_config* drc_config, ia_drc_params_struct* ia_drc_params_struct,
|
||||||
WORD32 audio_num_chan,
|
WORD32 audio_num_chan, WORD32 drc_set_id_selected,
|
||||||
WORD32 drc_set_id_selected,
|
WORD32 downmix_id_selected, ia_filter_banks_struct* ia_filter_banks_struct,
|
||||||
WORD32 downmix_id_selected,
|
ia_overlap_params_struct* pstr_overlap_params);
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
|
||||||
ia_overlap_params_struct* pstr_overlap_params
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,11 @@
|
||||||
#define MATCHING_PHASE_FILTER_COUNT_MAX 32
|
#define MATCHING_PHASE_FILTER_COUNT_MAX 32
|
||||||
|
|
||||||
#define EQ_FILTER_DOMAIN_NONE 0
|
#define EQ_FILTER_DOMAIN_NONE 0
|
||||||
#define EQ_FILTER_DOMAIN_TIME (1<<0)
|
#define EQ_FILTER_DOMAIN_TIME (1 << 0)
|
||||||
#define EQ_FILTER_DOMAIN_SUBBAND (1<<1)
|
#define EQ_FILTER_DOMAIN_SUBBAND (1 << 1)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,8 @@
|
||||||
#ifndef IMPD_DRC_UNI_GAIN_DEC_H
|
#ifndef IMPD_DRC_UNI_GAIN_DEC_H
|
||||||
#define IMPD_DRC_UNI_GAIN_DEC_H
|
#define IMPD_DRC_UNI_GAIN_DEC_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -63,7 +58,6 @@ typedef struct {
|
||||||
FLOAT32 boost;
|
FLOAT32 boost;
|
||||||
} ia_interp_params_struct;
|
} ia_interp_params_struct;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_instructions_index;
|
WORD32 drc_instructions_index;
|
||||||
WORD32 drc_coeff_idx;
|
WORD32 drc_coeff_idx;
|
||||||
|
|
@ -86,50 +80,34 @@ typedef struct {
|
||||||
} ia_drc_params_struct;
|
} ia_drc_params_struct;
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_gain_buf_init(WORD32 index,
|
impd_gain_buf_init(WORD32 index, WORD32 gain_element_count,
|
||||||
WORD32 gain_element_count,
|
WORD32 drc_frame_size, ia_gain_buffer_struct* pstr_gain_buf);
|
||||||
WORD32 drc_frame_size,
|
|
||||||
ia_gain_buffer_struct* pstr_gain_buf);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_advance_buf(WORD32 drc_frame_size,
|
impd_advance_buf(WORD32 drc_frame_size, ia_gain_buffer_struct* pstr_gain_buf);
|
||||||
ia_gain_buffer_struct* pstr_gain_buf);
|
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_map_gain (
|
impd_map_gain(FLOAT32 gain_in_db, FLOAT32* gain_out_db);
|
||||||
FLOAT32 gain_in_db,
|
|
||||||
FLOAT32* gain_out_db);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_conv_to_linear_domain (ia_interp_params_struct* interp_params_str,
|
impd_conv_to_linear_domain(ia_interp_params_struct* interp_params_str,
|
||||||
WORD32 drc_band,
|
WORD32 drc_band, FLOAT32 loc_db_gain,
|
||||||
FLOAT32 loc_db_gain,
|
|
||||||
FLOAT32 in_param_db_slope,
|
FLOAT32 in_param_db_slope,
|
||||||
FLOAT32* out_param_lin_gain,
|
FLOAT32* out_param_lin_gain,
|
||||||
FLOAT32* out_param_lin_slope);
|
FLOAT32* out_param_lin_slope);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_interpolate_drc_gain(ia_interp_params_struct* interp_params_str,
|
impd_interpolate_drc_gain(ia_interp_params_struct* interp_params_str,
|
||||||
WORD32 drc_band,
|
WORD32 drc_band, WORD32 gain_step_tdomain,
|
||||||
WORD32 gain_step_tdomain,
|
FLOAT32 gain0, FLOAT32 gain1, FLOAT32 slope0,
|
||||||
FLOAT32 gain0,
|
FLOAT32 slope1, FLOAT32* result);
|
||||||
FLOAT32 gain1,
|
|
||||||
FLOAT32 slope0,
|
|
||||||
FLOAT32 slope1,
|
|
||||||
FLOAT32* result);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_concatenate_segments(WORD32 drc_frame_size,
|
impd_concatenate_segments(WORD32 drc_frame_size, WORD32 drc_band,
|
||||||
WORD32 drc_band,
|
|
||||||
ia_interp_params_struct* interp_params_str,
|
ia_interp_params_struct* interp_params_str,
|
||||||
ia_spline_nodes_struct* str_spline_nodes,
|
ia_spline_nodes_struct* str_spline_nodes,
|
||||||
ia_interp_buf_struct* buf_interpolation);
|
ia_interp_buf_struct* buf_interpolation);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef IMPD_DRC_UNI_INTERFACE_H
|
#ifndef IMPD_DRC_UNI_INTERFACE_H
|
||||||
#define IMPD_DRC_UNI_INTERFACE_H
|
#define IMPD_DRC_UNI_INTERFACE_H
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 ext_size_bits;
|
WORD32 ext_size_bits;
|
||||||
WORD32 ext_bit_size;
|
WORD32 ext_bit_size;
|
||||||
|
|
@ -47,7 +46,8 @@ typedef struct {
|
||||||
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 drc_feature_req_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_num_drc_effects[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 desired_num_drc_effects_of_requested[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS][MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
WORD32 requested_drc_effect_type[MAX_NUM_DRC_FEATURE_REQUESTS]
|
||||||
|
[MAX_NUM_DRC_EFFECT_TYPE_REQUESTS];
|
||||||
WORD32 requested_dyn_rng_measurement_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_rng_measurement_type[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
WORD32 requested_dyn_range_is_single_val_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
WORD32 requested_dyn_range_is_single_val_flag[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
FLOAT32 requested_dyn_range_value[MAX_NUM_DRC_FEATURE_REQUESTS];
|
||||||
|
|
@ -93,10 +93,10 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 interface_signat_type;
|
WORD32 interface_signat_type;
|
||||||
WORD32 interface_signat_data_len;
|
WORD32 interface_signat_data_len;
|
||||||
UWORD32 interface_signat_data[MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE*8];
|
UWORD32 interface_signat_data[MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8];
|
||||||
} ia_drc_uni_interface_signat_struct;
|
} ia_drc_uni_interface_signat_struct;
|
||||||
|
|
||||||
typedef struct ia_drc_interface_struct{
|
typedef struct ia_drc_interface_struct {
|
||||||
WORD32 interface_signat_flag;
|
WORD32 interface_signat_flag;
|
||||||
WORD32 system_interface_flag;
|
WORD32 system_interface_flag;
|
||||||
WORD32 loudness_norm_ctrl_interface_flag;
|
WORD32 loudness_norm_ctrl_interface_flag;
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,8 @@
|
||||||
#ifndef IMPD_DRC_UNI_LOUD_EQ_H
|
#ifndef IMPD_DRC_UNI_LOUD_EQ_H
|
||||||
#define IMPD_DRC_UNI_LOUD_EQ_H
|
#define IMPD_DRC_UNI_LOUD_EQ_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
#ifndef IMPD_DRC_UNI_MULTI_BAND_H
|
#ifndef IMPD_DRC_UNI_MULTI_BAND_H
|
||||||
#define IMPD_DRC_UNI_MULTI_BAND_H
|
#define IMPD_DRC_UNI_MULTI_BAND_H
|
||||||
|
|
||||||
#define DRC_SUBBAND_COUNT_WITH_AUDIO_CODEC_FILTERBANK_MAX FILTER_BANK_PARAMETER_COUNT
|
#define DRC_SUBBAND_COUNT_WITH_AUDIO_CODEC_FILTERBANK_MAX \
|
||||||
|
FILTER_BANK_PARAMETER_COUNT
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -36,35 +36,29 @@ typedef struct {
|
||||||
} ia_group_overlap_params_struct;
|
} ia_group_overlap_params_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_group_overlap_params_struct str_group_overlap_params[CHANNEL_GROUP_COUNT_MAX];
|
ia_group_overlap_params_struct
|
||||||
|
str_group_overlap_params[CHANNEL_GROUP_COUNT_MAX];
|
||||||
} ia_overlap_params_struct;
|
} ia_overlap_params_struct;
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_fcenter_norm_sb_init(WORD32 num_subbands, FLOAT32* fcenter_norm_subband);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_fcenter_norm_sb_init(WORD32 num_subbands,
|
impd_generate_slope(WORD32 num_subbands, FLOAT32* fcenter_norm_subband,
|
||||||
FLOAT32* fcenter_norm_subband);
|
FLOAT32 fcross_norm_lo, FLOAT32 fcross_norm_hi,
|
||||||
|
|
||||||
WORD32
|
|
||||||
impd_generate_slope (WORD32 num_subbands,
|
|
||||||
FLOAT32* fcenter_norm_subband,
|
|
||||||
FLOAT32 fcross_norm_lo,
|
|
||||||
FLOAT32 fcross_norm_hi,
|
|
||||||
FLOAT32* response);
|
FLOAT32* response);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_generate_overlap_weights (WORD32 num_drc_bands,
|
impd_generate_overlap_weights(
|
||||||
WORD32 drc_band_type,
|
WORD32 num_drc_bands, WORD32 drc_band_type,
|
||||||
ia_gain_params_struct* gain_params,
|
ia_gain_params_struct* gain_params, WORD32 dec_subband_count,
|
||||||
WORD32 dec_subband_count,
|
|
||||||
ia_group_overlap_params_struct* pstr_group_overlap_params);
|
ia_group_overlap_params_struct* pstr_group_overlap_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_overlap_weight ( ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
impd_init_overlap_weight(
|
||||||
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str,
|
ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode, ia_overlap_params_struct* pstr_overlap_params);
|
||||||
ia_overlap_params_struct* pstr_overlap_params);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,70 +26,63 @@ impd_dec_ducking_scaling(ia_bit_buf_struct* it_bit_buff,
|
||||||
FLOAT32* ducking_scaling);
|
FLOAT32* ducking_scaling);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info(ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
WORD32 version,
|
|
||||||
ia_loudness_info_struct* loudness_info);
|
ia_loudness_info_struct* loudness_info);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info_set_ext(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info_set_ext(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_loudness_info_set_struct* loudness_info_set);
|
ia_drc_loudness_info_set_struct* loudness_info_set);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_sel_drc_coeff(ia_drc_config* drc_config,
|
impd_sel_drc_coeff(
|
||||||
WORD32 location,
|
ia_drc_config* drc_config, WORD32 location,
|
||||||
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_parse_instructions_basic(ia_bit_buf_struct* it_bit_buff,
|
impd_drc_parse_instructions_basic(
|
||||||
ia_drc_config* drc_config,
|
ia_bit_buf_struct* it_bit_buff, ia_drc_config* drc_config,
|
||||||
ia_drc_instructions_basic_struct* str_drc_instructions_basic);
|
ia_drc_instructions_basic_struct* str_drc_instructions_basic);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_instructions_uni_drc(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_drc_instructions_uni_drc(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version, ia_drc_config* drc_config,
|
||||||
ia_drc_config* drc_config,
|
|
||||||
ia_channel_layout_struct* channel_layout,
|
ia_channel_layout_struct* channel_layout,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_drc_instructions_struct* str_drc_instruction_str);
|
ia_drc_instructions_struct* str_drc_instruction_str);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_gain_set_params(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_gain_set_params(ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
WORD32 version,
|
|
||||||
WORD32* gain_seq_idx,
|
WORD32* gain_seq_idx,
|
||||||
ia_gain_set_params_struct* gain_set_params);
|
ia_gain_set_params_struct* gain_set_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_parse_coeff(ia_bit_buf_struct* it_bit_buff,
|
impd_drc_parse_coeff(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct* str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_dwnmix_instructions(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_dwnmix_instructions(
|
||||||
WORD32 version,
|
ia_bit_buf_struct* it_bit_buff, WORD32 version,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_channel_layout_struct* channel_layout,
|
ia_channel_layout_struct* channel_layout,
|
||||||
ia_downmix_instructions_struct* dwnmix_instructions);
|
ia_downmix_instructions_struct* dwnmix_instructions);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_config(
|
impd_parse_drc_config(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_drc_config* drc_config
|
ia_drc_config* drc_config);
|
||||||
);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_loudness_info_set(
|
||||||
|
ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
ia_drc_params_bs_dec_struct* ia_drc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* loudness_info_set);
|
ia_drc_loudness_info_set_struct* loudness_info_set);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parse_drc_gain_sequence(
|
impd_parse_drc_gain_sequence(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* pstr_drc_uni_bs_dec,
|
||||||
ia_drc_bits_dec_struct *pstr_drc_uni_bs_dec,
|
|
||||||
ia_gain_set_params_struct* gain_set_params,
|
ia_gain_set_params_struct* gain_set_params,
|
||||||
ia_drc_gain_sequence_struct* drc_gain_sequence);
|
ia_drc_gain_sequence_struct* drc_gain_sequence);
|
||||||
|
|
||||||
|
|
@ -97,11 +90,9 @@ WORD32
|
||||||
impd_parse_uni_drc_gain_ext(ia_bit_buf_struct* it_bit_buff,
|
impd_parse_uni_drc_gain_ext(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_uni_drc_gain_ext_struct* uni_drc_gain_ext);
|
ia_uni_drc_gain_ext_struct* uni_drc_gain_ext);
|
||||||
|
|
||||||
WORD32 impd_drc_uni_gain_read(
|
WORD32 impd_drc_uni_gain_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
ia_bit_buf_struct* it_bit_buff,
|
ia_drc_bits_dec_struct* pstr_drc_uni_bs_dec,
|
||||||
ia_drc_bits_dec_struct *pstr_drc_uni_bs_dec,
|
|
||||||
ia_drc_config* drc_config,
|
ia_drc_config* drc_config,
|
||||||
ia_drc_gain_struct* pstr_uni_drc_gain);
|
ia_drc_gain_struct* pstr_uni_drc_gain);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@
|
||||||
#define IMPD_DRC_UNI_PROCESS_AUDIO_H
|
#define IMPD_DRC_UNI_PROCESS_AUDIO_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -31,8 +30,6 @@ typedef struct {
|
||||||
FLOAT32** non_interleaved_audio;
|
FLOAT32** non_interleaved_audio;
|
||||||
} ia_audio_band_buffer_struct;
|
} ia_audio_band_buffer_struct;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
|
|
@ -42,7 +39,6 @@ impd_apply_gains_subband(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
FLOAT32* deinterleaved_audio_re[],
|
FLOAT32* deinterleaved_audio_re[],
|
||||||
FLOAT32* deinterleaved_audio_im[]);
|
FLOAT32* deinterleaved_audio_im[]);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
const WORD32 drc_instructions_index,
|
const WORD32 drc_instructions_index,
|
||||||
|
|
@ -52,7 +48,6 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
ia_filter_banks_struct* ia_filter_banks_struct,
|
||||||
const WORD32 passThru);
|
const WORD32 passThru);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#define SELECTION_FLAG_DRC_TARGET_LOUDNESS_MATCH (1 << 0)
|
||||||
#define SELECTION_FLAG_DRC_TARGET_LOUDNESS_MATCH (1<<0)
|
#define SELECTION_FLAG_EXPLICIT_PEAK_INFO_PRESENT (1 << 1)
|
||||||
#define SELECTION_FLAG_EXPLICIT_PEAK_INFO_PRESENT (1<<1)
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_instructions_index;
|
WORD32 drc_instructions_index;
|
||||||
|
|
@ -39,9 +38,9 @@ typedef struct {
|
||||||
WORD32 selection_flags;
|
WORD32 selection_flags;
|
||||||
} ia_selection_candidate_info_struct;
|
} ia_selection_candidate_info_struct;
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_validate_requested_drc_feature(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
impd_validate_requested_drc_feature(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_map_requested_effect_bit_idx(WORD32 requested_effect_type,
|
impd_map_requested_effect_bit_idx(WORD32 requested_effect_type,
|
||||||
|
|
@ -61,82 +60,78 @@ WORD32
|
||||||
impd_get_dependent_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
impd_get_dependent_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_dependent_drc_instructions(const ia_drc_config* drc_config,
|
impd_get_dependent_drc_instructions(
|
||||||
|
const ia_drc_config* drc_config,
|
||||||
const ia_drc_instructions_struct* str_drc_instruction_str,
|
const ia_drc_instructions_struct* str_drc_instruction_str,
|
||||||
ia_drc_instructions_struct** ppstr_drc_instructions_dependent);
|
ia_drc_instructions_struct** ppstr_drc_instructions_dependent);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_select_drcs_without_compr_effects (ia_drc_config* pstr_drc_config,
|
impd_select_drcs_without_compr_effects(
|
||||||
WORD32* match_found_flag,
|
ia_drc_config* pstr_drc_config, WORD32* match_found_flag,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_effect_type_attempt(ia_drc_config* pstr_drc_config,
|
impd_match_effect_type_attempt(
|
||||||
WORD32 requested_effect_type,
|
ia_drc_config* pstr_drc_config, WORD32 requested_effect_type,
|
||||||
WORD32 stateRequested,
|
WORD32 stateRequested, WORD32* match_found_flag,
|
||||||
WORD32* match_found_flag,
|
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_effect_types(ia_drc_config* pstr_drc_config,
|
impd_match_effect_types(
|
||||||
WORD32 total_effect_type_requested,
|
ia_drc_config* pstr_drc_config, WORD32 total_effect_type_requested,
|
||||||
WORD32 desired_effect_type_requested,
|
WORD32 desired_effect_type_requested, WORD32* requested_effect_type,
|
||||||
WORD32* requested_effect_type,
|
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32 impd_match_dynamic_range(ia_drc_config* pstr_drc_config,
|
WORD32 impd_match_dynamic_range(
|
||||||
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
WORD32 num_drc_requests,
|
WORD32 num_drc_requests, WORD32* selection_candidate_count,
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_drc_characteristic_attempt(ia_drc_config* pstr_drc_config,
|
impd_match_drc_characteristic_attempt(
|
||||||
WORD32 requested_drc_characteristic,
|
ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
|
||||||
WORD32* match_found_flag,
|
WORD32* match_found_flag, WORD32* selection_candidate_count,
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_match_drc_characteristic(ia_drc_config* pstr_drc_config,
|
impd_match_drc_characteristic(
|
||||||
WORD32 requested_drc_characteristic,
|
ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
VOID impd_select_drc_coeff3(ia_drc_config* drc_config,
|
VOID impd_select_drc_coeff3(
|
||||||
|
ia_drc_config* drc_config,
|
||||||
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_set_preselection(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_drc_set_preselection(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
WORD32 restrict_to_drc_with_album_loudness,
|
WORD32 restrict_to_drc_with_album_loudness,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
WORD32 impd_drc_set_final_selection(ia_drc_config* pstr_drc_config,
|
WORD32 impd_drc_set_final_selection(
|
||||||
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
);
|
|
||||||
|
|
||||||
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
WORD32 impd_match_eq_set_purpose(
|
||||||
WORD32 eq_set_purpose_requested,
|
ia_drc_config* drc_config, WORD32 eq_set_purpose_requested,
|
||||||
WORD32* eq_set_id_valid_flag,
|
WORD32* eq_set_id_valid_flag, WORD32* selection_candidate_count,
|
||||||
WORD32* selection_candidate_count,
|
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info,
|
ia_selection_candidate_info_struct* selection_candidate_info,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info_step_2
|
ia_selection_candidate_info_struct* selection_candidate_info_step_2);
|
||||||
);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_select_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_select_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
WORD32* drc_set_id_selected
|
WORD32* drc_set_id_selected);
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,13 @@ WORD32
|
||||||
impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_sel_proc_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_sel_proc_params(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_drc_sel_proc_init_interface_params(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
impd_drc_sel_proc_init_interface_params(
|
||||||
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
ia_drc_interface_struct* pstr_drc_interface);
|
ia_drc_interface_struct* pstr_drc_interface);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -32,15 +32,15 @@ impd_signal_peak_level_info(ia_drc_config* pstr_drc_config,
|
||||||
const WORD32 album_mode,
|
const WORD32 album_mode,
|
||||||
const WORD32 num_compression_eq_count,
|
const WORD32 num_compression_eq_count,
|
||||||
const WORD32* num_compression_eq_id,
|
const WORD32* num_compression_eq_id,
|
||||||
WORD32* peak_info_count,
|
WORD32* peak_info_count, WORD32 eq_set_id[],
|
||||||
WORD32 eq_set_id[],
|
|
||||||
FLOAT32 signal_peak_level[],
|
FLOAT32 signal_peak_level[],
|
||||||
WORD32 explicit_peak_information_present[]);
|
WORD32 explicit_peak_information_present[]);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_extract_loudness_peak_to_average_info(ia_loudness_info_struct* loudness_info,
|
impd_extract_loudness_peak_to_average_info(
|
||||||
|
ia_loudness_info_struct* loudness_info,
|
||||||
const WORD32 dyn_range_measurement_type,
|
const WORD32 dyn_range_measurement_type,
|
||||||
WORD32 * loudness_peak_2_avg_value_present,
|
WORD32* loudness_peak_2_avg_value_present,
|
||||||
FLOAT32* loudness_peak_2_avg_value);
|
FLOAT32* loudness_peak_2_avg_value);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
|
|
@ -48,40 +48,33 @@ impd_overall_loudness_present(const ia_loudness_info_struct* loudness_info,
|
||||||
WORD32* loudness_info_present);
|
WORD32* loudness_info_present);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_overall_loudness_info(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_find_overall_loudness_info(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
const WORD32 requested_dwnmix_id,
|
const WORD32 requested_dwnmix_id, const WORD32 drc_set_id_requested,
|
||||||
const WORD32 drc_set_id_requested,
|
WORD32* overall_loudness_info_present, WORD32* loudness_info_count,
|
||||||
WORD32* overall_loudness_info_present,
|
|
||||||
WORD32* loudness_info_count,
|
|
||||||
ia_loudness_info_struct* loudness_info[]);
|
ia_loudness_info_struct* loudness_info[]);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_high_pass_loudness_adjust_info(const ia_loudness_info_struct* loudness_info,
|
impd_high_pass_loudness_adjust_info(
|
||||||
WORD32* loudness_hp_adjust_present,
|
const ia_loudness_info_struct* loudness_info,
|
||||||
FLOAT32* loudness_hp_adjust);
|
WORD32* loudness_hp_adjust_present, FLOAT32* loudness_hp_adjust);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_find_high_pass_loudness_adjust(
|
impd_find_high_pass_loudness_adjust(
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
const WORD32 requested_dwnmix_id,
|
const WORD32 requested_dwnmix_id, const WORD32 drc_set_id_requested,
|
||||||
const WORD32 drc_set_id_requested,
|
const WORD32 album_mode, const FLOAT32 device_cutoff_freq,
|
||||||
const WORD32 album_mode,
|
WORD32* loudness_hp_adjust_present, FLOAT32* loudness_hp_adjust);
|
||||||
const FLOAT32 device_cutoff_freq,
|
|
||||||
WORD32* loudness_hp_adjust_present,
|
|
||||||
FLOAT32* loudness_hp_adjust);
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_loudness_control (ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
impd_init_loudness_control(
|
||||||
|
ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
const WORD32 requested_dwnmix_id,
|
const WORD32 requested_dwnmix_id, const WORD32 drc_set_id_requested,
|
||||||
const WORD32 drc_set_id_requested,
|
const WORD32 num_compression_eq_count, const WORD32* num_compression_eq_id,
|
||||||
const WORD32 num_compression_eq_count,
|
WORD32* loudness_info_count, WORD32 eq_set_id[],
|
||||||
const WORD32* num_compression_eq_id,
|
FLOAT32 loudness_normalization_gain_db[], FLOAT32 loudness[]);
|
||||||
WORD32* loudness_info_count,
|
|
||||||
WORD32 eq_set_id[],
|
|
||||||
FLOAT32 loudness_normalization_gain_db[],
|
|
||||||
FLOAT32 loudness[]);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,4 @@
|
||||||
#ifndef IMPD_DRC_UNI_SHAPE_FILTER_H
|
#ifndef IMPD_DRC_UNI_SHAPE_FILTER_H
|
||||||
#define IMPD_DRC_UNI_SHAPE_FILTER_H
|
#define IMPD_DRC_UNI_SHAPE_FILTER_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,10 @@
|
||||||
#define IMPD_DRC_UNI_TABLES_H
|
#define IMPD_DRC_UNI_TABLES_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX (512+14)
|
#define N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX (512 + 14)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 size;
|
WORD32 size;
|
||||||
|
|
@ -47,7 +46,8 @@ typedef struct {
|
||||||
} ia_delta_gain_code_table_struct;
|
} ia_delta_gain_code_table_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_delta_time_code_table_entry_struct delta_time_code_table[N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX];
|
ia_delta_time_code_table_entry_struct
|
||||||
|
delta_time_code_table[N_DELTA_TIME_CODE_TABLE_ENTRIES_MAX];
|
||||||
} ia_tables_struct;
|
} ia_tables_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -67,24 +67,23 @@ typedef struct {
|
||||||
} ia_cicp_node_characteristic_param;
|
} ia_cicp_node_characteristic_param;
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_tbls(const WORD32 num_gain_max_values,
|
impd_init_tbls(const WORD32 num_gain_max_values, ia_tables_struct* str_tables);
|
||||||
ia_tables_struct* str_tables);
|
|
||||||
|
|
||||||
void
|
void impd_gen_delta_time_code_tbl(
|
||||||
impd_gen_delta_time_code_tbl (const WORD32 num_gain_max_values,
|
const WORD32 num_gain_max_values,
|
||||||
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item);
|
ia_delta_time_code_table_entry_struct* delta_time_code_tbl_item);
|
||||||
|
|
||||||
void
|
void impd_get_delta_gain_code_tbl(
|
||||||
impd_get_delta_gain_code_tbl(const WORD32 gain_coding_profile,
|
const WORD32 gain_coding_profile,
|
||||||
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
ia_delta_gain_code_table_struct const** delta_time_code_tbl,
|
||||||
WORD32 *num_entries);
|
WORD32* num_entries);
|
||||||
|
|
||||||
void
|
void impd_get_slope_code_tbl_and_size(
|
||||||
impd_get_slope_code_tbl_and_size(ia_slope_code_table_struct const** slope_code_tbl_entry,
|
ia_slope_code_table_struct const** slope_code_tbl_entry,
|
||||||
WORD32* num_slope_code_tbl_entries);
|
WORD32* num_slope_code_tbl_entries);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_get_delta_tmin (const WORD32 sampling_rate);
|
impd_get_delta_tmin(const WORD32 sampling_rate);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,7 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Type definitions */
|
/* Type definitions */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
pWORD8 pb_module_name;
|
pWORD8 pb_module_name;
|
||||||
pWORD8 ppb_class_names[16];
|
pWORD8 ppb_class_names[16];
|
||||||
WORD8 **ppppb_error_msg_pointers[2][16];
|
WORD8 **ppppb_error_msg_pointers[2][16];
|
||||||
|
|
@ -84,11 +83,9 @@ IA_ERRORCODE ia_error_handler(ia_error_info_struct *p_mod_err_info,
|
||||||
/* the following macro does a line job of returning back to the parent */
|
/* the following macro does a line job of returning back to the parent */
|
||||||
/* in case a fatal error occurs after calling the errorhandler */
|
/* in case a fatal error occurs after calling the errorhandler */
|
||||||
#define _IA_HANDLE_ERROR(p_mod_err_info, context, e) \
|
#define _IA_HANDLE_ERROR(p_mod_err_info, context, e) \
|
||||||
if((e) != IA_NO_ERROR) \
|
if ((e) != IA_NO_ERROR) { \
|
||||||
{ \
|
|
||||||
ia_error_handler((p_mod_err_info), (context), (e)); \
|
ia_error_handler((p_mod_err_info), (context), (e)); \
|
||||||
if((e) & IA_FATAL_ERROR) \
|
if ((e)&IA_FATAL_ERROR) return (e); \
|
||||||
return (e); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,14 @@
|
||||||
/* Type definitions */
|
/* Type definitions */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* standard memory table descriptor for libraries */
|
/* standard memory table descriptor for libraries */
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
UWORD32 ui_size; /* size of the memory in bytes */
|
UWORD32 ui_size; /* size of the memory in bytes */
|
||||||
UWORD32 ui_alignment; /* alignment in bytes */
|
UWORD32 ui_alignment; /* alignment in bytes */
|
||||||
UWORD32 ui_type; /* type of memory */
|
UWORD32 ui_type; /* type of memory */
|
||||||
UWORD32 ui_placement[2]; /* 64 bit placement info */
|
UWORD32 ui_placement[2]; /* 64 bit placement info */
|
||||||
UWORD32 ui_priority; /* the importance for placement */
|
UWORD32 ui_priority; /* the importance for placement */
|
||||||
UWORD32 ui_placed[2]; /* the o_red location for placement */
|
UWORD32 ui_placed[2]; /* the o_red location for placement */
|
||||||
}ia_mem_info_struct;
|
} ia_mem_info_struct;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Constant hash defines */
|
/* Constant hash defines */
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,8 @@
|
||||||
#ifndef IMPD_PARAMETRIC_DRC_DEC_H
|
#ifndef IMPD_PARAMETRIC_DRC_DEC_H
|
||||||
#define IMPD_PARAMETRIC_DRC_DEC_H
|
#define IMPD_PARAMETRIC_DRC_DEC_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct ia_2nd_order_filt_coeff_struct_t {
|
typedef struct ia_2nd_order_filt_coeff_struct_t {
|
||||||
|
|
@ -37,7 +34,6 @@ typedef struct ia_2nd_order_filt_state_struct_t {
|
||||||
} ia_2nd_order_filt_state_struct;
|
} ia_2nd_order_filt_state_struct;
|
||||||
|
|
||||||
typedef struct ia_parametric_drc_type_ff_params_struct_t {
|
typedef struct ia_parametric_drc_type_ff_params_struct_t {
|
||||||
|
|
||||||
WORD32 audio_num_chan;
|
WORD32 audio_num_chan;
|
||||||
WORD32 frame_size;
|
WORD32 frame_size;
|
||||||
WORD32 sub_band_domain_mode;
|
WORD32 sub_band_domain_mode;
|
||||||
|
|
@ -78,7 +74,6 @@ typedef struct ia_parametric_drc_type_ff_params_struct_t {
|
||||||
} ia_parametric_drc_type_ff_params_struct;
|
} ia_parametric_drc_type_ff_params_struct;
|
||||||
|
|
||||||
typedef struct ia_parametric_drc_type_lim_params_struct_t {
|
typedef struct ia_parametric_drc_type_lim_params_struct_t {
|
||||||
|
|
||||||
WORD32 audio_num_chan;
|
WORD32 audio_num_chan;
|
||||||
WORD32 frame_size;
|
WORD32 frame_size;
|
||||||
FLOAT32 level_estim_ch_weight[MAX_CHANNEL_COUNT];
|
FLOAT32 level_estim_ch_weight[MAX_CHANNEL_COUNT];
|
||||||
|
|
@ -130,69 +125,68 @@ typedef struct ia_parametric_drc_params_struct_t {
|
||||||
WORD32 dwnmix_id_from_drc_instructions[PARAM_DRC_INSTANCE_COUNT_MAX];
|
WORD32 dwnmix_id_from_drc_instructions[PARAM_DRC_INSTANCE_COUNT_MAX];
|
||||||
WORD32 channel_map[PARAM_DRC_INSTANCE_COUNT_MAX][MAX_CHANNEL_COUNT];
|
WORD32 channel_map[PARAM_DRC_INSTANCE_COUNT_MAX][MAX_CHANNEL_COUNT];
|
||||||
|
|
||||||
ia_parametric_drc_instance_params_struct str_parametric_drc_instance_params[PARAM_DRC_INSTANCE_COUNT_MAX];
|
ia_parametric_drc_instance_params_struct
|
||||||
|
str_parametric_drc_instance_params[PARAM_DRC_INSTANCE_COUNT_MAX];
|
||||||
|
|
||||||
} ia_parametric_drc_params_struct;
|
} ia_parametric_drc_params_struct;
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drc( WORD32 drc_frame_size,
|
WORD32 impd_init_parametric_drc(
|
||||||
WORD32 sampling_rate,
|
WORD32 drc_frame_size, WORD32 sampling_rate, WORD32 sub_band_domain_mode,
|
||||||
WORD32 sub_band_domain_mode,
|
|
||||||
ia_parametric_drc_params_struct* pstr_parametric_drc_params);
|
ia_parametric_drc_params_struct* pstr_parametric_drc_params);
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drc_after_config(ia_drc_config* pstr_drc_config,
|
WORD32 impd_init_parametric_drc_after_config(
|
||||||
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
ia_drc_loudness_info_set_struct* pstr_loudness_info,
|
||||||
ia_parametric_drc_params_struct *pstr_parametric_drc_params,
|
ia_parametric_drc_params_struct* pstr_parametric_drc_params,
|
||||||
pVOID *mem_ptr);
|
pVOID* mem_ptr);
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_lvl_est_filt_time( WORD32 level_estim_k_weighting_type,
|
impd_init_lvl_est_filt_time(WORD32 level_estim_k_weighting_type,
|
||||||
WORD32 sampling_rate,
|
WORD32 sampling_rate,
|
||||||
ia_2nd_order_filt_coeff_struct* pre_filt_coeff,
|
ia_2nd_order_filt_coeff_struct* pre_filt_coeff,
|
||||||
ia_2nd_order_filt_coeff_struct* rlb_filt_coeff);
|
ia_2nd_order_filt_coeff_struct* rlb_filt_coeff);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_type,
|
impd_init_lvl_est_filt_subband(
|
||||||
WORD32 sampling_rate,
|
WORD32 level_estim_k_weighting_type, WORD32 sampling_rate,
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode, WORD32 sub_band_count,
|
||||||
WORD32 sub_band_count,
|
WORD32 sub_band_compensation_type, FLOAT32* weighting_filt,
|
||||||
WORD32 sub_band_compensation_type,
|
|
||||||
FLOAT32 *weighting_filt,
|
|
||||||
ia_2nd_order_filt_coeff_struct* filt_coeff_subband);
|
ia_2nd_order_filt_coeff_struct* filt_coeff_subband);
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_parametric_ffwd_type_drc_reset(ia_parametric_drc_type_ff_params_struct*
|
||||||
|
pstr_parametric_ffwd_type_drc_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parametric_ffwd_type_drc_reset(ia_parametric_drc_type_ff_params_struct* pstr_parametric_ffwd_type_drc_params);
|
impd_parametric_lim_type_drc_reset(WORD32 instance_idx,
|
||||||
|
ia_parametric_drc_type_lim_params_struct*
|
||||||
|
pstr_parametric_lim_type_drc_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parametric_lim_type_drc_reset( WORD32 instance_idx,
|
impd_parametric_drc_instance_process(
|
||||||
ia_parametric_drc_type_lim_params_struct* pstr_parametric_lim_type_drc_params);
|
FLOAT32* audio_in_out_buf[], FLOAT32* audio_real_buff[],
|
||||||
|
|
||||||
WORD32
|
|
||||||
impd_parametric_drc_instance_process (FLOAT32* audio_in_out_buf[],
|
|
||||||
FLOAT32* audio_real_buff[],
|
|
||||||
FLOAT32* audio_imag_buff[],
|
FLOAT32* audio_imag_buff[],
|
||||||
ia_parametric_drc_params_struct* pstr_parametric_drc_params,
|
ia_parametric_drc_params_struct* pstr_parametric_drc_params,
|
||||||
ia_parametric_drc_instance_params_struct* pstr_parametric_drc_instance_params);
|
ia_parametric_drc_instance_params_struct*
|
||||||
|
pstr_parametric_drc_instance_params);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parametric_ffwd_type_drc_process(FLOAT32* audio_in_out_buf[],
|
impd_parametric_ffwd_type_drc_process(FLOAT32* audio_in_out_buf[],
|
||||||
FLOAT32* audio_real_buff[],
|
FLOAT32* audio_real_buff[],
|
||||||
FLOAT32* audio_imag_buff[],
|
FLOAT32* audio_imag_buff[],
|
||||||
WORD32 nodeIdx,
|
WORD32 nodeIdx,
|
||||||
ia_parametric_drc_type_ff_params_struct* pstr_parametric_ffwd_type_drc_params,
|
ia_parametric_drc_type_ff_params_struct*
|
||||||
|
pstr_parametric_ffwd_type_drc_params,
|
||||||
ia_spline_nodes_struct* str_spline_nodes);
|
ia_spline_nodes_struct* str_spline_nodes);
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_parametric_lim_type_drc_process(FLOAT32* audio_in_out_buf[],
|
impd_parametric_lim_type_drc_process(FLOAT32* audio_in_out_buf[],
|
||||||
FLOAT32 loudness_normalization_gain_db,
|
FLOAT32 loudness_normalization_gain_db,
|
||||||
ia_parametric_drc_type_lim_params_struct* pstr_parametric_lim_type_drc_params,
|
ia_parametric_drc_type_lim_params_struct*
|
||||||
|
pstr_parametric_lim_type_drc_params,
|
||||||
FLOAT32* lpcm_gains);
|
FLOAT32* lpcm_gains);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,91 +24,89 @@
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* types type define prefix examples bytes */
|
/* types type define prefix examples bytes */
|
||||||
/************************ *********** ****** **************** ***** */
|
/************************ *********** ****** **************** ***** */
|
||||||
typedef char CHAR8 ;/* c CHAR8 c_name 1 */
|
typedef char CHAR8; /* c CHAR8 c_name 1 */
|
||||||
typedef char * pCHAR8 ;/* pc pCHAR8 pc_nmae 1 */
|
typedef char* pCHAR8; /* pc pCHAR8 pc_nmae 1 */
|
||||||
|
|
||||||
typedef signed char WORD8 ;/* b WORD8 b_name 1 */
|
typedef signed char WORD8; /* b WORD8 b_name 1 */
|
||||||
typedef signed char * pWORD8 ;/* pb pWORD8 pb_nmae 1 */
|
typedef signed char* pWORD8; /* pb pWORD8 pb_nmae 1 */
|
||||||
|
|
||||||
typedef unsigned char UWORD8 ;/* ub UWORD8 ub_count 1 */
|
typedef unsigned char UWORD8; /* ub UWORD8 ub_count 1 */
|
||||||
typedef unsigned char * pUWORD8 ;/* pub pUWORD8 pub_count 1 */
|
typedef unsigned char* pUWORD8; /* pub pUWORD8 pub_count 1 */
|
||||||
|
|
||||||
typedef signed short WORD16 ;/* s WORD16 s_count 2 */
|
typedef signed short WORD16; /* s WORD16 s_count 2 */
|
||||||
typedef signed short * pWORD16 ;/* ps pWORD16 ps_count 2 */
|
typedef signed short* pWORD16; /* ps pWORD16 ps_count 2 */
|
||||||
typedef unsigned short UWORD16 ;/* us UWORD16 us_count 2 */
|
typedef unsigned short UWORD16; /* us UWORD16 us_count 2 */
|
||||||
typedef unsigned short * pUWORD16;/* pus pUWORD16 pus_count 2 */
|
typedef unsigned short* pUWORD16; /* pus pUWORD16 pus_count 2 */
|
||||||
|
|
||||||
typedef signed int WORD24 ;/* k WORD24 k_count 3 */
|
typedef signed int WORD24; /* k WORD24 k_count 3 */
|
||||||
typedef signed int * pWORD24 ;/* pk pWORD24 pk_count 3 */
|
typedef signed int* pWORD24; /* pk pWORD24 pk_count 3 */
|
||||||
typedef unsigned int UWORD24 ;/* uk UWORD24 uk_count 3 */
|
typedef unsigned int UWORD24; /* uk UWORD24 uk_count 3 */
|
||||||
typedef unsigned int * pUWORD24;/* puk pUWORD24 puk_count 3 */
|
typedef unsigned int* pUWORD24; /* puk pUWORD24 puk_count 3 */
|
||||||
|
|
||||||
typedef signed int WORD32 ;/* i WORD32 i_count 4 */
|
typedef signed int WORD32; /* i WORD32 i_count 4 */
|
||||||
typedef signed int * pWORD32 ;/* pi pWORD32 pi_count 4 */
|
typedef signed int* pWORD32; /* pi pWORD32 pi_count 4 */
|
||||||
typedef unsigned int UWORD32 ;/* ui UWORD32 ui_count 4 */
|
typedef unsigned int UWORD32; /* ui UWORD32 ui_count 4 */
|
||||||
typedef unsigned int * pUWORD32;/* pui pUWORD32 pui_count 4 */
|
typedef unsigned int* pUWORD32; /* pui pUWORD32 pui_count 4 */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef ECLIPSE
|
#ifndef ECLIPSE
|
||||||
typedef signed __int64 WORD40 ;/* m WORD40 m_count 5 */
|
typedef signed __int64 WORD40; /* m WORD40 m_count 5 */
|
||||||
typedef signed __int64 * pWORD40 ;/* pm pWORD40 pm_count 5 */
|
typedef signed __int64* pWORD40; /* pm pWORD40 pm_count 5 */
|
||||||
typedef unsigned __int64 UWORD40 ;/* um UWORD40 um_count 5 */
|
typedef unsigned __int64 UWORD40; /* um UWORD40 um_count 5 */
|
||||||
typedef unsigned __int64 * pUWORD40;/* pum pUWORD40 pum_count 5 */
|
typedef unsigned __int64* pUWORD40; /* pum pUWORD40 pum_count 5 */
|
||||||
|
|
||||||
typedef signed __int64 WORD64 ;/* h WORD64 h_count 8 */
|
typedef signed __int64 WORD64; /* h WORD64 h_count 8 */
|
||||||
typedef signed __int64 * pWORD64 ;/* ph pWORD64 ph_count 8 */
|
typedef signed __int64* pWORD64; /* ph pWORD64 ph_count 8 */
|
||||||
typedef unsigned __int64 UWORD64 ;/* uh UWORD64 uh_count 8 */
|
typedef unsigned __int64 UWORD64; /* uh UWORD64 uh_count 8 */
|
||||||
typedef unsigned __int64 * pUWORD64;/* puh pUWORD64 puh_count 8 */
|
typedef unsigned __int64* pUWORD64; /* puh pUWORD64 puh_count 8 */
|
||||||
#else
|
#else
|
||||||
typedef signed long long WORD40 ;/* m WORD40 m_count 5 */
|
typedef signed long long WORD40; /* m WORD40 m_count 5 */
|
||||||
typedef signed long long * pWORD40 ;/* pm pWORD40 pm_count 5 */
|
typedef signed long long* pWORD40; /* pm pWORD40 pm_count 5 */
|
||||||
typedef unsigned long long UWORD40 ;/* um UWORD40 um_count 5 */
|
typedef unsigned long long UWORD40; /* um UWORD40 um_count 5 */
|
||||||
typedef unsigned long long * pUWORD40;/* pum pUWORD40 pum_count 5 */
|
typedef unsigned long long* pUWORD40; /* pum pUWORD40 pum_count 5 */
|
||||||
|
|
||||||
typedef signed long long WORD64 ;/* h WORD64 h_count 8 */
|
typedef signed long long WORD64; /* h WORD64 h_count 8 */
|
||||||
typedef signed long long * pWORD64 ;/* ph pWORD64 ph_count 8 */
|
typedef signed long long* pWORD64; /* ph pWORD64 ph_count 8 */
|
||||||
typedef unsigned long long UWORD64 ;/* uh UWORD64 uh_count 8 */
|
typedef unsigned long long UWORD64; /* uh UWORD64 uh_count 8 */
|
||||||
typedef unsigned long long * pUWORD64;/* puh pUWORD64 puh_count 8 */
|
typedef unsigned long long* pUWORD64; /* puh pUWORD64 puh_count 8 */
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
|
||||||
typedef signed long long WORD40 ;/* m WORD40 m_count 5 */
|
typedef signed long long WORD40; /* m WORD40 m_count 5 */
|
||||||
typedef signed long long * pWORD40 ;/* pm pWORD40 pm_count 5 */
|
typedef signed long long* pWORD40; /* pm pWORD40 pm_count 5 */
|
||||||
typedef unsigned long long UWORD40 ;/* um UWORD40 um_count 5 */
|
typedef unsigned long long UWORD40; /* um UWORD40 um_count 5 */
|
||||||
typedef unsigned long long * pUWORD40;/* pum pUWORD40 pum_count 5 */
|
typedef unsigned long long* pUWORD40; /* pum pUWORD40 pum_count 5 */
|
||||||
|
|
||||||
typedef signed long long WORD64 ;/* h WORD64 h_count 8 */
|
typedef signed long long WORD64; /* h WORD64 h_count 8 */
|
||||||
typedef signed long long * pWORD64 ;/* ph pWORD64 ph_count 8 */
|
typedef signed long long* pWORD64; /* ph pWORD64 ph_count 8 */
|
||||||
typedef unsigned long long UWORD64 ;/* uh UWORD64 uh_count 8 */
|
typedef unsigned long long UWORD64; /* uh UWORD64 uh_count 8 */
|
||||||
typedef unsigned long long * pUWORD64;/* puh pUWORD64 puh_count 8 */
|
typedef unsigned long long* pUWORD64; /* puh pUWORD64 puh_count 8 */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef float FLOAT32; /* f FLOAT32 f_count 4 */
|
||||||
|
typedef float* pFLOAT32; /* pf pFLOAT32 pf_count 4 */
|
||||||
|
typedef double FLOAT64; /* d UFLOAT64 d_count 8 */
|
||||||
|
typedef double* pFlOAT64; /* pd pFLOAT64 pd_count 8 */
|
||||||
|
|
||||||
typedef float FLOAT32 ;/* f FLOAT32 f_count 4 */
|
typedef void VOID; /* v VOID v_flag 4 */
|
||||||
typedef float * pFLOAT32;/* pf pFLOAT32 pf_count 4 */
|
typedef void* pVOID; /* pv pVOID pv_flag 4 */
|
||||||
typedef double FLOAT64 ;/* d UFLOAT64 d_count 8 */
|
|
||||||
typedef double * pFlOAT64;/* pd pFLOAT64 pd_count 8 */
|
|
||||||
|
|
||||||
typedef void VOID ;/* v VOID v_flag 4 */
|
|
||||||
typedef void * pVOID ;/* pv pVOID pv_flag 4 */
|
|
||||||
|
|
||||||
/* variable size types: platform optimized implementation */
|
/* variable size types: platform optimized implementation */
|
||||||
typedef signed int BOOL ;/* bool BOOL bool_true */
|
typedef signed int BOOL; /* bool BOOL bool_true */
|
||||||
typedef unsigned int UBOOL ;/* ubool BOOL ubool_true */
|
typedef unsigned int UBOOL; /* ubool BOOL ubool_true */
|
||||||
typedef signed int FLAG ;/* flag FLAG flag_false */
|
typedef signed int FLAG; /* flag FLAG flag_false */
|
||||||
typedef unsigned int UFLAG ;/* uflag FLAG uflag_false */
|
typedef unsigned int UFLAG; /* uflag FLAG uflag_false */
|
||||||
typedef signed int LOOPIDX ;/* lp LOOPIDX lp_index */
|
typedef signed int LOOPIDX; /* lp LOOPIDX lp_index */
|
||||||
typedef unsigned int ULOOPIDX;/* ulp SLOOPIDX ulp_index */
|
typedef unsigned int ULOOPIDX; /* ulp SLOOPIDX ulp_index */
|
||||||
typedef signed int WORD ;/* lp LOOPIDX lp_index */
|
typedef signed int WORD; /* lp LOOPIDX lp_index */
|
||||||
typedef unsigned int UWORD ;/* ulp SLOOPIDX ulp_index */
|
typedef unsigned int UWORD; /* ulp SLOOPIDX ulp_index */
|
||||||
|
|
||||||
typedef LOOPIDX LOOPINDEX; /* lp LOOPIDX lp_index */
|
typedef LOOPIDX LOOPINDEX; /* lp LOOPIDX lp_index */
|
||||||
typedef ULOOPIDX ULOOPINDEX;/* ulp SLOOPIDX ulp_index */
|
typedef ULOOPIDX ULOOPINDEX; /* ulp SLOOPIDX ulp_index */
|
||||||
|
|
||||||
#define SIZE_T size_t
|
#define SIZE_T size_t
|
||||||
|
|
||||||
#define PLATFORM_INLINE __inline
|
#define PLATFORM_INLINE __inline
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -230,20 +230,20 @@ VOID(*ixheaacd_aac_ld_dec_rearrange)
|
||||||
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
|
||||||
UWORD8 *re_arr_tab) = &ixheaacd_rearrange_dec;
|
UWORD8 *re_arr_tab) = &ixheaacd_rearrange_dec;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld)
|
VOID(*ixheaacd_fft32x32_ld)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = ixheaacd_fft32x32_ld_dec;
|
WORD32 *ptr_x, WORD32 *ptr_y) = ixheaacd_fft32x32_ld_dec;
|
||||||
|
|
||||||
VOID (*ixheaacd_fft32x32_ld2)
|
VOID(*ixheaacd_fft32x32_ld2)
|
||||||
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld_dec;
|
WORD32 *ptr_x, WORD32 *ptr_y) = &ixheaacd_fft32x32_ld_dec;
|
||||||
|
|
||||||
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_dec;
|
WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo) = &ixheaacd_neg_expo_inc_dec;
|
||||||
|
|
||||||
VOID (*ixheaacd_inv_dit_fft_8pt)
|
VOID(*ixheaacd_inv_dit_fft_8pt)
|
||||||
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_dec;
|
(WORD32 *x, WORD32 *real, WORD32 *imag) = &ixheaacd_inv_dit_fft_8pt_dec;
|
||||||
|
|
||||||
VOID (*ixheaacd_scale_factor_process)
|
VOID(*ixheaacd_scale_factor_process)
|
||||||
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
(WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width,
|
||||||
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type,
|
||||||
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec;
|
WORD32 aac_sf_data_resil_flag) = &ixheaacd_scale_factor_process_dec;
|
||||||
|
|
|
||||||
|
|
@ -723,8 +723,8 @@ VOID ixheaacd_inv_modulation_lp(WORD32 *qmf_real, WORD16 *filter_states,
|
||||||
filter_states[3 * M] = 0;
|
filter_states[3 * M] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_inv_emodulation(
|
VOID ixheaacd_inv_emodulation(WORD32 *qmf_real,
|
||||||
WORD32 *qmf_real, ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
ia_sbr_qmf_filter_bank_struct *syn_qmf,
|
||||||
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) {
|
||||||
if (syn_qmf->no_channels == 64)
|
if (syn_qmf->no_channels == 64)
|
||||||
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, qmf_dec_tables_ptr->w_32,
|
ixheaacd_cos_sin_mod(qmf_real, syn_qmf, qmf_dec_tables_ptr->w_32,
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
#define MPYHIRC(x, y) \
|
#define MPYHIRC(x, y) \
|
||||||
\
|
\
|
||||||
(((WORD32)((short)(x >> 16) * (unsigned short)(y & 0x0000FFFF) + 0x4000) >> \
|
(((WORD32)((short)(x >> 16) * (unsigned short)(y & 0x0000FFFF) + 0x4000) >> \
|
||||||
15) + \
|
15) + \
|
||||||
((WORD32)((short)(x >> 16) * (short)((y) >> 16)) << 1))
|
((WORD32)((short)(x >> 16) * (short)((y) >> 16)) << 1))
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ static PLATFORM_INLINE WORD32 ixheaacd_shr32_drc(WORD32 a, WORD32 b) {
|
||||||
else
|
else
|
||||||
out_val = 0;
|
out_val = 0;
|
||||||
} else {
|
} else {
|
||||||
a = ixheaacd_add32_sat(a,(1 << (b - 1)));
|
a = ixheaacd_add32_sat(a, (1 << (b - 1)));
|
||||||
out_val = (WORD32)a >> b;
|
out_val = (WORD32)a >> b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -256,8 +256,10 @@ VOID ixheaacd_tns_ar_filter_fixed_dec(WORD32 *spectrum, WORD32 size, WORD32 inc,
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_tns_ar_filter_fixed_non_neon_armv7(WORD32 *spectrum, WORD32 size,
|
VOID ixheaacd_tns_ar_filter_fixed_non_neon_armv7(WORD32 *spectrum, WORD32 size,
|
||||||
WORD32 inc, WORD32 *lpc, WORD32 order,
|
WORD32 inc, WORD32 *lpc,
|
||||||
WORD32 shift_value, WORD scale_spec) {
|
WORD32 order,
|
||||||
|
WORD32 shift_value,
|
||||||
|
WORD scale_spec) {
|
||||||
WORD32 i, j;
|
WORD32 i, j;
|
||||||
WORD32 y, state[MAX_ORDER + 1];
|
WORD32 y, state[MAX_ORDER + 1];
|
||||||
WORD32 acc;
|
WORD32 acc;
|
||||||
|
|
|
||||||
|
|
@ -647,8 +647,7 @@ WORD32 ixheaacd_aacdec_decodeframe(
|
||||||
it_bit_buff, ptr_ics_info, object_type,
|
it_bit_buff, ptr_ics_info, object_type,
|
||||||
aac_dec_handle->samples_per_frame, LEFT);
|
aac_dec_handle->samples_per_frame, LEFT);
|
||||||
|
|
||||||
if(temp!=0)
|
if (temp != 0) {
|
||||||
{
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -706,8 +705,9 @@ WORD32 ixheaacd_aacdec_decodeframe(
|
||||||
ixheaacd_extension_payload(it_bit_buff, cnt_bits);
|
ixheaacd_extension_payload(it_bit_buff, cnt_bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((object_type == AOT_ER_AAC_ELD) || (object_type == AOT_ER_AAC_LD))
|
if (((object_type == AOT_ER_AAC_ELD) ||
|
||||||
&& (p_obj_exhaacplus_dec->aac_config.ld_decoder != 1)) {
|
(object_type == AOT_ER_AAC_LD)) &&
|
||||||
|
(p_obj_exhaacplus_dec->aac_config.ld_decoder != 1)) {
|
||||||
if (it_bit_buff->cnt_bits) {
|
if (it_bit_buff->cnt_bits) {
|
||||||
WORD32 alignment = it_bit_buff->bit_pos & 0x07;
|
WORD32 alignment = it_bit_buff->bit_pos & 0x07;
|
||||||
it_bit_buff->cnt_bits = (it_bit_buff->cnt_bits + alignment) & 7;
|
it_bit_buff->cnt_bits = (it_bit_buff->cnt_bits + alignment) & 7;
|
||||||
|
|
|
||||||
|
|
@ -506,8 +506,7 @@ WORD32 ixheaacd_acelp_alias_cnx(ia_usac_data_struct *usac_data,
|
||||||
ixheaacd_preemphsis_tool_float(code, TILT_CODE, LEN_SUBFR, tmp);
|
ixheaacd_preemphsis_tool_float(code, TILT_CODE, LEN_SUBFR, tmp);
|
||||||
i = pitch_lag;
|
i = pitch_lag;
|
||||||
if (pitch_lag_frac > 2) i++;
|
if (pitch_lag_frac > 2) i++;
|
||||||
if(i >= 0)
|
if (i >= 0) ixheaacd_acelp_pitch_sharpening(code, i);
|
||||||
ixheaacd_acelp_pitch_sharpening(code, i);
|
|
||||||
|
|
||||||
index = pstr_td_frame_data->gains[k * 4 + subfr_nb];
|
index = pstr_td_frame_data->gains[k * 4 + subfr_nb];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ IA_ERRORCODE ixheaacd_dec_mem_api(
|
||||||
UWORD32 *meminfo =
|
UWORD32 *meminfo =
|
||||||
(UWORD32 *)p_obj_exhaacplus_dec->p_mem_info_aac + i_idx;
|
(UWORD32 *)p_obj_exhaacplus_dec->p_mem_info_aac + i_idx;
|
||||||
UWORD32 pers_size = meminfo[0];
|
UWORD32 pers_size = meminfo[0];
|
||||||
p_temp = p_temp + pers_size - (sizeof(ia_dec_data_struct) +
|
p_temp = p_temp + pers_size -
|
||||||
|
(sizeof(ia_dec_data_struct) +
|
||||||
sizeof(ia_audio_specific_config_struct) + (8300));
|
sizeof(ia_audio_specific_config_struct) + (8300));
|
||||||
p_obj_exhaacplus_dec->p_state_aac = pv_value;
|
p_obj_exhaacplus_dec->p_state_aac = pv_value;
|
||||||
|
|
||||||
|
|
@ -153,8 +154,9 @@ IA_ERRORCODE ixheaacd_dec_mem_api(
|
||||||
p_obj_exhaacplus_dec->p_state_aac->pstr_dec_data = p_temp;
|
p_obj_exhaacplus_dec->p_state_aac->pstr_dec_data = p_temp;
|
||||||
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config =
|
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config =
|
||||||
p_temp + sizeof(ia_dec_data_struct);
|
p_temp + sizeof(ia_dec_data_struct);
|
||||||
p_obj_exhaacplus_dec->p_state_aac->header_ptr = p_temp + sizeof(ia_dec_data_struct)
|
p_obj_exhaacplus_dec->p_state_aac->header_ptr =
|
||||||
+ sizeof(ia_audio_specific_config_struct);
|
p_temp + sizeof(ia_dec_data_struct) +
|
||||||
|
sizeof(ia_audio_specific_config_struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -665,7 +667,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_ENHAACPLUS_DEC_DRC_EFFECT_TYPE: {
|
case IA_ENHAACPLUS_DEC_DRC_EFFECT_TYPE: {
|
||||||
if (((*pui_value_signed) > 8) || ((*pui_value_signed) < -1) ) {
|
if (((*pui_value_signed) > 8) || ((*pui_value_signed) < -1)) {
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_effect_type = -1;
|
p_obj_exhaacplus_dec->aac_config.ui_effect_type = -1;
|
||||||
return (IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE);
|
return (IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
@ -673,16 +675,16 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IA_ENHAACPLUS_DEC_DRC_TARGET_LOUDNESS: {
|
case IA_ENHAACPLUS_DEC_DRC_TARGET_LOUDNESS: {
|
||||||
if(*pui_value_signed>=0)
|
if (*pui_value_signed >= 0) {
|
||||||
{
|
p_obj_exhaacplus_dec->aac_config.ui_loud_norm_flag = 1;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_loud_norm_flag=1;
|
|
||||||
}
|
}
|
||||||
*pui_value_signed = -(*pui_value_signed >> 2);
|
*pui_value_signed = -(*pui_value_signed >> 2);
|
||||||
if (((*pui_value_signed) > 0) ||((*pui_value_signed) < -63)) {
|
if (((*pui_value_signed) > 0) || ((*pui_value_signed) < -63)) {
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = 0;
|
||||||
return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS);
|
return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS);
|
||||||
}
|
}
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = *pui_value_signed;
|
p_obj_exhaacplus_dec->aac_config.ui_target_loudness =
|
||||||
|
*pui_value_signed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: { return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM; }
|
default: { return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM; }
|
||||||
|
|
@ -697,8 +699,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
|
|
||||||
if (i_idx >= 0 && i_idx <= 8) {
|
if (i_idx >= 0 && i_idx <= 8) {
|
||||||
*pui_value = pvalue[i_idx];
|
*pui_value = pvalue[i_idx];
|
||||||
}
|
} else if (IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR == i_idx) {
|
||||||
else if (IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR == i_idx) {
|
|
||||||
ia_audio_specific_config_struct *ptr_audio_specific_config =
|
ia_audio_specific_config_struct *ptr_audio_specific_config =
|
||||||
((ia_audio_specific_config_struct *)
|
((ia_audio_specific_config_struct *)
|
||||||
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config);
|
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config);
|
||||||
|
|
@ -767,8 +768,7 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config);
|
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config);
|
||||||
*pp_value = ptr_audio_specific_config->str_usac_config
|
*pp_value = ptr_audio_specific_config->str_usac_config
|
||||||
.str_usac_dec_config.usac_ext_gain_payload_buf;
|
.str_usac_dec_config.usac_ext_gain_payload_buf;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM;
|
return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -910,18 +910,19 @@ IA_ERRORCODE ixheaacd_decoder_flush_api(
|
||||||
sizeof(ia_aac_dec_state_struct));
|
sizeof(ia_aac_dec_state_struct));
|
||||||
{
|
{
|
||||||
pUWORD8 p_temp = (pUWORD8)p_obj_exhaacplus_dec->p_state_aac;
|
pUWORD8 p_temp = (pUWORD8)p_obj_exhaacplus_dec->p_state_aac;
|
||||||
UWORD32 *meminfo =
|
UWORD32 *meminfo = (UWORD32 *)p_obj_exhaacplus_dec->p_mem_info_aac;
|
||||||
(UWORD32 *)p_obj_exhaacplus_dec->p_mem_info_aac;
|
|
||||||
UWORD32 pers_size = meminfo[0];
|
UWORD32 pers_size = meminfo[0];
|
||||||
p_temp = p_temp + pers_size - (sizeof(ia_dec_data_struct) +
|
p_temp = p_temp + pers_size -
|
||||||
|
(sizeof(ia_dec_data_struct) +
|
||||||
sizeof(ia_audio_specific_config_struct) + (8300));
|
sizeof(ia_audio_specific_config_struct) + (8300));
|
||||||
|
|
||||||
p_obj_exhaacplus_dec->p_state_aac->pstr_dec_data = p_temp;
|
p_obj_exhaacplus_dec->p_state_aac->pstr_dec_data = p_temp;
|
||||||
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config =
|
p_obj_exhaacplus_dec->p_state_aac->ia_audio_specific_config =
|
||||||
p_temp + sizeof(ia_dec_data_struct);
|
p_temp + sizeof(ia_dec_data_struct);
|
||||||
p_obj_exhaacplus_dec->p_state_aac->header_ptr = p_temp + sizeof(ia_dec_data_struct)
|
p_obj_exhaacplus_dec->p_state_aac->header_ptr =
|
||||||
+ sizeof(ia_audio_specific_config_struct);
|
p_temp + sizeof(ia_dec_data_struct) +
|
||||||
}
|
sizeof(ia_audio_specific_config_struct);
|
||||||
|
}
|
||||||
memset(&(p_obj_exhaacplus_dec->aac_config), 0,
|
memset(&(p_obj_exhaacplus_dec->aac_config), 0,
|
||||||
sizeof(ia_aac_dec_config_struct));
|
sizeof(ia_aac_dec_config_struct));
|
||||||
|
|
||||||
|
|
@ -1496,7 +1497,7 @@ IA_ERRORCODE ixheaacd_dec_init(
|
||||||
p_state_enhaacplus_dec->ptr_bit_stream =
|
p_state_enhaacplus_dec->ptr_bit_stream =
|
||||||
p_state_enhaacplus_dec->pstr_bit_buf;
|
p_state_enhaacplus_dec->pstr_bit_buf;
|
||||||
|
|
||||||
if (p_state_enhaacplus_dec->s_adts_hdr_present) { //rajat
|
if (p_state_enhaacplus_dec->s_adts_hdr_present) { // rajat
|
||||||
if (p_obj_exhaacplus_dec->aac_config.ld_decoder == 1)
|
if (p_obj_exhaacplus_dec->aac_config.ld_decoder == 1)
|
||||||
p_state_enhaacplus_dec->audio_object_type = 23;
|
p_state_enhaacplus_dec->audio_object_type = 23;
|
||||||
}
|
}
|
||||||
|
|
@ -2340,7 +2341,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
|
||||||
{ it_bit_buff->initial_cnt_bits = it_bit_buff->cnt_bits; }
|
{ it_bit_buff->initial_cnt_bits = it_bit_buff->cnt_bits; }
|
||||||
|
|
||||||
if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_LD) {
|
if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_LD) {
|
||||||
if(p_state_enhaacplus_dec->s_adts_hdr_present)
|
if (p_state_enhaacplus_dec->s_adts_hdr_present)
|
||||||
p_state_enhaacplus_dec->frame_size = adts.aac_frame_length;
|
p_state_enhaacplus_dec->frame_size = adts.aac_frame_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@
|
||||||
|
|
||||||
#include "ixheaacd_error_codes.h"
|
#include "ixheaacd_error_codes.h"
|
||||||
|
|
||||||
|
|
||||||
#define ARITH_ESCAPE 16
|
#define ARITH_ESCAPE 16
|
||||||
|
|
||||||
UWORD16 ixheaacd_ari_cf_r[3][4] = {
|
UWORD16 ixheaacd_ari_cf_r[3][4] = {
|
||||||
|
|
@ -1673,8 +1672,6 @@ VOID ixheaacd_copy_to_bitbuff(ia_bit_buf_struct *it_bit_buff_src,
|
||||||
it_bit_buff_dst->size = it_bit_buff_src->size;
|
it_bit_buff_dst->size = it_bit_buff_src->size;
|
||||||
|
|
||||||
it_bit_buff_dst->max_size = it_bit_buff_src->max_size;
|
it_bit_buff_dst->max_size = it_bit_buff_src->max_size;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD32 ixheaacd_arith_get_context(WORD8 *c_prev, WORD8 *c_pres,
|
static WORD32 ixheaacd_arith_get_context(WORD8 *c_prev, WORD8 *c_pres,
|
||||||
|
|
@ -1826,8 +1823,7 @@ WORD32 ixheaacd_arth_decoding_level2(ia_bit_buf_struct *it_bit_buff,
|
||||||
pki = ixheaacd_arith_get_pk(s1 + ixheaacd_esc_nb_offset[esc_nb]);
|
pki = ixheaacd_arith_get_pk(s1 + ixheaacd_esc_nb_offset[esc_nb]);
|
||||||
bit_count = ixheaacd_arith_decode(&it_bit_buff_temp, bit_count, &m, &as,
|
bit_count = ixheaacd_arith_decode(&it_bit_buff_temp, bit_count, &m, &as,
|
||||||
ixheaacd_ari_cf_m[pki], 17);
|
ixheaacd_ari_cf_m[pki], 17);
|
||||||
if(bit_count == -1)
|
if (bit_count == -1) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1861,17 +1857,14 @@ WORD32 ixheaacd_arth_decoding_level2(ia_bit_buf_struct *it_bit_buff,
|
||||||
WORD32 lsbidx = (a == 0) ? 1 : ((b == 0) ? 0 : 2);
|
WORD32 lsbidx = (a == 0) ? 1 : ((b == 0) ? 0 : 2);
|
||||||
bit_count = ixheaacd_arith_decode(&it_bit_buff_temp, bit_count, &m, &as,
|
bit_count = ixheaacd_arith_decode(&it_bit_buff_temp, bit_count, &m, &as,
|
||||||
ixheaacd_ari_cf_r[lsbidx], 4);
|
ixheaacd_ari_cf_r[lsbidx], 4);
|
||||||
if(bit_count == -1)
|
if (bit_count == -1) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
a = (a << 1) | (m & 1);
|
a = (a << 1) | (m & 1);
|
||||||
b = (b << 1) | ((m >> 1) & 1);
|
b = (b << 1) | ((m >> 1) & 1);
|
||||||
}
|
}
|
||||||
if((a > (8183)) || (b > (8183)))
|
if ((a > (8183)) || (b > (8183))) return -1;
|
||||||
return -1;
|
if ((a < (-8183)) || (b < (-8183))) return -1;
|
||||||
if((a < (-8183)) || (b < (-8183)))
|
|
||||||
return -1;
|
|
||||||
quant[2 * i + 0] = a;
|
quant[2 * i + 0] = a;
|
||||||
quant[2 * i + 1] = b;
|
quant[2 * i + 1] = b;
|
||||||
temp = a + b + 1;
|
temp = a + b + 1;
|
||||||
|
|
@ -1883,7 +1876,7 @@ WORD32 ixheaacd_arth_decoding_level2(ia_bit_buf_struct *it_bit_buff,
|
||||||
}
|
}
|
||||||
|
|
||||||
bit_count -= 16 - 2;
|
bit_count -= 16 - 2;
|
||||||
if(bit_count > it_bit_buff->cnt_bits)
|
if (bit_count > it_bit_buff->cnt_bits)
|
||||||
return IA_ENHAACPLUS_DEC_EXE_NONFATAL_INSUFFICIENT_INPUT_BYTES;
|
return IA_ENHAACPLUS_DEC_EXE_NONFATAL_INSUFFICIENT_INPUT_BYTES;
|
||||||
|
|
||||||
if (bit_count > 0) {
|
if (bit_count > 0) {
|
||||||
|
|
@ -1910,10 +1903,8 @@ WORD32 ixheaacd_arth_decoding_level2(ia_bit_buf_struct *it_bit_buff,
|
||||||
m = (m << 1) * temp1;
|
m = (m << 1) * temp1;
|
||||||
temp1 = m - (temp1);
|
temp1 = m - (temp1);
|
||||||
}
|
}
|
||||||
if((temp0 > (8183)) || (temp1 > (8183)))
|
if ((temp0 > (8183)) || (temp1 > (8183))) return -1;
|
||||||
return -1;
|
if ((temp0 < (-8183)) || (temp1 < (-8183))) return -1;
|
||||||
if((temp0 < (-8183)) || (temp1 < (-8183)))
|
|
||||||
return -1;
|
|
||||||
*quant++ = temp0;
|
*quant++ = temp0;
|
||||||
*quant++ = temp1;
|
*quant++ = temp1;
|
||||||
}
|
}
|
||||||
|
|
@ -1976,7 +1967,7 @@ static VOID ixheaacd_esc_iquant(WORD32 *q, WORD32 *coef, WORD32 noise_level,
|
||||||
|
|
||||||
coef[i] = flag * (coef[i] << 1);
|
coef[i] = flag * (coef[i] << 1);
|
||||||
}
|
}
|
||||||
temp = ixheaacd_mult64_sat(fac_fix , (WORD64)coef[i]);
|
temp = ixheaacd_mult64_sat(fac_fix, (WORD64)coef[i]);
|
||||||
|
|
||||||
coef[i] = (WORD32)(temp >> 22);
|
coef[i] = (WORD32)(temp >> 22);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ VOID ixheaacd_voronoi_idx_dec(WORD32 *kv, WORD32 m, WORD32 *y, WORD32 count) {
|
||||||
}
|
}
|
||||||
y[0] += (4 * kv[0] + sum);
|
y[0] += (4 * kv[0] + sum);
|
||||||
z[0] = (y[0] - 2) >> count;
|
z[0] = (y[0] - 2) >> count;
|
||||||
if(m != 0)
|
if (m != 0)
|
||||||
rem1[0] = (y[0] - 2) % m;
|
rem1[0] = (y[0] - 2) % m;
|
||||||
else
|
else
|
||||||
rem1[0] = (y[0] - 2);
|
rem1[0] = (y[0] - 2);
|
||||||
|
|
|
||||||
|
|
@ -319,13 +319,9 @@ static PLATFORM_INLINE WORD32 ixheaacd_negate32(WORD32 a) {
|
||||||
static PLATFORM_INLINE WORD32 ixheaacd_negate32_sat(WORD32 a) {
|
static PLATFORM_INLINE WORD32 ixheaacd_negate32_sat(WORD32 a) {
|
||||||
WORD32 neg_val;
|
WORD32 neg_val;
|
||||||
|
|
||||||
|
if (a == MIN_32) {
|
||||||
if (a == MIN_32)
|
|
||||||
{
|
|
||||||
neg_val = MAX_32;
|
neg_val = MAX_32;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
neg_val = -a;
|
neg_val = -a;
|
||||||
}
|
}
|
||||||
return neg_val;
|
return neg_val;
|
||||||
|
|
|
||||||
|
|
@ -337,11 +337,10 @@ static PLATFORM_INLINE WORD64 ixheaacd_mult64_sat(WORD64 a, WORD64 b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLATFORM_INLINE WORD64 ixheaacd_add64_sat(WORD64 a, WORD64 b) {
|
static PLATFORM_INLINE WORD64 ixheaacd_add64_sat(WORD64 a, WORD64 b) {
|
||||||
WORD64 result , comp;
|
WORD64 result, comp;
|
||||||
result = (a < 0) ? MIN_64 : MAX_64;
|
result = (a < 0) ? MIN_64 : MAX_64;
|
||||||
comp = result - a;
|
comp = result - a;
|
||||||
if ((a < 0) == (b > comp))
|
if ((a < 0) == (b > comp)) result = a + b;
|
||||||
result = a + b;
|
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1199,7 +1199,6 @@ VOID ixheaacd_process_single_scf(WORD32 scale_factor, WORD32 *x_invquant,
|
||||||
object_type = 0;
|
object_type = 0;
|
||||||
aac_sf_data_resil_flag = 0;
|
aac_sf_data_resil_flag = 0;
|
||||||
|
|
||||||
|
|
||||||
if (scale_factor < 24) {
|
if (scale_factor < 24) {
|
||||||
for (j = width; j > 0; j--) {
|
for (j = width; j > 0; j--) {
|
||||||
*x_invquant++ = 0;
|
*x_invquant++ = 0;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue