Sanitization fixes from new CTS tests
am: 4908247643
Change-Id: Ie17c3d9e96f31c6c425df830c8ff992078c3730d
This commit is contained in:
commit
54276032af
151 changed files with 12153 additions and 9239 deletions
|
|
@ -11,7 +11,8 @@ cc_library_static {
|
||||||
],
|
],
|
||||||
|
|
||||||
export_include_dirs: [
|
export_include_dirs: [
|
||||||
"decoder"
|
"decoder",
|
||||||
|
"decoder/drc_src"
|
||||||
],
|
],
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
|
|
@ -215,7 +216,8 @@ cc_library_static {
|
||||||
"decoder/armv7/ixheaacd_fft_15_ld.s",
|
"decoder/armv7/ixheaacd_fft_15_ld.s",
|
||||||
"decoder/armv7/ixheaacd_aac_ld_dec_rearrange.s",
|
"decoder/armv7/ixheaacd_aac_ld_dec_rearrange.s",
|
||||||
"decoder/armv7/ixheaacd_fft32x32_ld2_armv7.s",
|
"decoder/armv7/ixheaacd_fft32x32_ld2_armv7.s",
|
||||||
"decoder/armv7/ixheaacd_apply_scale_fac.s"
|
"decoder/armv7/ixheaacd_apply_scale_fac.s",
|
||||||
|
"decoder/armv7/ixheaacd_tns_ar_filter_fixed.s"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -248,6 +250,7 @@ cc_library_static {
|
||||||
"decoder/armv8/ixheaacd_apply_scale_factors.s",
|
"decoder/armv8/ixheaacd_apply_scale_factors.s",
|
||||||
"decoder/armv8/ixheaacd_cos_sin_mod_loop1.s",
|
"decoder/armv8/ixheaacd_cos_sin_mod_loop1.s",
|
||||||
"decoder/armv8/ixheaacd_cos_sin_mod_loop2.s",
|
"decoder/armv8/ixheaacd_cos_sin_mod_loop2.s",
|
||||||
|
"decoder/armv8/ixheaacd_post_twiddle_overlap.s",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ 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_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,
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ NEON_PROLOGUE:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CORE_LOOP:
|
CORE_LOOP_PT:
|
||||||
VMULL.U16 Q15, D2, D13
|
VMULL.U16 Q15, D2, D13
|
||||||
VST2.32 {Q12, Q13}, [R7], R8
|
VST2.32 {Q12, Q13}, [R7], R8
|
||||||
VMULL.U16 Q14, D0, D13
|
VMULL.U16 Q14, D0, D13
|
||||||
|
|
@ -315,7 +315,7 @@ CORE_LOOP:
|
||||||
VADD.I32 Q8, Q11, Q8
|
VADD.I32 Q8, Q11, Q8
|
||||||
|
|
||||||
SUBS R3, R3, #1
|
SUBS R3, R3, #1
|
||||||
BNE CORE_LOOP
|
BNE CORE_LOOP_PT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ PROLOGUE_NEON:
|
||||||
VUZP.16 D22, D23
|
VUZP.16 D22, D23
|
||||||
VMOV D23, D30
|
VMOV D23, D30
|
||||||
|
|
||||||
CORE_LOOP:
|
CORE_LOOP_PTO:
|
||||||
VST1.16 D14[0], [R0, : 16], R9
|
VST1.16 D14[0], [R0, : 16], R9
|
||||||
VMULL.U16 Q15, D0, D9
|
VMULL.U16 Q15, D0, D9
|
||||||
|
|
||||||
|
|
@ -709,7 +709,7 @@ CORE_LOOP:
|
||||||
VMOV D23, D30
|
VMOV D23, D30
|
||||||
|
|
||||||
SUBS R3, R3, #1
|
SUBS R3, R3, #1
|
||||||
BNE CORE_LOOP
|
BNE CORE_LOOP_PTO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ NEON_PROLOGUE:
|
||||||
|
|
||||||
SUB R4, R4, #2
|
SUB R4, R4, #2
|
||||||
|
|
||||||
CORE_LOOP:
|
CORE_LOOP_PTC:
|
||||||
VMULL.U16 Q15, D2, D9
|
VMULL.U16 Q15, D2, D9
|
||||||
VST2.32 {Q8, Q9}, [R2]!
|
VST2.32 {Q8, Q9}, [R2]!
|
||||||
VMULL.U16 Q14, D4, D9
|
VMULL.U16 Q14, D4, D9
|
||||||
|
|
@ -248,7 +248,7 @@ CORE_LOOP:
|
||||||
VSHL.S32 Q8, Q14, Q7
|
VSHL.S32 Q8, Q14, Q7
|
||||||
|
|
||||||
SUBS R4, R4, #1
|
SUBS R4, R4, #1
|
||||||
BNE CORE_LOOP
|
BNE CORE_LOOP_PTC
|
||||||
|
|
||||||
NEON_EPILOGUE:
|
NEON_EPILOGUE:
|
||||||
VMULL.U16 Q15, D2, D9
|
VMULL.U16 Q15, D2, D9
|
||||||
|
|
|
||||||
553
decoder/armv7/ixheaacd_tns_ar_filter_fixed.s
Normal file
553
decoder/armv7/ixheaacd_tns_ar_filter_fixed.s
Normal file
|
|
@ -0,0 +1,553 @@
|
||||||
|
|
||||||
|
@/******************************************************************************
|
||||||
|
@ *
|
||||||
|
@ * Copyright (C) 2018 The Android Open Source Project
|
||||||
|
@ *
|
||||||
|
@ * Licensed under the Apache License, Version 2.0 (the "License")@
|
||||||
|
@ * you may not use this file except in compliance with the License.
|
||||||
|
@ * You may obtain a copy of the License at:
|
||||||
|
@ *
|
||||||
|
@ * http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@ *
|
||||||
|
@ * Unless required by applicable law or agreed to in writing, software
|
||||||
|
@ * distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ * See the License for the specific language governing permissions and
|
||||||
|
@ * limitations under the License.
|
||||||
|
@ *
|
||||||
|
@ *****************************************************************************
|
||||||
|
@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
||||||
|
@*/
|
||||||
|
|
||||||
|
|
||||||
|
.text
|
||||||
|
.p2align 2
|
||||||
|
|
||||||
|
.text
|
||||||
|
.p2align 2
|
||||||
|
.global ixheaacd_tns_ar_filter_fixed_armv7
|
||||||
|
|
||||||
|
ixheaacd_tns_ar_filter_fixed_armv7:
|
||||||
|
STMFD r13! , {r4 - r12, r14}
|
||||||
|
vpush {d8-d15}
|
||||||
|
SUB sp, sp, #128 @ state[MaximumOrder] + one more
|
||||||
|
LDR r4, [sp,#232] @order
|
||||||
|
LDR r6, [sp,#236] @shift_value
|
||||||
|
STR r1, [sp]
|
||||||
|
ADD r12, sp, #4 @ r12 = state
|
||||||
|
ANDS r5, r4, #3
|
||||||
|
BEQ FILTER_LOOP
|
||||||
|
MOV r8, #0
|
||||||
|
ADD r14, r3, r4,LSL #2
|
||||||
|
RSBS r7, r5, #3
|
||||||
|
BEQ ORDER_LOOPEND
|
||||||
|
ORDER_LOOP:
|
||||||
|
STR r8, [r14,#4]! @lpc[i] = 0
|
||||||
|
SUBS r7, r7, #1
|
||||||
|
BGT ORDER_LOOP
|
||||||
|
ORDER_LOOPEND:
|
||||||
|
STR r8, [r14,#4] @lpc[i] = 0
|
||||||
|
BIC r4, r4, #3
|
||||||
|
ADD r4, r4, #4 @order = ( (order & 0xfffffffc) +4 )
|
||||||
|
|
||||||
|
|
||||||
|
FILTER_LOOP:
|
||||||
|
LDR r1, [sp,#240] @scaleSpec
|
||||||
|
@filtering loop here
|
||||||
|
CMP r2, #1 @ inc =1 or -1
|
||||||
|
MOV r7, r4 @loop_count
|
||||||
|
BNE NEG_INC
|
||||||
|
|
||||||
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
MOV r8, r8, lsl r1
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
MOV r8 , r8 ,lsl r6
|
||||||
|
STR r8 , [r12] @state[0] = sp[top]
|
||||||
|
STR r9, [r0], #4
|
||||||
|
BEQ FILTER_LOOP2
|
||||||
|
FILTER_LOOP1: @siva 16 times loop run
|
||||||
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
|
SUB r5 , r4 , r7 @
|
||||||
|
MOV r5 , r5 ,lsl #2
|
||||||
|
MOV r11 , #0 @accu = 0
|
||||||
|
ADD r14, r12, r5 @state[j]
|
||||||
|
INNER_LOOP1:
|
||||||
|
LDR r10 , [r14,#-4] @state[j-1]
|
||||||
|
LDR r9 , [r3 , r5] @lpc[j]
|
||||||
|
SUBS r5 , r5 , #4
|
||||||
|
|
||||||
|
MOV r2, #0
|
||||||
|
SMLAL r2 , r11, r10, r9
|
||||||
|
STR r10 , [r14], #-4 @state[j] = state[j - 1]
|
||||||
|
BGT INNER_LOOP1
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1
|
||||||
|
SUB r8 , r8 , r11,lsl #1
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
STR r9 , [r0], #4 @*spectrum = y@
|
||||||
|
SUBS r7 , r7 , #1 @i--
|
||||||
|
MOV r8 , r8 ,lsl r6
|
||||||
|
STR r8 , [r12] @state[0]
|
||||||
|
BGT FILTER_LOOP1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@inc=1,order=4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FILTER_LOOP2:
|
||||||
|
LDR R1, [sp] @size
|
||||||
|
ADD R8, R3, #4
|
||||||
|
|
||||||
|
SUBS R7 , R1 , r4 @size-order
|
||||||
|
BEQ EXIT
|
||||||
|
|
||||||
|
LDR R1, [sp,#240] @scaleSpec
|
||||||
|
|
||||||
|
MOV R5 , R4 ,LSL #2 @count for inner loop = order
|
||||||
|
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
||||||
|
MOV R14,#0
|
||||||
|
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
||||||
|
|
||||||
|
CMP R4,#4
|
||||||
|
VLD1.32 {D18, D19}, [R8]!
|
||||||
|
BEQ ORDER4
|
||||||
|
VLD1.32 {D22, D23}, [R12]!
|
||||||
|
|
||||||
|
CMP R4,#8
|
||||||
|
VLD1.32 {D20, D21}, [R8]!
|
||||||
|
BEQ ORDER8
|
||||||
|
CMP R4,#12
|
||||||
|
VLD1.32 {D24, D25}, [R12]!
|
||||||
|
BEQ ORDER12
|
||||||
|
|
||||||
|
VLD1.32 {D26, D27},[R8]!
|
||||||
|
CMP R4,#16
|
||||||
|
VLD1.32 {D28, D29},[R12]!
|
||||||
|
BEQ ORDER16 @order16 added
|
||||||
|
|
||||||
|
VLD1.32 {D4, D5},[R8]!
|
||||||
|
CMP R4,#20
|
||||||
|
VLD1.32 {D8, D9},[R12]!
|
||||||
|
BEQ ORDER20 @order20 added
|
||||||
|
|
||||||
|
ORDER4:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
OUTER_LOOP2_4:
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
|
||||||
|
VSHR.S64 D6,#32 @acc1=acc>>32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
BGT OUTER_LOOP2_4
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
ORDER8:
|
||||||
|
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
OUTER_LOOP2_8:
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VSHR.S64 D6,#32 @acc = mac32_tns_neon(state[j - 1],lpc[j],acc, temp_lo)@
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
STR r9 , [r0],#4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
BGT OUTER_LOOP2_8
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ORDER12:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
OUTER_LOOP2_12:
|
||||||
|
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
VMLAL.S32 Q1, D24, D20
|
||||||
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q12,Q11,Q12,#3
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
BGT OUTER_LOOP2_12
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
|
||||||
|
|
||||||
|
ORDER16:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
OUTER_LOOP2_16:
|
||||||
|
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
VMLAL.S32 Q1, D24, D20
|
||||||
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
VMLAL.S32 Q1, D28, D26 @
|
||||||
|
VMLAL.S32 Q1, D29, D27 @ @order16
|
||||||
|
|
||||||
|
VEXT.32 Q14,Q12,Q14,#3
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q12,Q11,Q12,#3
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
BGT OUTER_LOOP2_16
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
|
||||||
|
ORDER20:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
OUTER_LOOP2_20:
|
||||||
|
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
VMLAL.S32 Q1, D24, D20
|
||||||
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
VMLAL.S32 Q1, D28, D26 @
|
||||||
|
VMLAL.S32 Q1, D29, D27 @ @order16
|
||||||
|
VMLAL.S32 Q1, D8, D4 @order20
|
||||||
|
VMLAL.S32 Q1, D9, D5 @order20
|
||||||
|
|
||||||
|
|
||||||
|
VEXT.32 Q4,Q14,Q4,#3 @ @for order20
|
||||||
|
VEXT.32 Q14,Q12,Q14,#3 @ @for order16
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q12,Q11,Q12,#3 @order12
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3 @order8
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
BGT OUTER_LOOP2_20
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
|
||||||
|
NEG_INC:
|
||||||
|
@ filtering loop for inc = -1
|
||||||
|
|
||||||
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
MOV r8, r8, lsl r1
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
MOV r8 , r8 ,lsl r6
|
||||||
|
STR r8 , [r12] @state[0] = sp[top]
|
||||||
|
STR r9, [r0], #-4
|
||||||
|
BEQ NEGFILTER_LOOP2
|
||||||
|
NEGFILTER_LOOP1:
|
||||||
|
LDR r8 , [r0] @r8 =*spectrum
|
||||||
|
SUB r5 , r4 , r7 @
|
||||||
|
MOV r5 , r5 ,lsl #2
|
||||||
|
MOV r11 , #0 @accu = 0
|
||||||
|
ADD r14, r12, r5 @state[j]
|
||||||
|
NEGINNER_LOOP1:
|
||||||
|
LDR r10 , [r14,#-4] @state[j-1]
|
||||||
|
LDR r9 , [r3 , r5] @lpc[j]
|
||||||
|
SUBS r5 , r5 , #4
|
||||||
|
|
||||||
|
MOV r2, #0
|
||||||
|
SMLAL r2 , r11, r10, r9
|
||||||
|
STR r10 , [r14], #-4 @state[j] = state[j - 1]
|
||||||
|
BGT NEGINNER_LOOP1
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1
|
||||||
|
SUB r8 , r8 , r11,lsl #1
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
STR r9 , [r0], #-4 @*spectrum = y@
|
||||||
|
SUBS r7 , r7 , #1 @i--
|
||||||
|
MOV r8 , r8 ,lsl r6
|
||||||
|
STR r8 , [r12] @state[0]
|
||||||
|
BGT NEGFILTER_LOOP1
|
||||||
|
|
||||||
|
NEGFILTER_LOOP2:
|
||||||
|
LDR R1, [sp] @size
|
||||||
|
SUBS R7 , R1 , r4 @size-order
|
||||||
|
BEQ EXIT
|
||||||
|
|
||||||
|
ADD R8, R3, #4
|
||||||
|
|
||||||
|
MOV R14,#0
|
||||||
|
VLD1.32 {D10, D11}, [R8]! @lpc[j]
|
||||||
|
MOV R5 , R4 ,LSL #2 @count for inner loop = order
|
||||||
|
|
||||||
|
LDR R1, [sp,#240] @scaleSpec
|
||||||
|
|
||||||
|
CMP R4,#4
|
||||||
|
VLD1.32 {D12, D13}, [R12]! @state[j - 1]
|
||||||
|
BEQ NEGORDER4
|
||||||
|
|
||||||
|
VLD1.32 {D18, D19}, [R8]!
|
||||||
|
CMP R4,#8
|
||||||
|
|
||||||
|
VLD1.32 {D22, D23}, [R12]!
|
||||||
|
BEQ NEGORDER8
|
||||||
|
|
||||||
|
VLD1.32 {D20, D21}, [R8]!
|
||||||
|
CMP R4,#12
|
||||||
|
|
||||||
|
VLD1.32 {D24, D25}, [R12]!
|
||||||
|
BEQ NEGORDER12
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NEGORDER4:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
NEGOUTER_LOOP2_4:
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6
|
||||||
|
|
||||||
|
VMOV.32 D15[1], R2
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#-4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
BGT NEGOUTER_LOOP2_4
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
NEGORDER8:
|
||||||
|
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
NEGOUTER_LOOP2_8:
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#-4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
BGT NEGOUTER_LOOP2_8
|
||||||
|
|
||||||
|
B EXIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NEGORDER12:
|
||||||
|
LDR r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
NEGOUTER_LOOP2_12:
|
||||||
|
|
||||||
|
VDUP.32 Q1,R14 @Q1= accu = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VMLAL.S32 Q1, D10, D12
|
||||||
|
VMLAL.S32 Q1, D11, D13
|
||||||
|
VMLAL.S32 Q1, D22, D18
|
||||||
|
VMLAL.S32 Q1, D23, D19
|
||||||
|
VMLAL.S32 Q1, D24, D20
|
||||||
|
VMLAL.S32 Q1, D25, D21
|
||||||
|
|
||||||
|
MOV r8, r8, lsl r1 @y = (*spectrum) << scaleSpec
|
||||||
|
VEXT.32 Q12,Q11,Q12,#3
|
||||||
|
SUBS r7 , r7 , #1
|
||||||
|
|
||||||
|
VADD.I64 D6,D2,D3
|
||||||
|
VEXT.32 Q11,Q6,Q11,#3
|
||||||
|
VSHR.S64 D6,#32
|
||||||
|
|
||||||
|
|
||||||
|
@VMOV R11,D6[0]
|
||||||
|
VST1.32 D6[0],[SP]
|
||||||
|
LDR R11,[SP]
|
||||||
|
SUB r8 , r8 , r11,lsl #1 @y=sub32(y,(acc<<1))
|
||||||
|
|
||||||
|
MOV r2 , r8 ,lsl r6 @ shl32(y, shift_value)
|
||||||
|
|
||||||
|
VMOV.32 D15[1], R2 @state[0]
|
||||||
|
MOV r9, r8, asr r1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
STR r9 , [r0],#-4 @*spectrum = y@
|
||||||
|
VEXT.32 Q6,Q7,Q6,#3
|
||||||
|
LDRGT r8 , [r0] @r8 = y = *spectrum
|
||||||
|
|
||||||
|
|
||||||
|
BGT NEGOUTER_LOOP2_12
|
||||||
|
|
||||||
|
|
||||||
|
EXIT:
|
||||||
|
ADD sp, sp ,#128
|
||||||
|
vpop {d8-d15}
|
||||||
|
LDMFD r13!, {r4 - r12, r15}
|
||||||
2033
decoder/armv8/ixheaacd_post_twiddle_overlap.s
Normal file
2033
decoder/armv8/ixheaacd_post_twiddle_overlap.s
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -24,48 +24,51 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Ittiam standard API commands */
|
/* Ittiam standard API commands */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
#define IA_API_CMD_GET_LIB_ID_STRINGS 0x0001
|
#define IA_API_CMD_GET_LIB_ID_STRINGS 0x0001
|
||||||
|
|
||||||
#define IA_API_CMD_GET_API_SIZE 0x0002
|
#define IA_API_CMD_GET_API_SIZE 0x0002
|
||||||
#define IA_API_CMD_INIT 0x0003
|
#define IA_API_CMD_INIT 0x0003
|
||||||
|
|
||||||
#define IA_API_CMD_SET_CONFIG_PARAM 0x0004
|
#define IA_API_CMD_SET_CONFIG_PARAM 0x0004
|
||||||
#define IA_API_CMD_GET_CONFIG_PARAM 0x0005
|
#define IA_API_CMD_GET_CONFIG_PARAM 0x0005
|
||||||
|
|
||||||
#define IA_API_CMD_GET_MEMTABS_SIZE 0x0006
|
#define IA_API_CMD_GET_MEMTABS_SIZE 0x0006
|
||||||
#define IA_API_CMD_SET_MEMTABS_PTR 0x0007
|
#define IA_API_CMD_SET_MEMTABS_PTR 0x0007
|
||||||
#define IA_API_CMD_GET_N_MEMTABS 0x0008
|
#define IA_API_CMD_GET_N_MEMTABS 0x0008
|
||||||
|
|
||||||
#define IA_API_CMD_EXECUTE 0x0009
|
#define IA_API_CMD_EXECUTE 0x0009
|
||||||
|
|
||||||
#define IA_API_CMD_PUT_INPUT_QUERY 0x000A
|
#define IA_API_CMD_PUT_INPUT_QUERY 0x000A
|
||||||
#define IA_API_CMD_GET_CURIDX_INPUT_BUF 0x000B
|
#define IA_API_CMD_GET_CURIDX_INPUT_BUF 0x000B
|
||||||
#define IA_API_CMD_SET_INPUT_BYTES 0x000C
|
#define IA_API_CMD_SET_INPUT_BYTES 0x000C
|
||||||
#define IA_API_CMD_GET_OUTPUT_BYTES 0x000D
|
#define IA_API_CMD_GET_OUTPUT_BYTES 0x000D
|
||||||
#define IA_API_CMD_RESET 0x0010
|
#define IA_API_CMD_INPUT_OVER 0x000E
|
||||||
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_SIZE 0x0011
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_ALIGNMENT 0x0012
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_TYPE 0x0013
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_PLACEMENT 0x0014
|
|
||||||
#define IA_API_CMD_GET_MEM_INFO_PRIORITY 0x0015
|
|
||||||
#define IA_API_CMD_SET_MEM_PTR 0x0016
|
|
||||||
#define IA_API_CMD_SET_MEM_INFO_SIZE 0x0017
|
|
||||||
#define IA_API_CMD_SET_MEM_PLACEMENT 0x0018
|
|
||||||
|
|
||||||
#define IA_API_CMD_GET_N_TABLES 0x0019
|
#define IA_API_CMD_RESET 0x0010
|
||||||
#define IA_API_CMD_GET_TABLE_INFO_SIZE 0x001A
|
|
||||||
#define IA_API_CMD_GET_TABLE_INFO_ALIGNMENT 0x001B
|
|
||||||
#define IA_API_CMD_GET_TABLE_INFO_PRIORITY 0x001C
|
|
||||||
#define IA_API_CMD_SET_TABLE_PTR 0x001D
|
|
||||||
#define IA_API_CMD_GET_TABLE_PTR 0x001E
|
|
||||||
|
|
||||||
#define IA_API_CMD_INPUT_OVER 0x0020
|
#define IA_API_CMD_GET_MEM_INFO_SIZE 0x0011
|
||||||
#define IA_API_CMD_INPUT_OVER_BS 0x0021
|
#define IA_API_CMD_GET_MEM_INFO_ALIGNMENT 0x0012
|
||||||
#define IA_API_CMD_INPUT_OVER_IC_BS 0x0022
|
#define IA_API_CMD_GET_MEM_INFO_TYPE 0x0013
|
||||||
#define IA_API_CMD_INPUT_OVER_IG_BS 0x0023
|
#define IA_API_CMD_GET_MEM_INFO_PLACEMENT 0x0014
|
||||||
#define IA_API_CMD_INPUT_OVER_IL_BS 0x0024
|
#define IA_API_CMD_GET_MEM_INFO_PRIORITY 0x0015
|
||||||
#define IA_API_CMD_INPUT_OVER_IN_BS 0x0025
|
#define IA_API_CMD_SET_MEM_PTR 0x0016
|
||||||
|
#define IA_API_CMD_SET_MEM_INFO_SIZE 0x0017
|
||||||
|
#define IA_API_CMD_SET_MEM_PLACEMENT 0x0018
|
||||||
|
|
||||||
|
#define IA_API_CMD_GET_N_TABLES 0x0019
|
||||||
|
#define IA_API_CMD_GET_TABLE_INFO_SIZE 0x001A
|
||||||
|
#define IA_API_CMD_GET_TABLE_INFO_ALIGNMENT 0x001B
|
||||||
|
#define IA_API_CMD_GET_TABLE_INFO_PRIORITY 0x001C
|
||||||
|
#define IA_API_CMD_SET_TABLE_PTR 0x001D
|
||||||
|
#define IA_API_CMD_GET_TABLE_PTR 0x001E
|
||||||
|
|
||||||
|
|
||||||
|
#define IA_API_CMD_INPUT_OVER_BS 0x0021
|
||||||
|
#define IA_API_CMD_INPUT_OVER_IC_BS 0x0022
|
||||||
|
#define IA_API_CMD_INPUT_OVER_IG_BS 0x0023
|
||||||
|
#define IA_API_CMD_INPUT_OVER_IL_BS 0x0024
|
||||||
|
#define IA_API_CMD_INPUT_OVER_IN_BS 0x0025
|
||||||
|
|
||||||
#define IA_API_CMD_SET_INPUT_BYTES_BS 0x0026
|
#define IA_API_CMD_SET_INPUT_BYTES_BS 0x0026
|
||||||
#define IA_API_CMD_SET_INPUT_BYTES_IC_BS 0x0027
|
#define IA_API_CMD_SET_INPUT_BYTES_IC_BS 0x0027
|
||||||
|
|
@ -76,15 +79,15 @@
|
||||||
/* Ittiam standard API command indices */
|
/* Ittiam standard API command indices */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* IA_API_CMD_GET_LIB_ID_STRINGS indices */
|
/* IA_API_CMD_GET_LIB_ID_STRINGS indices */
|
||||||
#define IA_CMD_TYPE_LIB_NAME 0x0100
|
#define IA_CMD_TYPE_LIB_NAME 0x0100
|
||||||
#define IA_CMD_TYPE_LIB_VERSION 0x0200
|
#define IA_CMD_TYPE_LIB_VERSION 0x0200
|
||||||
#define IA_CMD_TYPE_API_VERSION 0x0300
|
#define IA_CMD_TYPE_API_VERSION 0x0300
|
||||||
|
|
||||||
/* IA_API_CMD_INIT indices */
|
/* IA_API_CMD_INIT indices */
|
||||||
#define IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS 0x0100
|
#define IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS 0x0100
|
||||||
#define IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS 0x0200
|
#define IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS 0x0200
|
||||||
#define IA_CMD_TYPE_INIT_PROCESS 0x0300
|
#define IA_CMD_TYPE_INIT_PROCESS 0x0300
|
||||||
#define IA_CMD_TYPE_INIT_DONE_QUERY 0x0400
|
#define IA_CMD_TYPE_INIT_DONE_QUERY 0x0400
|
||||||
|
|
||||||
#define IA_CMD_TYPE_INIT_CPY_BSF_BUFF 0x0201
|
#define IA_CMD_TYPE_INIT_CPY_BSF_BUFF 0x0201
|
||||||
#define IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF 0x0202
|
#define IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF 0x0202
|
||||||
|
|
@ -100,7 +103,7 @@
|
||||||
#define IA_CMD_TYPE_INIT_SET_BUFF_PTR 0x020B
|
#define IA_CMD_TYPE_INIT_SET_BUFF_PTR 0x020B
|
||||||
|
|
||||||
/* IA_API_CMD_EXECUTE indices */
|
/* IA_API_CMD_EXECUTE indices */
|
||||||
#define IA_CMD_TYPE_DO_EXECUTE 0x0100
|
#define IA_CMD_TYPE_DO_EXECUTE 0x0100
|
||||||
#define IA_CMD_TYPE_DONE_QUERY 0x0200
|
#define IA_CMD_TYPE_DONE_QUERY 0x0200
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -26,26 +26,26 @@
|
||||||
/* Constant hash defines */
|
/* Constant hash defines */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* A constant to let API copy small strings to buffers outside */
|
/* A constant to let API copy small strings to buffers outside */
|
||||||
#define IA_API_STR_LEN 30
|
#define IA_API_STR_LEN 30
|
||||||
#define IA_APIVERSION_MAJOR 1
|
#define IA_APIVERSION_MAJOR 1
|
||||||
#define IA_APIVERSION_MINOR 10
|
#define IA_APIVERSION_MINOR 10
|
||||||
|
|
||||||
/* last compatible version */
|
/* last compatible version */
|
||||||
/* sometimes a new API version is just for a bugfix, or a added feature in */
|
/* sometimes a new API version is just for a bugfix, or a added feature in */
|
||||||
/* this case it is better to use a newer version even though a library was */
|
/* this case it is better to use a newer version even though a library was */
|
||||||
/* made for an older version, library API can then be upgraded to newer API */
|
/* made for an older version, library API can then be upgraded to newer API */
|
||||||
/* version after checking for compatibility or by adding features */
|
/* version after checking for compatibility or by adding features */
|
||||||
#define IA_LASTCOMP_APIVERSION_MAJOR 1
|
#define IA_LASTCOMP_APIVERSION_MAJOR 1
|
||||||
#define IA_LASTCOMP_APIVERSION_MINOR 10
|
#define IA_LASTCOMP_APIVERSION_MINOR 10
|
||||||
|
|
||||||
#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_MAKE_VERSION_STR(\
|
||||||
IA_APIVERSION_MAJOR, \
|
IA_APIVERSION_MAJOR, \
|
||||||
IA_APIVERSION_MINOR)
|
IA_APIVERSION_MINOR)
|
||||||
|
|
||||||
#define IA_LAST_COMP_APIVERSION IA_MAKE_VERSION_STR(\
|
#define IA_LAST_COMP_APIVERSION IA_MAKE_VERSION_STR(\
|
||||||
IA_LASTCOMP_APIVERSION_MAJOR, \
|
IA_LASTCOMP_APIVERSION_MAJOR, \
|
||||||
IA_LASTCOMP_APIVERSION_MINOR)
|
IA_LASTCOMP_APIVERSION_MINOR)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ typedef struct ia_drc_config_struct
|
||||||
WORD32 constant_delay_on;
|
WORD32 constant_delay_on;
|
||||||
WORD32 audio_delay_samples;
|
WORD32 audio_delay_samples;
|
||||||
|
|
||||||
|
WORD32 effect_type;
|
||||||
|
WORD32 target_loudness;
|
||||||
|
WORD32 loud_norm_flag;
|
||||||
|
|
||||||
}ia_drc_config_struct;
|
}ia_drc_config_struct;
|
||||||
|
|
||||||
/* DRC bitsteam handler */
|
/* DRC bitsteam handler */
|
||||||
|
|
@ -79,7 +83,7 @@ typedef struct bits_handler
|
||||||
WORD32 cpy_over_ic;
|
WORD32 cpy_over_ic;
|
||||||
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
|
||||||
|
|
@ -101,17 +105,17 @@ typedef 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;
|
||||||
UWORD32 total_num_out_samples;
|
UWORD32 total_num_out_samples;
|
||||||
UWORD32 frame_no;
|
UWORD32 frame_no;
|
||||||
UWORD32 out_size;
|
UWORD32 out_size;
|
||||||
UWORD32 ui_init_done;
|
UWORD32 ui_init_done;
|
||||||
UWORD32 ui_exe_done;
|
UWORD32 ui_exe_done;
|
||||||
UWORD32 ui_ir_used;
|
UWORD32 ui_ir_used;
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -120,10 +124,10 @@ 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;
|
||||||
ia_drc_bits_handler_struct str_bit_handler;
|
ia_drc_bits_handler_struct str_bit_handler;
|
||||||
ia_mem_info_struct *p_mem_info;
|
ia_mem_info_struct *p_mem_info;
|
||||||
pVOID *pp_mem;
|
pVOID *pp_mem;
|
||||||
struct ia_bit_buf_struct str_bit_buf, *pstr_bit_buf;
|
struct ia_bit_buf_struct str_bit_buf, *pstr_bit_buf;
|
||||||
|
|
||||||
} ia_drc_api_struct;
|
} ia_drc_api_struct;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,79 +32,79 @@
|
||||||
|
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
it_bit_buff->cnt_bits -= no_of_bits;
|
it_bit_buff->cnt_bits -= no_of_bits;
|
||||||
ret_val = (UWORD32)*ptr_read_next;
|
ret_val = (UWORD32)*ptr_read_next;
|
||||||
|
|
||||||
bit_pos -= no_of_bits;
|
bit_pos -= no_of_bits;
|
||||||
while (bit_pos < 0) {
|
while (bit_pos < 0) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret_val <<= 8;
|
ret_val <<= 8;
|
||||||
|
|
||||||
ret_val |= (UWORD32)*ptr_read_next;
|
ret_val |= (UWORD32)*ptr_read_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret_val = ret_val << ((31 - no_of_bits) - bit_pos) >> (32 - no_of_bits);
|
ret_val = ret_val << ((31 - no_of_bits) - bit_pos) >> (32 - no_of_bits);
|
||||||
it_bit_buff->ptr_read_next = ptr_read_next;
|
it_bit_buff->ptr_read_next = ptr_read_next;
|
||||||
it_bit_buff->bit_pos = (WORD16)bit_pos;
|
it_bit_buff->bit_pos = (WORD16)bit_pos;
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
it_bit_buff->ptr_read_next = ptr_bit_buf_base;
|
it_bit_buff->ptr_read_next = ptr_bit_buf_base;
|
||||||
it_bit_buff->bit_pos = 7;
|
it_bit_buff->bit_pos = 7;
|
||||||
|
|
||||||
it_bit_buff->cnt_bits = 0;
|
it_bit_buff->cnt_bits = 0;
|
||||||
it_bit_buff->size = bit_buf_size << 3;
|
it_bit_buff->size = bit_buf_size << 3;
|
||||||
|
|
||||||
return it_bit_buff;
|
return 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;
|
||||||
|
|
||||||
|
|
@ -129,25 +129,25 @@ WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lfe_channel_map_count >= 0)
|
if (lfe_channel_map_count >= 0)
|
||||||
{
|
{
|
||||||
if ((lfe_channel_map == NULL) || (lfe_channel_map_count > MAX_CHANNEL_COUNT))
|
if ((lfe_channel_map == NULL) || (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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -159,13 +159,13 @@ WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec(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,
|
UWORD8* bitstream_config,
|
||||||
WORD32 num_bytes,
|
WORD32 num_bytes,
|
||||||
WORD32 num_bits_offset,
|
WORD32 num_bits_offset,
|
||||||
WORD32* num_bits_read)
|
WORD32* num_bits_read)
|
||||||
{
|
{
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
|
|
@ -179,21 +179,21 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struc
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|
@ -206,7 +206,7 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struc
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,14 +218,14 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_drc_bs_dec_struc
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_config(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_config(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,
|
||||||
UWORD8* bitstream_config,
|
UWORD8* bitstream_config,
|
||||||
WORD32 num_bytes)
|
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);
|
||||||
|
|
@ -235,29 +235,29 @@ WORD32 impd_process_drc_bitstream_dec_config(ia_drc_bits_dec_struct* p_drc_bs_d
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_drc_bs_dec_struct,
|
WORD32 impd_process_drc_bitstream_dec_gain(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_gain_struct *pstr_drc_gain,
|
ia_drc_gain_struct *pstr_drc_gain,
|
||||||
UWORD8* bitstream_gain,
|
UWORD8* bitstream_gain,
|
||||||
WORD32 num_bytes,
|
WORD32 num_bytes,
|
||||||
WORD32 num_bits_offset,
|
WORD32 num_bits_offset,
|
||||||
WORD32* num_bits_read)
|
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,
|
it_bit_buff,
|
||||||
p_drc_bs_dec_struct,
|
p_drc_bs_dec_struct,
|
||||||
pstr_drc_config,
|
pstr_drc_config,
|
||||||
pstr_drc_gain);
|
pstr_drc_gain);
|
||||||
|
|
||||||
if (err_code > PROC_COMPLETE)
|
if (err_code > PROC_COMPLETE)
|
||||||
return (err_code);
|
return (err_code);
|
||||||
|
|
@ -274,17 +274,17 @@ WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_drc_bs_dec_
|
||||||
|
|
||||||
|
|
||||||
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* 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;
|
||||||
|
|
|
||||||
|
|
@ -23,31 +23,31 @@
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
UWORD8 *ptr_read_next;
|
UWORD8 *ptr_read_next;
|
||||||
|
|
||||||
WORD32 bit_pos;
|
WORD32 bit_pos;
|
||||||
WORD32 cnt_bits;
|
WORD32 cnt_bits;
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_stru
|
||||||
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_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_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,
|
UWORD8* bitstream_config,
|
||||||
|
|
@ -38,13 +38,13 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_s
|
||||||
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_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_config* pstr_drc_config,
|
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_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_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_gain_struct* pstr_drc_gain,
|
||||||
UWORD8* bitstream_gain,
|
UWORD8* bitstream_gain,
|
||||||
|
|
|
||||||
|
|
@ -22,21 +22,24 @@
|
||||||
#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
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_DEC_TYPE 0x0003
|
#define IA_DRC_DEC_CONFIG_PARAM_DEC_TYPE 0x0003
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_PEAK_LIMITER 0x0004
|
#define IA_DRC_DEC_CONFIG_PARAM_PEAK_LIMITER 0x0004
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_CTRL_PARAM 0x0005
|
#define IA_DRC_DEC_CONFIG_PARAM_CTRL_PARAM 0x0005
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_VER_MODE 0x0006
|
#define IA_DRC_DEC_CONFIG_PARAM_VER_MODE 0x0006
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT 0x0007
|
#define IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT 0x0007
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT 0x0008
|
#define IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT 0x0008
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_DELAY_MODE 0x0009
|
#define IA_DRC_DEC_CONFIG_PARAM_DELAY_MODE 0x0009
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_GAIN_DELAY 0x000A
|
#define IA_DRC_DEC_CONFIG_PARAM_GAIN_DELAY 0x000A
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_AUDIO_DELAY 0x000B
|
#define IA_DRC_DEC_CONFIG_PARAM_AUDIO_DELAY 0x000B
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE 0x000C
|
#define IA_DRC_DEC_CONFIG_PARAM_CON_DELAY_MODE 0x000C
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_ABSO_DELAY_OFF 0x000D
|
#define IA_DRC_DEC_CONFIG_PARAM_ABSO_DELAY_OFF 0x000D
|
||||||
#define IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE 0x000E
|
#define IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE 0x000E
|
||||||
#define IA_DRC_DEC_CONFIG_PROC_OUT_PTR 0x000F
|
#define IA_DRC_DEC_CONFIG_PROC_OUT_PTR 0x000F
|
||||||
#define IA_DRC_DEC_CONFIG_GAIN_STREAM_FLAG 0x0010
|
#define IA_DRC_DEC_CONFIG_GAIN_STREAM_FLAG 0x0010
|
||||||
|
#define IA_DRC_DEC_CONFIG_DRC_EFFECT_TYPE 0x0011
|
||||||
|
#define IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS 0x0012
|
||||||
|
#define IA_DRC_DEC_CONFIG_DRC_LOUD_NORM 0x0013
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -89,16 +89,16 @@ WORD32 impd_init_drc_params(WORD32 frame_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
||||||
case SUBBAND_DOMAIN_MODE_STFT256:
|
case SUBBAND_DOMAIN_MODE_STFT256:
|
||||||
ia_drc_params_struct->sub_band_domain_mode = sub_band_domain_mode;
|
ia_drc_params_struct->sub_band_domain_mode = sub_band_domain_mode;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ia_drc_params_struct->parametric_drc_delay = 0;
|
ia_drc_params_struct->parametric_drc_delay = 0;
|
||||||
|
|
@ -162,7 +162,7 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
{
|
{
|
||||||
WORD32 g, n, c, err = 0;
|
WORD32 g, n, c, err = 0;
|
||||||
WORD32 channel_count = 0;
|
WORD32 channel_count = 0;
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
||||||
ia_drc_instructions_struct* drc_instructions_uni_drc = NULL;
|
ia_drc_instructions_struct* drc_instructions_uni_drc = NULL;
|
||||||
ia_uni_drc_coeffs_struct* drc_coefficients_uni_drc = NULL;
|
ia_uni_drc_coeffs_struct* drc_coefficients_uni_drc = NULL;
|
||||||
|
|
@ -176,7 +176,7 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,19 +194,19 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|
@ -232,10 +232,10 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
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].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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -272,9 +272,9 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
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 {
|
||||||
|
|
@ -288,9 +288,9 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
if (parametric_drc_id == drc_config->str_drc_config_ext.str_parametric_drc_instructions[i].parametric_drc_id) break;
|
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->parametric_drc_instance_count] = i;
|
||||||
|
|
@ -317,20 +317,20 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
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 {
|
} else {
|
||||||
if (str_parametric_drc_instructions->parametric_drc_type == PARAM_DRC_TYPE_FF)
|
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);
|
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)
|
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);
|
parametric_drc_look_ahead_samples = (WORD32)(5.0f*(FLOAT32)p_parametric_drc_params->sampling_rate*0.001f);
|
||||||
} else
|
} 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] = 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[g])
|
if (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_max = 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;
|
||||||
|
|
@ -343,17 +343,17 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
{
|
{
|
||||||
ia_drc_params_struct->multiband_sel_drc_idx = ia_drc_params_struct->drc_set_counter;
|
ia_drc_params_struct->multiband_sel_drc_idx = 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)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -363,7 +363,7 @@ WORD32 impd_init_selected_drc_set(ia_drc_config* drc_config,
|
||||||
if (gain_modifiers[g].shape_filter_flag == 1)
|
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],
|
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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,34 +21,34 @@
|
||||||
#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 gain_delay_samples,
|
||||||
WORD32 delay_mode,
|
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(ia_drc_config* drc_config,
|
WORD32 impd_init_selected_drc_set(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,
|
WORD32 downmix_id_selected,
|
||||||
ia_filter_banks_struct* ia_filter_banks_struct,
|
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[],
|
FLOAT32* channel_audio[],
|
||||||
WORD32 impd_apply_gains);
|
WORD32 impd_apply_gains);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@
|
||||||
#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)
|
||||||
#define IA_DRC_OUTPUT_IDX (3)
|
#define IA_DRC_OUTPUT_IDX (3)
|
||||||
|
|
||||||
#define FRAME_SIZE 512
|
#define FRAME_SIZE 512
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -48,14 +48,14 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WORD32 impd_derive_subband_center_freq(WORD32 eq_subband_gain_count,
|
WORD32 impd_derive_subband_center_freq(WORD32 eq_subband_gain_count,
|
||||||
WORD32 eq_subband_gain_format,
|
WORD32 eq_subband_gain_format,
|
||||||
FLOAT32 sample_rate,
|
FLOAT32 sample_rate,
|
||||||
FLOAT32* subband_center_freq)
|
FLOAT32* subband_center_freq)
|
||||||
{
|
{
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 width, offset;
|
FLOAT32 width, offset;
|
||||||
switch (eq_subband_gain_format)
|
switch (eq_subband_gain_format)
|
||||||
{
|
{
|
||||||
case GAINFORMAT_QMF32:
|
case GAINFORMAT_QMF32:
|
||||||
case GAINFORMAT_QMF64:
|
case GAINFORMAT_QMF64:
|
||||||
case GAINFORMAT_QMF128:
|
case GAINFORMAT_QMF128:
|
||||||
|
|
@ -65,7 +65,7 @@ WORD32 impd_derive_subband_center_freq(WORD32 eq_subband_gain_count,
|
||||||
for (i=0; i<eq_subband_gain_count; i++)
|
for (i=0; i<eq_subband_gain_count; i++)
|
||||||
{
|
{
|
||||||
subband_center_freq[i] = offset;
|
subband_center_freq[i] = offset;
|
||||||
offset = offset + width;
|
offset = offset + width;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GAINFORMAT_QMFHYBRID39:
|
case GAINFORMAT_QMFHYBRID39:
|
||||||
|
|
@ -80,10 +80,10 @@ WORD32 impd_derive_subband_center_freq(WORD32 eq_subband_gain_count,
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_calc_fir_filt_response(WORD32 fir_order,
|
VOID impd_calc_fir_filt_response(WORD32 fir_order,
|
||||||
WORD32 fir_symmetry,
|
WORD32 fir_symmetry,
|
||||||
FLOAT32 *coeff,
|
FLOAT32 *coeff,
|
||||||
FLOAT32 frequency_radian,
|
FLOAT32 frequency_radian,
|
||||||
FLOAT32 *response)
|
FLOAT32 *response)
|
||||||
{
|
{
|
||||||
WORD32 m;
|
WORD32 m;
|
||||||
FLOAT32 sum = 0.0f;
|
FLOAT32 sum = 0.0f;
|
||||||
|
|
@ -94,8 +94,8 @@ VOID impd_calc_fir_filt_response(WORD32 fir_order,
|
||||||
o2 = fir_order/2;
|
o2 = fir_order/2;
|
||||||
if (fir_symmetry == 0)
|
if (fir_symmetry == 0)
|
||||||
{
|
{
|
||||||
/*ITTIAM: sum is been over written after the loop
|
/*ITTIAM: sum is been over written after the loop
|
||||||
None of the conformance streams with us entering this function*/
|
None of the conformance streams with us entering this function*/
|
||||||
for (m=1; m<=o2; m++)
|
for (m=1; m<=o2; m++)
|
||||||
{
|
{
|
||||||
sum += coeff[o2-m] *(FLOAT32)cos (m * frequency_radian);
|
sum += coeff[o2-m] *(FLOAT32)cos (m * frequency_radian);
|
||||||
|
|
@ -132,7 +132,7 @@ VOID impd_calc_fir_filt_response(WORD32 fir_order,
|
||||||
sum += sum;
|
sum += sum;
|
||||||
}
|
}
|
||||||
*response = sum;
|
*response = sum;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
||||||
|
|
@ -147,7 +147,7 @@ VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
||||||
{
|
{
|
||||||
for (i=0; i<element->bs_real_zero_radius_one_count; i++)
|
for (i=0; i<element->bs_real_zero_radius_one_count; i++)
|
||||||
{
|
{
|
||||||
part_response = 1.0f + 1.0f - 2.0f * 1.0f * (FLOAT32)cos(frequency_radian - (FLOAT32) element->zero_sign[i]);
|
part_response = 1.0f + 1.0f - 2.0f * 1.0f * (FLOAT32)cos(frequency_radian - (FLOAT32) element->zero_sign[i]);
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
}
|
}
|
||||||
for (i=0; i<element->real_zero_count; i++)
|
for (i=0; i<element->real_zero_count; i++)
|
||||||
|
|
@ -162,9 +162,9 @@ VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
||||||
radius = element->real_zero_radius[i];
|
radius = element->real_zero_radius[i];
|
||||||
angle_radian = 0.0f;
|
angle_radian = 0.0f;
|
||||||
}
|
}
|
||||||
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian);
|
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian);
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian);
|
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian);
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -173,9 +173,9 @@ VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
||||||
for (i=0; i<element->generic_zero_count; i++)
|
for (i=0; i<element->generic_zero_count; i++)
|
||||||
{
|
{
|
||||||
radius = element->generic_zero_radius[i];
|
radius = element->generic_zero_radius[i];
|
||||||
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - element->generic_zero_angle[i]);
|
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - element->generic_zero_angle[i]);
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - element->generic_zero_angle[i]);
|
part_response = 1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - element->generic_zero_angle[i]);
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
}
|
}
|
||||||
for (i=0; i<element->real_pole_count; i++)
|
for (i=0; i<element->real_pole_count; i++)
|
||||||
|
|
@ -190,12 +190,12 @@ VOID impd_calc_filt_ele_response(ia_unique_td_filt_element* element,
|
||||||
radius = element->real_pole_radius[i];
|
radius = element->real_pole_radius[i];
|
||||||
angle_radian = 0.0f;
|
angle_radian = 0.0f;
|
||||||
}
|
}
|
||||||
part_response = 1/(1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian));
|
part_response = 1/(1.0f + radius * radius - 2.0f * radius * (FLOAT32)cos(frequency_radian - angle_radian));
|
||||||
total_response *= part_response;
|
total_response *= part_response;
|
||||||
}
|
}
|
||||||
for (i=0; i<element->cmplx_pole_count; i++)
|
for (i=0; i<element->cmplx_pole_count; i++)
|
||||||
{
|
{
|
||||||
part_response = 1/(1.0f + element->real_pole_radius[i] * element->real_pole_radius[i] - 2.0f * element->real_pole_radius[i] * (FLOAT32)cos(frequency_radian - element->complex_pole_angle[i]));
|
part_response = 1/(1.0f + element->real_pole_radius[i] * element->real_pole_radius[i] - 2.0f * element->real_pole_radius[i] * (FLOAT32)cos(frequency_radian - element->complex_pole_angle[i]));
|
||||||
total_response *= part_response * part_response;
|
total_response *= part_response * part_response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +257,7 @@ WORD32 impd_calc_subband_gains_td_cascade(ia_unique_td_filt_element* unique_td_f
|
||||||
|
|
||||||
err = impd_derive_subband_center_freq(eq_subband_gain_count, eq_subband_gain_format, sample_rate, subband_center_freq);
|
err = impd_derive_subband_center_freq(eq_subband_gain_count, eq_subband_gain_format, sample_rate, subband_center_freq);
|
||||||
if (err)
|
if (err)
|
||||||
return(err);
|
return(err);
|
||||||
|
|
||||||
for (g=0; g<eq_ch_group_count; g++)
|
for (g=0; g<eq_ch_group_count; g++)
|
||||||
{
|
{
|
||||||
|
|
@ -281,7 +281,7 @@ WORD32 impd_calc_subband_gains_td_cascade(ia_unique_td_filt_element* unique_td_f
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_add_cascade(ia_cascade_align_group_struct* pstr_cascade_align_grp,
|
VOID impd_add_cascade(ia_cascade_align_group_struct* pstr_cascade_align_grp,
|
||||||
WORD32 c1,
|
WORD32 c1,
|
||||||
WORD32 c2,
|
WORD32 c2,
|
||||||
WORD32* done)
|
WORD32* done)
|
||||||
{
|
{
|
||||||
|
|
@ -377,7 +377,7 @@ VOID impd_calc_phase_filt_params(WORD32 config,
|
||||||
WORD32 section = ph_alignment_filt->section_count;
|
WORD32 section = ph_alignment_filt->section_count;
|
||||||
ia_filt_sect_struct* filt_section = &ph_alignment_filt->filt_section[section];
|
ia_filt_sect_struct* filt_section = &ph_alignment_filt->filt_section[section];
|
||||||
switch (config)
|
switch (config)
|
||||||
{
|
{
|
||||||
case CONFIG_REAL_POLE:
|
case CONFIG_REAL_POLE:
|
||||||
ph_alignment_filt->gain *= (-radius);
|
ph_alignment_filt->gain *= (-radius);
|
||||||
filt_section->a1 = - radius;
|
filt_section->a1 = - radius;
|
||||||
|
|
@ -417,7 +417,7 @@ VOID impd_calc_phase_filt_delay(ia_unique_td_filt_element* element,
|
||||||
{
|
{
|
||||||
WORD32 i, delay=0, channel;
|
WORD32 i, delay=0, channel;
|
||||||
if (element->eq_filter_format == FILTER_ELEMENT_FORMAT_POLE_ZERO)
|
if (element->eq_filter_format == FILTER_ELEMENT_FORMAT_POLE_ZERO)
|
||||||
{
|
{
|
||||||
if (element->bs_real_zero_radius_one_count == 0)
|
if (element->bs_real_zero_radius_one_count == 0)
|
||||||
{
|
{
|
||||||
delay = element->real_zero_count + 2 * element->generic_zero_count - element->real_pole_count - 2 * element->cmplx_pole_count;
|
delay = element->real_zero_count + 2 * element->generic_zero_count - element->real_pole_count - 2 * element->cmplx_pole_count;
|
||||||
|
|
@ -476,43 +476,43 @@ WORD32 impd_calc_filt_params(ia_unique_td_filt_element* element,
|
||||||
{
|
{
|
||||||
FLOAT32 zReal;
|
FLOAT32 zReal;
|
||||||
FLOAT32* coeff;
|
FLOAT32* coeff;
|
||||||
//WORD32 offset_idx = 0;
|
//WORD32 offset_idx = 0;
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
WORD32 param_idx = 0;
|
WORD32 param_idx = 0;
|
||||||
|
|
||||||
ia_2nd_order_filt_params_struct *pstr_2nd_oder_filt_params = &interm_filt_params->ord_2_filt_params_of_zeros[0];
|
ia_2nd_order_filt_params_struct *pstr_2nd_oder_filt_params = &interm_filt_params->ord_2_filt_params_of_zeros[0];
|
||||||
|
|
||||||
for (i=0; i<element->bs_real_zero_radius_one_count; i+=2)
|
for (i=0; i<element->bs_real_zero_radius_one_count; i+=2)
|
||||||
{
|
{
|
||||||
FLOAT32 radius = (FLOAT32)element->zero_sign[i + 0];
|
FLOAT32 radius = (FLOAT32)element->zero_sign[i + 0];
|
||||||
FLOAT32 angle = (FLOAT32)element->zero_sign[i + 1];
|
FLOAT32 angle = (FLOAT32)element->zero_sign[i + 1];
|
||||||
FLOAT32 angle1 = radius;
|
FLOAT32 angle1 = radius;
|
||||||
FLOAT32 angle2 = angle;
|
FLOAT32 angle2 = angle;
|
||||||
pstr_2nd_oder_filt_params->radius = 1.0f;
|
pstr_2nd_oder_filt_params->radius = 1.0f;
|
||||||
coeff = pstr_2nd_oder_filt_params->coeff;
|
coeff = pstr_2nd_oder_filt_params->coeff;
|
||||||
|
|
||||||
if (angle1 != angle2)
|
if (angle1 != angle2)
|
||||||
{
|
{
|
||||||
coeff[0] = 0.0f;
|
coeff[0] = 0.0f;
|
||||||
coeff[1] = -1.0f;
|
coeff[1] = -1.0f;
|
||||||
}
|
}
|
||||||
else if (angle1 == 1.0f)
|
else if (angle1 == 1.0f)
|
||||||
{
|
{
|
||||||
coeff[0] = -2.0f;
|
coeff[0] = -2.0f;
|
||||||
coeff[1] = 1.0f;
|
coeff[1] = 1.0f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
coeff[0] = 2.0f;
|
coeff[0] = 2.0f;
|
||||||
coeff[1] = 1.0f;
|
coeff[1] = 1.0f;
|
||||||
}
|
}
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
param_idx += 1;
|
param_idx += 1;
|
||||||
}
|
}
|
||||||
for (i=0; i<element->real_zero_count; i++)
|
for (i=0; i<element->real_zero_count; i++)
|
||||||
{
|
{
|
||||||
FLOAT32 radius = element->real_zero_radius[i];
|
FLOAT32 radius = element->real_zero_radius[i];
|
||||||
//FLOAT32 angle = 0.0f;
|
//FLOAT32 angle = 0.0f;
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
if (fabs(radius) == 1.0f)
|
if (fabs(radius) == 1.0f)
|
||||||
|
|
@ -526,20 +526,20 @@ WORD32 impd_calc_filt_params(ia_unique_td_filt_element* element,
|
||||||
coeff[1] = 1.0f;
|
coeff[1] = 1.0f;
|
||||||
}
|
}
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
param_idx += 1;
|
param_idx += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<element->generic_zero_count; i++)
|
for (i=0; i<element->generic_zero_count; i++)
|
||||||
{
|
{
|
||||||
FLOAT32 radius = element->generic_zero_radius[i];
|
FLOAT32 radius = element->generic_zero_radius[i];
|
||||||
FLOAT32 angle = element->generic_zero_angle[i];
|
FLOAT32 angle = element->generic_zero_angle[i];
|
||||||
zReal = radius * (FLOAT32)cos(M_PI * angle);
|
zReal = radius * (FLOAT32)cos(M_PI * angle);
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
coeff = pstr_2nd_oder_filt_params->coeff;
|
coeff = pstr_2nd_oder_filt_params->coeff;
|
||||||
coeff[0] = -2.0f * zReal;
|
coeff[0] = -2.0f * zReal;
|
||||||
coeff[1] = radius * radius;
|
coeff[1] = radius * radius;
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
|
|
||||||
zReal = (FLOAT32)cos(M_PI * angle) / radius;
|
zReal = (FLOAT32)cos(M_PI * angle) / radius;
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
|
|
@ -547,31 +547,31 @@ WORD32 impd_calc_filt_params(ia_unique_td_filt_element* element,
|
||||||
coeff[0] = -2.0f * zReal;
|
coeff[0] = -2.0f * zReal;
|
||||||
coeff[1] = 1.0f / (radius * radius);
|
coeff[1] = 1.0f / (radius * radius);
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
|
|
||||||
param_idx += 2;
|
param_idx += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
interm_filt_params->filter_param_count_of_zeros = param_idx;
|
interm_filt_params->filter_param_count_of_zeros = param_idx;
|
||||||
param_idx = 0;
|
param_idx = 0;
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params = &interm_filt_params->ord_2_filt_params_of_poles[0];
|
pstr_2nd_oder_filt_params = &interm_filt_params->ord_2_filt_params_of_poles[0];
|
||||||
|
|
||||||
for (i=0; i<element->real_pole_count; i++)
|
for (i=0; i<element->real_pole_count; i++)
|
||||||
{
|
{
|
||||||
FLOAT32 radius = element->real_pole_radius[i];
|
FLOAT32 radius = element->real_pole_radius[i];
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
coeff = pstr_2nd_oder_filt_params->coeff;
|
coeff = pstr_2nd_oder_filt_params->coeff;
|
||||||
coeff[0] = -2.0f * radius;
|
coeff[0] = -2.0f * radius;
|
||||||
coeff[1] = radius * radius;
|
coeff[1] = radius * radius;
|
||||||
param_idx += 1;
|
param_idx += 1;
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<element->cmplx_pole_count; i++)
|
for (i=0; i<element->cmplx_pole_count; i++)
|
||||||
{
|
{
|
||||||
FLOAT32 radius = element->complex_pole_radius[i];
|
FLOAT32 radius = element->complex_pole_radius[i];
|
||||||
FLOAT32 angle = element->complex_pole_angle[i];
|
FLOAT32 angle = element->complex_pole_angle[i];
|
||||||
|
|
||||||
zReal = radius * (FLOAT32)cos(M_PI * angle);
|
zReal = radius * (FLOAT32)cos(M_PI * angle);
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
|
|
@ -579,17 +579,17 @@ WORD32 impd_calc_filt_params(ia_unique_td_filt_element* element,
|
||||||
coeff[0] = -2.0f * zReal;
|
coeff[0] = -2.0f * zReal;
|
||||||
coeff[1] = radius * radius;
|
coeff[1] = radius * radius;
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params->radius = radius;
|
pstr_2nd_oder_filt_params->radius = radius;
|
||||||
pstr_2nd_oder_filt_params->coeff[0] = coeff[0];
|
pstr_2nd_oder_filt_params->coeff[0] = coeff[0];
|
||||||
pstr_2nd_oder_filt_params->coeff[1] = coeff[1];
|
pstr_2nd_oder_filt_params->coeff[1] = coeff[1];
|
||||||
|
|
||||||
pstr_2nd_oder_filt_params += 1;
|
pstr_2nd_oder_filt_params += 1;
|
||||||
param_idx += 2;
|
param_idx += 2;
|
||||||
}
|
}
|
||||||
interm_filt_params->filter_param_count_of_poles = param_idx;
|
interm_filt_params->filter_param_count_of_poles = param_idx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID impd_convert_fir_filt_params(WORD32 fir_filt_order,
|
VOID impd_convert_fir_filt_params(WORD32 fir_filt_order,
|
||||||
|
|
@ -605,25 +605,25 @@ VOID impd_convert_fir_filt_params(WORD32 fir_filt_order,
|
||||||
coeff[i] = fir_coeff[i];
|
coeff[i] = fir_coeff[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fir_symmetry==1)
|
if (fir_symmetry==1)
|
||||||
{
|
{
|
||||||
for (i=0; i<(fir_filt_order+1)/2; i++)
|
for (i=0; i<(fir_filt_order+1)/2; i++)
|
||||||
{
|
{
|
||||||
coeff[fir_filt_order-i] = - coeff[i];
|
coeff[fir_filt_order-i] = - coeff[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if((fir_filt_order & 1) == 0)
|
if((fir_filt_order & 1) == 0)
|
||||||
{
|
{
|
||||||
coeff[fir_filt_order/2] = 0.0f;
|
coeff[fir_filt_order/2] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=0; i<(fir_filt_order+1)/2; i++)
|
for (i=0; i<(fir_filt_order+1)/2; i++)
|
||||||
{
|
{
|
||||||
coeff[fir_filt_order-i] = coeff[i];
|
coeff[fir_filt_order-i] = coeff[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (channel=0; channel<EQ_CHANNEL_COUNT_MAX; channel++)
|
for (channel=0; channel<EQ_CHANNEL_COUNT_MAX; channel++)
|
||||||
{
|
{
|
||||||
|
|
@ -642,10 +642,10 @@ WORD32 impd_calc_filt_params_all(ia_unique_td_filt_element* element,
|
||||||
interm_filt_params->filter_format = element->eq_filter_format;
|
interm_filt_params->filter_format = element->eq_filter_format;
|
||||||
if (element->eq_filter_format == FILTER_ELEMENT_FORMAT_POLE_ZERO)
|
if (element->eq_filter_format == FILTER_ELEMENT_FORMAT_POLE_ZERO)
|
||||||
{
|
{
|
||||||
err = impd_calc_filt_params(element,
|
err = impd_calc_filt_params(element,
|
||||||
interm_filt_params);
|
interm_filt_params);
|
||||||
if(err)
|
if(err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -719,7 +719,7 @@ VOID impd_calc_eq_filt_elements(ia_interm_filt_params_struct* interm_filt_params
|
||||||
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] != 0.0f)
|
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] != 0.0f)
|
||||||
{
|
{
|
||||||
if (diff_radius > fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius))
|
if (diff_radius > fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius))
|
||||||
{
|
{
|
||||||
diff_radius = (FLOAT32)fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius);
|
diff_radius = (FLOAT32)fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius);
|
||||||
zeros_idx = i;
|
zeros_idx = i;
|
||||||
}
|
}
|
||||||
|
|
@ -730,7 +730,7 @@ VOID impd_calc_eq_filt_elements(ia_interm_filt_params_struct* interm_filt_params
|
||||||
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] == 0.0f)
|
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] == 0.0f)
|
||||||
{
|
{
|
||||||
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
||||||
{
|
{
|
||||||
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
||||||
zeros_idx = i;
|
zeros_idx = i;
|
||||||
}
|
}
|
||||||
|
|
@ -751,7 +751,7 @@ VOID impd_calc_eq_filt_elements(ia_interm_filt_params_struct* interm_filt_params
|
||||||
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] == 0.0f)
|
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] == 0.0f)
|
||||||
{
|
{
|
||||||
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
||||||
{
|
{
|
||||||
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
||||||
zeros_idx = i;
|
zeros_idx = i;
|
||||||
}
|
}
|
||||||
|
|
@ -762,7 +762,7 @@ VOID impd_calc_eq_filt_elements(ia_interm_filt_params_struct* interm_filt_params
|
||||||
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] != 0.0f)
|
if (interm_filt_params->ord_2_filt_params_of_zeros[i].coeff[1] != 0.0f)
|
||||||
{
|
{
|
||||||
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
if (diff_radius > (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius)))
|
||||||
{
|
{
|
||||||
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
diff_radius = (FLOAT32)(fabs(fabs(interm_filt_params->ord_2_filt_params_of_zeros[i].radius) - max_radius));
|
||||||
zeros_idx = i;
|
zeros_idx = i;
|
||||||
}
|
}
|
||||||
|
|
@ -876,7 +876,7 @@ WORD32 impd_calc_filt_block(ia_unique_td_filt_element* unique_td_filt_ele,
|
||||||
err = impd_calc_filt_params_all(&(unique_td_filt_ele[filterIndex]),
|
err = impd_calc_filt_params_all(&(unique_td_filt_ele[filterIndex]),
|
||||||
&interm_filt_params);
|
&interm_filt_params);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
impd_calc_eq_filt_elements(&interm_filt_params, eq_filt_element);
|
impd_calc_eq_filt_elements(&interm_filt_params, eq_filt_element);
|
||||||
|
|
||||||
|
|
@ -907,7 +907,7 @@ WORD32 impd_calc_filt_block(ia_unique_td_filt_element* unique_td_filt_ele,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impd_calc_phase_filt(&(unique_td_filt_ele[filterIndex]),
|
impd_calc_phase_filt(&(unique_td_filt_ele[filterIndex]),
|
||||||
i,
|
i,
|
||||||
&matching_ph_filt[i]);
|
&matching_ph_filt[i]);
|
||||||
}
|
}
|
||||||
pstr_eq_filt_block->element_count = str_filter_block->filter_element_count;
|
pstr_eq_filt_block->element_count = str_filter_block->filter_element_count;
|
||||||
|
|
@ -949,7 +949,7 @@ WORD32 impd_calc_filt_cascade(ia_unique_td_filt_element* unique_td_filt_ele,
|
||||||
&(str_filter_block[str_td_filter_cascade->str_filter_block_refs[g].filter_block_index[i]]),
|
&(str_filter_block[str_td_filter_cascade->str_filter_block_refs[g].filter_block_index[i]]),
|
||||||
&(filt_cascade_td[g].pstr_eq_filt_block[i]));
|
&(filt_cascade_td[g].pstr_eq_filt_block[i]));
|
||||||
if (err)
|
if (err)
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
filt_cascade_td[g].block_count = i;
|
filt_cascade_td[g].block_count = i;
|
||||||
filt_cascade_td[g].cascade_gain_linear = (FLOAT32)(pow(10.0f, 0.05f * str_td_filter_cascade->eq_cascade_gain[g]));
|
filt_cascade_td[g].cascade_gain_linear = (FLOAT32)(pow(10.0f, 0.05f * str_td_filter_cascade->eq_cascade_gain[g]));
|
||||||
|
|
@ -977,8 +977,8 @@ VOID impd_calc_subband_eq(ia_eq_subband_gain_vector* str_eq_subband_gain_vector,
|
||||||
|
|
||||||
FLOAT32 impd_decode_eq_node_freq(WORD32 eq_node_freq_idx)
|
FLOAT32 impd_decode_eq_node_freq(WORD32 eq_node_freq_idx)
|
||||||
{
|
{
|
||||||
/*((FLOAT32)((log10(STEP_RATIO_F_HI) / log10(STEP_RATIO_F_LO) - 1.0f) / (STEP_RATIO_EQ_NODE_COUNT_MAX - 1.0f)))*/
|
/*((FLOAT32)((log10(STEP_RATIO_F_HI) / log10(STEP_RATIO_F_LO) - 1.0f) / (STEP_RATIO_EQ_NODE_COUNT_MAX - 1.0f)))*/
|
||||||
FLOAT32 step_ratio = 0.0739601809794f;
|
FLOAT32 step_ratio = 0.0739601809794f;
|
||||||
return((FLOAT32)(pow(STEP_RATIO_F_LO, 1.0f + eq_node_freq_idx * step_ratio)));
|
return((FLOAT32)(pow(STEP_RATIO_F_LO, 1.0f + eq_node_freq_idx * step_ratio)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -987,7 +987,7 @@ FLOAT32 impd_calc_warp_freq_delta(FLOAT32 fsubband,
|
||||||
WORD32 eq_node_freq_idx)
|
WORD32 eq_node_freq_idx)
|
||||||
{
|
{
|
||||||
/*((FLOAT32)((log10(STEP_RATIO_F_HI) / log10(STEP_RATIO_F_LO) - 1.0f) / (STEP_RATIO_EQ_NODE_COUNT_MAX - 1.0f)))*/
|
/*((FLOAT32)((log10(STEP_RATIO_F_HI) / log10(STEP_RATIO_F_LO) - 1.0f) / (STEP_RATIO_EQ_NODE_COUNT_MAX - 1.0f)))*/
|
||||||
FLOAT32 step_ratio = 0.0739601809794f;
|
FLOAT32 step_ratio = 0.0739601809794f;
|
||||||
return((FLOAT32)((log10(fsubband)/log10(node_freq) - 1.0f) / step_ratio - (FLOAT32) eq_node_freq_idx));
|
return((FLOAT32)((log10(fsubband)/log10(node_freq) - 1.0f) / step_ratio - (FLOAT32) eq_node_freq_idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1000,10 +1000,10 @@ VOID impd_interpolate_eq_gain(WORD32 band_step,
|
||||||
FLOAT32* interpolated_gain)
|
FLOAT32* interpolated_gain)
|
||||||
{
|
{
|
||||||
FLOAT32 k1, k2, a, b, c, d;
|
FLOAT32 k1, k2, a, b, c, d;
|
||||||
FLOAT32 inv_band_step =(FLOAT32)( 1.0 / (FLOAT32)band_step);
|
FLOAT32 inv_band_step =(FLOAT32)( 1.0 / (FLOAT32)band_step);
|
||||||
FLOAT32 inv_band_step_sqr = inv_band_step * inv_band_step; k1 = (right_gain - left_gain) * inv_band_step_sqr;
|
FLOAT32 inv_band_step_sqr = inv_band_step * inv_band_step; k1 = (right_gain - left_gain) * inv_band_step_sqr;
|
||||||
left_slope = (FLOAT32) (left_slope / 3.128f);
|
left_slope = (FLOAT32) (left_slope / 3.128f);
|
||||||
right_slope = (FLOAT32) (right_slope / 3.128f);
|
right_slope = (FLOAT32) (right_slope / 3.128f);
|
||||||
|
|
||||||
k2 = right_slope + left_slope;
|
k2 = right_slope + left_slope;
|
||||||
a = inv_band_step * (inv_band_step * k2 - 2.0f * k1); b = 3.0f * k1 - inv_band_step * (k2 + left_slope);
|
a = inv_band_step * (inv_band_step * k2 - 2.0f * k1); b = 3.0f * k1 - inv_band_step * (k2 + left_slope);
|
||||||
|
|
@ -1053,17 +1053,17 @@ WORD32 impd_interpolate_subband_spline(ia_eq_subband_gain_spline_struct* str_eq_
|
||||||
|
|
||||||
err = impd_derive_subband_center_freq(eq_subband_gain_count, eq_subband_gain_format, sample_rate, subband_center_freq);
|
err = impd_derive_subband_center_freq(eq_subband_gain_count, eq_subband_gain_format, sample_rate, subband_center_freq);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
for (n=0; n<num_eq_nodes-1; n++)
|
for (n=0; n<num_eq_nodes-1; n++)
|
||||||
{
|
{
|
||||||
for (b=0; b<eq_subband_gain_count; b++)
|
for (b=0; b<eq_subband_gain_count; b++)
|
||||||
{
|
{
|
||||||
FLOAT32 fSub;
|
FLOAT32 fSub;
|
||||||
fSub = max(subband_center_freq[b], eq_node_freq[0]);
|
fSub = max(subband_center_freq[b], eq_node_freq[0]);
|
||||||
fSub = min(fSub, eq_node_freq[num_eq_nodes-1]);
|
fSub = min(fSub, eq_node_freq[num_eq_nodes-1]);
|
||||||
if ((fSub >= eq_node_freq[n]) && (fSub <= eq_node_freq[n+1]))
|
if ((fSub >= eq_node_freq[n]) && (fSub <= eq_node_freq[n+1]))
|
||||||
{
|
{
|
||||||
FLOAT32 warpedDeltaFreq = impd_calc_warp_freq_delta (fSub, eq_node_freq[0], eq_node_freq_idx[n]);
|
FLOAT32 warpedDeltaFreq = impd_calc_warp_freq_delta (fSub, eq_node_freq[0], eq_node_freq_idx[n]);
|
||||||
FLOAT32 gEqSubbandDb;
|
FLOAT32 gEqSubbandDb;
|
||||||
impd_interpolate_eq_gain(eq_freq_delta[n+1], eq_gain[n], eq_gain[n+1],
|
impd_interpolate_eq_gain(eq_freq_delta[n+1], eq_gain[n], eq_gain[n+1],
|
||||||
|
|
@ -1099,7 +1099,7 @@ WORD32 impd_calc_subband_gains(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
sample_rate,
|
sample_rate,
|
||||||
&(subband_filt[g]));
|
&(subband_filt[g]));
|
||||||
if (err)
|
if (err)
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1223,7 +1223,7 @@ WORD32 impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
str_eq_instructions->eq_ch_group_count,
|
str_eq_instructions->eq_ch_group_count,
|
||||||
eq_set->filt_cascade_td);
|
eq_set->filt_cascade_td);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
eq_set->domain |= EQ_FILTER_DOMAIN_TIME;
|
eq_set->domain |= EQ_FILTER_DOMAIN_TIME;
|
||||||
|
|
@ -1231,7 +1231,7 @@ WORD32 impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
if (sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF)
|
if (sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF)
|
||||||
{
|
{
|
||||||
switch (sub_band_domain_mode)
|
switch (sub_band_domain_mode)
|
||||||
{
|
{
|
||||||
case SUBBAND_DOMAIN_MODE_QMF64:
|
case SUBBAND_DOMAIN_MODE_QMF64:
|
||||||
if (str_eq_coeff->eq_subband_gain_count != AUDIO_CODEC_SUBBAND_COUNT_QMF64)
|
if (str_eq_coeff->eq_subband_gain_count != AUDIO_CODEC_SUBBAND_COUNT_QMF64)
|
||||||
{
|
{
|
||||||
|
|
@ -1266,7 +1266,7 @@ WORD32 impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
eq_frame_size_subband,
|
eq_frame_size_subband,
|
||||||
eq_set->subband_filt);
|
eq_set->subband_filt);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1281,7 +1281,7 @@ WORD32 impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
eq_frame_size_subband,
|
eq_frame_size_subband,
|
||||||
eq_set->subband_filt);
|
eq_set->subband_filt);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1301,24 +1301,24 @@ WORD32 impd_derive_eq_set(ia_eq_coeff_struct* str_eq_coeff,
|
||||||
VOID impd_process_filt_sect(ia_filt_sect_struct filt_section[EQ_FILTER_SECTION_COUNT_MAX],
|
VOID impd_process_filt_sect(ia_filt_sect_struct filt_section[EQ_FILTER_SECTION_COUNT_MAX],
|
||||||
WORD32 channel,
|
WORD32 channel,
|
||||||
FLOAT32* audio_out,
|
FLOAT32* audio_out,
|
||||||
WORD32 section_count)
|
WORD32 section_count)
|
||||||
{
|
{
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
|
|
||||||
for(i = 0; i < section_count; i++)
|
for(i = 0; i < section_count; i++)
|
||||||
{
|
{
|
||||||
ia_filt_sect_state_struct* filt_sect_state = &filt_section[i].filt_sect_state[channel];
|
ia_filt_sect_state_struct* filt_sect_state = &filt_section[i].filt_sect_state[channel];
|
||||||
FLOAT32 audio_in = *audio_out;
|
FLOAT32 audio_in = *audio_out;
|
||||||
*audio_out = audio_in + filt_section[i].b1 * filt_sect_state->in_state_1
|
*audio_out = audio_in + filt_section[i].b1 * filt_sect_state->in_state_1
|
||||||
+ filt_section[i].b2 * filt_sect_state->in_state_2
|
+ filt_section[i].b2 * filt_sect_state->in_state_2
|
||||||
- filt_section[i].a1 * filt_sect_state->out_state_1
|
- filt_section[i].a1 * filt_sect_state->out_state_1
|
||||||
- filt_section[i].a2 * filt_sect_state->out_state_2;
|
- filt_section[i].a2 * filt_sect_state->out_state_2;
|
||||||
|
|
||||||
filt_sect_state->in_state_2 = filt_sect_state->in_state_1;
|
filt_sect_state->in_state_2 = filt_sect_state->in_state_1;
|
||||||
filt_sect_state->in_state_1 = audio_in;
|
filt_sect_state->in_state_1 = audio_in;
|
||||||
filt_sect_state->out_state_2 = filt_sect_state->out_state_1;
|
filt_sect_state->out_state_2 = filt_sect_state->out_state_1;
|
||||||
filt_sect_state->out_state_1 = *audio_out;
|
filt_sect_state->out_state_1 = *audio_out;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1403,16 +1403,16 @@ VOID impd_subband_filter_process(ia_subband_filt_struct* pstr_subband_filt,
|
||||||
|
|
||||||
FLOAT32* ptr_subband_coeff = pstr_subband_filt->subband_coeff;
|
FLOAT32* ptr_subband_coeff = pstr_subband_filt->subband_coeff;
|
||||||
|
|
||||||
for (i=0; i < eq_frame_size_subband; i++)
|
for (i=0; i < eq_frame_size_subband; i++)
|
||||||
{
|
{
|
||||||
for (j=0; j < coeff_count; j++)
|
for (j=0; j < coeff_count; j++)
|
||||||
{
|
{
|
||||||
ptr_audio_real_buff[j] *= ptr_subband_coeff[j];
|
ptr_audio_real_buff[j] *= ptr_subband_coeff[j];
|
||||||
ptr_audio_imag_buff[j] *= ptr_subband_coeff[j];
|
ptr_audio_imag_buff[j] *= ptr_subband_coeff[j];
|
||||||
}
|
}
|
||||||
ptr_audio_real_buff += coeff_count;
|
ptr_audio_real_buff += coeff_count;
|
||||||
ptr_audio_imag_buff += coeff_count;
|
ptr_audio_imag_buff += coeff_count;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1422,12 +1422,12 @@ VOID impd_phase_align_filt_process(ia_ph_alignment_filt_struct* ph_alignment_fil
|
||||||
WORD32 channel,
|
WORD32 channel,
|
||||||
FLOAT32* ptr_audio_out)
|
FLOAT32* ptr_audio_out)
|
||||||
{
|
{
|
||||||
FLOAT32 audio_in = *ptr_audio_out;
|
FLOAT32 audio_in = *ptr_audio_out;
|
||||||
FLOAT32 inp = audio_in;
|
FLOAT32 inp = audio_in;
|
||||||
FLOAT32 out = inp;
|
FLOAT32 out = inp;
|
||||||
|
|
||||||
impd_process_filt_sect(ph_alignment_filt->filt_section, channel, &out, ph_alignment_filt->section_count);
|
impd_process_filt_sect(ph_alignment_filt->filt_section, channel, &out, ph_alignment_filt->section_count);
|
||||||
inp = out;
|
inp = out;
|
||||||
|
|
||||||
impd_audio_delay_process(&ph_alignment_filt->audio_delay, channel, inp, &out);
|
impd_audio_delay_process(&ph_alignment_filt->audio_delay, channel, inp, &out);
|
||||||
|
|
||||||
|
|
@ -1440,44 +1440,44 @@ VOID impd_eq_filt_element_process(ia_eq_filt_block_struct str_eq_filt_block[EQ_F
|
||||||
WORD32 channel,
|
WORD32 channel,
|
||||||
FLOAT32 audio_in,
|
FLOAT32 audio_in,
|
||||||
FLOAT32* ptr_audio_out,
|
FLOAT32* ptr_audio_out,
|
||||||
WORD32 block_count)
|
WORD32 block_count)
|
||||||
{
|
{
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
FLOAT32 inp = audio_in;
|
FLOAT32 inp = audio_in;
|
||||||
FLOAT32 out = inp;
|
FLOAT32 out = inp;
|
||||||
WORD32 k,j;
|
WORD32 k,j;
|
||||||
WORD32 element_count;
|
WORD32 element_count;
|
||||||
for(j = 0; j < block_count; j++)
|
for(j = 0; j < block_count; j++)
|
||||||
{
|
{
|
||||||
FLOAT32 sum = 0.0f;
|
FLOAT32 sum = 0.0f;
|
||||||
element_count = str_eq_filt_block[j].element_count;
|
element_count = str_eq_filt_block[j].element_count;
|
||||||
for (k=0; k < element_count; k++)
|
for (k=0; k < element_count; k++)
|
||||||
{
|
{
|
||||||
switch (str_eq_filt_block[j].eq_filt_element[k].format)
|
switch (str_eq_filt_block[j].eq_filt_element[k].format)
|
||||||
{
|
{
|
||||||
case FILTER_ELEMENT_FORMAT_POLE_ZERO:
|
case FILTER_ELEMENT_FORMAT_POLE_ZERO:
|
||||||
impd_pole_zero_filt_process(&str_eq_filt_block[j].eq_filt_element[k].pstr_pole_zero_filt, channel, inp, &out);
|
impd_pole_zero_filt_process(&str_eq_filt_block[j].eq_filt_element[k].pstr_pole_zero_filt, channel, inp, &out);
|
||||||
break;
|
break;
|
||||||
case FILTER_ELEMENT_FORMAT_FIR:
|
case FILTER_ELEMENT_FORMAT_FIR:
|
||||||
impd_fir_filt_process(&str_eq_filt_block[j].eq_filt_element[k].fir_filter, channel, inp, &out);
|
impd_fir_filt_process(&str_eq_filt_block[j].eq_filt_element[k].fir_filter, channel, inp, &out);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out *= str_eq_filt_block[j].eq_filt_element[k].elementGainLinear;
|
out *= str_eq_filt_block[j].eq_filt_element[k].elementGainLinear;
|
||||||
|
|
||||||
for (i=0; i < str_eq_filt_block[j].eq_filt_element[k].num_ph_align_filt; i++)
|
for (i=0; i < str_eq_filt_block[j].eq_filt_element[k].num_ph_align_filt; i++)
|
||||||
{
|
{
|
||||||
inp = out;
|
inp = out;
|
||||||
impd_phase_align_filt_process(&str_eq_filt_block[j].eq_filt_element[k].ph_alignment_filt[i],
|
impd_phase_align_filt_process(&str_eq_filt_block[j].eq_filt_element[k].ph_alignment_filt[i],
|
||||||
channel,
|
channel,
|
||||||
&out);
|
&out);
|
||||||
}
|
}
|
||||||
sum += out;
|
sum += out;
|
||||||
}
|
}
|
||||||
inp = sum;
|
inp = sum;
|
||||||
}
|
}
|
||||||
*ptr_audio_out = inp;
|
*ptr_audio_out = inp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1490,33 +1490,33 @@ WORD32 impd_process_eq_set_time_domain(ia_eq_set_struct* pstr_eq_set,
|
||||||
{
|
{
|
||||||
WORD32 g=pstr_eq_set->eq_ch_group_of_channel[channel],i,j;
|
WORD32 g=pstr_eq_set->eq_ch_group_of_channel[channel],i,j;
|
||||||
//FLOAT32 sum = 0.0f;
|
//FLOAT32 sum = 0.0f;
|
||||||
//FLOAT32 temp1 = 0.0f;
|
//FLOAT32 temp1 = 0.0f;
|
||||||
|
|
||||||
if(pstr_eq_set==NULL || g<0)
|
if(pstr_eq_set==NULL || g<0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pstr_eq_set->domain | EQ_FILTER_DOMAIN_TIME)
|
if (pstr_eq_set->domain | EQ_FILTER_DOMAIN_TIME)
|
||||||
{
|
{
|
||||||
for(i=0;i<frame_size;i++)
|
for(i=0;i<frame_size;i++)
|
||||||
{
|
{
|
||||||
impd_eq_filt_element_process((pstr_eq_set->filt_cascade_td[g].pstr_eq_filt_block),
|
impd_eq_filt_element_process((pstr_eq_set->filt_cascade_td[g].pstr_eq_filt_block),
|
||||||
channel,
|
channel,
|
||||||
ptr_audio_in[i],
|
ptr_audio_in[i],
|
||||||
&ptr_audio_out[i],
|
&ptr_audio_out[i],
|
||||||
pstr_eq_set->filt_cascade_td[g].block_count);
|
pstr_eq_set->filt_cascade_td[g].block_count);
|
||||||
|
|
||||||
for (j=0; j<pstr_eq_set->filt_cascade_td[g].num_ph_align_filt; j++)
|
for (j=0; j<pstr_eq_set->filt_cascade_td[g].num_ph_align_filt; j++)
|
||||||
{
|
{
|
||||||
impd_phase_align_filt_process(&pstr_eq_set->filt_cascade_td[g].ph_alignment_filt[j],
|
impd_phase_align_filt_process(&pstr_eq_set->filt_cascade_td[g].ph_alignment_filt[j],
|
||||||
channel,
|
channel,
|
||||||
&ptr_audio_out[i]);
|
&ptr_audio_out[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_audio_out[i] = ptr_audio_out[i] * pstr_eq_set->filt_cascade_td[g].cascade_gain_linear;
|
ptr_audio_out[i] = ptr_audio_out[i] * pstr_eq_set->filt_cascade_td[g].cascade_gain_linear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1535,14 +1535,14 @@ WORD32 impd_process_eq_set_subband_domain(ia_eq_set_struct* pstr_eq_set,
|
||||||
if (g >= 0)
|
if (g >= 0)
|
||||||
{
|
{
|
||||||
if (pstr_eq_set->domain == 0)
|
if (pstr_eq_set->domain == 0)
|
||||||
{
|
{
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
impd_subband_filter_process(&pstr_eq_set->subband_filt[g],
|
impd_subband_filter_process(&pstr_eq_set->subband_filt[g],
|
||||||
&ptr_audio_real_buff[0],
|
&ptr_audio_real_buff[0],
|
||||||
&ptr_audio_imag_buff[0]);
|
&ptr_audio_imag_buff[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,17 +164,17 @@ typedef 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,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_eq_set_struct* eq_set);
|
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_in,
|
||||||
FLOAT32* audio_out);
|
FLOAT32* audio_out);
|
||||||
|
|
||||||
|
|
@ -185,9 +185,9 @@ WORD32 impd_process_eq_set_time_domain(ia_eq_set_struct* eq_set,
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -26,31 +26,31 @@
|
||||||
#define IA_NO_ERROR 0x00000000
|
#define IA_NO_ERROR 0x00000000
|
||||||
|
|
||||||
/*API Non-Fatal Errors */
|
/*API Non-Fatal Errors */
|
||||||
#define IA_DRC_DEC_API_NONFATAL_NO_ERROR 0x00000000
|
#define IA_DRC_DEC_API_NONFATAL_NO_ERROR 0x00000000
|
||||||
#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
|
||||||
#define IA_DRC_DEC_API_FATAL_MEM_ALLOC 0xFFFF8002
|
#define IA_DRC_DEC_API_FATAL_MEM_ALLOC 0xFFFF8002
|
||||||
#define IA_DRC_DEC_API_FATAL_INVALID_CONFIG_PARAM 0xFFFF8003
|
#define IA_DRC_DEC_API_FATAL_INVALID_CONFIG_PARAM 0xFFFF8003
|
||||||
#define IA_DRC_DEC_API_FATAL_INVALID_EXECUTE_TYPE 0xFFFF8004
|
#define IA_DRC_DEC_API_FATAL_INVALID_EXECUTE_TYPE 0xFFFF8004
|
||||||
#define IA_DRC_DEC_API_FATAL_INVALID_CMD 0xFFFF8005
|
#define IA_DRC_DEC_API_FATAL_INVALID_CMD 0xFFFF8005
|
||||||
#define IA_DRC_DEC_API_FATAL_MEM_ALIGN 0xFFFF8006
|
#define IA_DRC_DEC_API_FATAL_MEM_ALIGN 0xFFFF8006
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* 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
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PCM_SIZE 0x00000802
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PCM_SIZE 0x00000802
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_FRAME_SIZE 0x00000803
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_FRAME_SIZE 0x00000803
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000804
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000804
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000805
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000805
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000806
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000806
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000807
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000807
|
||||||
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000808
|
#define IA_DRC_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000808
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coeff
|
||||||
|
|
||||||
|
|
||||||
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* input,
|
||||||
FLOAT32* output)
|
FLOAT32* output)
|
||||||
|
|
@ -400,7 +400,7 @@ VOID impd_three_band_filter_process(ia_three_band_filt_struct* str_three_band_ba
|
||||||
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,
|
c,
|
||||||
size,
|
size,
|
||||||
output1[1],
|
output1[1],
|
||||||
output[2]);
|
output[2]);
|
||||||
|
|
@ -447,7 +447,7 @@ VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
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,
|
cha_idx,
|
||||||
win_size,
|
win_size,
|
||||||
output1[0],
|
output1[0],
|
||||||
output1[0]);
|
output1[0]);
|
||||||
|
|
@ -456,7 +456,7 @@ VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
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,
|
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
||||||
cha_idx,
|
cha_idx,
|
||||||
win_size,
|
win_size,
|
||||||
output1[1],
|
output1[1],
|
||||||
output2[0]);
|
output2[0]);
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ WORD32 impd_init_all_filter_banks( ia_uni_drc_coeffs_struct* str_p_loc_drc_coeff
|
||||||
|
|
||||||
|
|
||||||
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* input,
|
||||||
FLOAT32* output)
|
FLOAT32* output)
|
||||||
|
|
@ -400,7 +400,7 @@ VOID impd_three_band_filter_process(ia_three_band_filt_struct* str_three_band_ba
|
||||||
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,
|
c,
|
||||||
size,
|
size,
|
||||||
output1[1],
|
output1[1],
|
||||||
output[2]);
|
output[2]);
|
||||||
|
|
@ -447,7 +447,7 @@ VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
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,
|
cha_idx,
|
||||||
win_size,
|
win_size,
|
||||||
output1[0],
|
output1[0],
|
||||||
output1[0]);
|
output1[0]);
|
||||||
|
|
@ -456,7 +456,7 @@ VOID impd_four_band_filter_process(ia_four_band_filt_struct* str_four_band_bank,
|
||||||
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,
|
impd_iir_second_order_filter_all_pass(all_pass_filter,
|
||||||
cha_idx,
|
cha_idx,
|
||||||
win_size,
|
win_size,
|
||||||
output1[1],
|
output1[1],
|
||||||
output2[0]);
|
output2[0]);
|
||||||
|
|
|
||||||
|
|
@ -120,31 +120,31 @@ typedef 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,
|
WORD32 size,
|
||||||
FLOAT32* audio_in,
|
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(ia_three_band_filt_struct* str_three_band_bank,
|
||||||
WORD32 c,
|
WORD32 c,
|
||||||
WORD32 size,
|
WORD32 size,
|
||||||
FLOAT32* audio_in,
|
FLOAT32* audio_in,
|
||||||
FLOAT32* audio_out[]);
|
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,
|
WORD32 size,
|
||||||
FLOAT32* audio_in,
|
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(ia_all_pass_cascade_struct *str_all_pass_cascade,
|
||||||
WORD32 c,
|
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,
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ impd_compressor_io_sigmoid(ia_split_drc_characteristic_struct* split_drc_charact
|
||||||
if (exp < 1000.0f) {
|
if (exp < 1000.0f) {
|
||||||
FLOAT32 x = tmp/gainDbLimit;
|
FLOAT32 x = tmp/gainDbLimit;
|
||||||
if (x < 0.0f)
|
if (x < 0.0f)
|
||||||
{
|
{
|
||||||
return(UNEXPECTED_ERROR);
|
return(UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
*out_db_gain = (FLOAT32)(tmp / pow(1.0f + pow(x, exp), 1.0f/exp));
|
*out_db_gain = (FLOAT32)(tmp / pow(1.0f + pow(x, exp), 1.0f/exp));
|
||||||
|
|
@ -142,7 +142,7 @@ impd_compressor_io_sigmoid_inv(ia_split_drc_characteristic_struct* split_drc_cha
|
||||||
if (exp < 1000.0f) {
|
if (exp < 1000.0f) {
|
||||||
FLOAT32 x = tmp/gainDbLimit;
|
FLOAT32 x = tmp/gainDbLimit;
|
||||||
if (x < 0.0f)
|
if (x < 0.0f)
|
||||||
{
|
{
|
||||||
return(UNEXPECTED_ERROR);
|
return(UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
tmp = (FLOAT32)(tmp / pow(1.0f - pow(x, exp), 1.0f / exp));
|
tmp = (FLOAT32)(tmp / pow(1.0f - pow(x, exp), 1.0f / exp));
|
||||||
|
|
@ -163,7 +163,7 @@ impd_compressor_io_nodes_lt(ia_split_drc_characteristic_struct* split_drc_charac
|
||||||
FLOAT32* node_gain = split_drc_characteristic->node_gain;
|
FLOAT32* node_gain = split_drc_characteristic->node_gain;
|
||||||
|
|
||||||
if (in_db_level > DRC_INPUT_LOUDNESS_TARGET)
|
if (in_db_level > DRC_INPUT_LOUDNESS_TARGET)
|
||||||
{
|
{
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
for (n=1; n<=split_drc_characteristic->characteristic_node_count; n++) {
|
for (n=1; n<=split_drc_characteristic->characteristic_node_count; n++) {
|
||||||
|
|
@ -187,7 +187,7 @@ impd_compressor_io_nodes_rt(ia_split_drc_characteristic_struct* split_drc_charac
|
||||||
FLOAT32* node_gain = split_drc_characteristic->node_gain;
|
FLOAT32* node_gain = split_drc_characteristic->node_gain;
|
||||||
|
|
||||||
if (in_db_level < DRC_INPUT_LOUDNESS_TARGET)
|
if (in_db_level < DRC_INPUT_LOUDNESS_TARGET)
|
||||||
{
|
{
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
for (n=1; n<=split_drc_characteristic->characteristic_node_count; n++) {
|
for (n=1; n<=split_drc_characteristic->characteristic_node_count; n++) {
|
||||||
|
|
|
||||||
|
|
@ -79,12 +79,12 @@ IA_ERRORCODE impd_init_drc_decode_post_config(WORD32 audio_num
|
||||||
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 = &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;
|
ia_audio_in_out_buf* p_audio_in_out_buf = &p_drc_gain_dec_structs->audio_in_out_buf;
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ IA_ERRORCODE impd_init_drc_decode_post_config(WORD32 audio_num
|
||||||
if (drc_instruction_str->gain_element_count > 0)
|
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;
|
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);
|
*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;
|
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++)
|
for (i=0; i<p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i].buf_interpolation_count; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ WORD32 impd_init_drc_decode_post_config( WORD32 audio_num_chan,
|
||||||
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_gain_dec_struct* p_drc_gain_dec_structs,
|
||||||
ia_drc_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ extern "C" {
|
||||||
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(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
||||||
|
|
||||||
WORD32 impd_set_custom_params(const WORD32 param_set_idx,
|
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_eval_custom_params_selection_process(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,18 +47,21 @@
|
||||||
#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 iIdx, pVOID pvValue);
|
WORD32 iCmd, 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,
|
UWORD8* it_bit_buf,
|
||||||
WORD32 num_bit_stream_bits,
|
WORD32 num_bit_stream_bits,
|
||||||
WORD32* num_bits_read);
|
WORD32* num_bits_read);
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_drc_dec_interface_add_effect_type(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
|
||||||
|
|
@ -111,6 +114,9 @@ IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc)
|
||||||
p_obj_drc->str_config.subband_domain_io_flag = 0;
|
p_obj_drc->str_config.subband_domain_io_flag = 0;
|
||||||
p_obj_drc->str_config.constant_delay_on = 0;
|
p_obj_drc->str_config.constant_delay_on = 0;
|
||||||
p_obj_drc->str_config.audio_delay_samples = 0;
|
p_obj_drc->str_config.audio_delay_samples = 0;
|
||||||
|
p_obj_drc->str_config.effect_type = 0;
|
||||||
|
p_obj_drc->str_config.target_loudness = -24;
|
||||||
|
p_obj_drc->str_config.loud_norm_flag = 0;
|
||||||
p_obj_drc->str_bit_handler.byte_index_bs = 0;
|
p_obj_drc->str_bit_handler.byte_index_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs = 0;
|
p_obj_drc->str_bit_handler.num_bytes_bs = 0;
|
||||||
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
p_obj_drc->str_bit_handler.num_bits_offset_bs = 0;
|
||||||
|
|
@ -123,7 +129,7 @@ IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc)
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface = 0;
|
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface = 0;
|
||||||
p_obj_drc->str_bit_handler.num_bits_read_bs_unidrc_interface = 0;
|
p_obj_drc->str_bit_handler.num_bits_read_bs_unidrc_interface = 0;
|
||||||
p_obj_drc->str_bit_handler.cpy_over_in = 0;
|
p_obj_drc->str_bit_handler.cpy_over_in = 0;
|
||||||
p_obj_drc->str_bit_handler.gain_stream_flag = 0;
|
p_obj_drc->str_bit_handler.gain_stream_flag = 0;
|
||||||
|
|
||||||
return IA_NO_ERROR;
|
return IA_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
@ -131,118 +137,118 @@ IA_ERRORCODE impd_drc_set_default_config(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
IA_ERRORCODE impd_drc_set_default_bitstream_config(ia_drc_config *pstr_drc_config)
|
IA_ERRORCODE impd_drc_set_default_bitstream_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_count;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].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_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=4;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].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[0]=0;
|
||||||
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].gain_set_params_index_for_gain_sequence[1]=1;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[2]=2;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_params_index_for_gain_sequence[2]=2;
|
||||||
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].gain_set_params_index_for_gain_sequence[3]=3;
|
||||||
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count_plus=4;
|
pstr_drc_config->str_p_loc_drc_coefficients_uni_drc[0].gain_set_count_plus=4;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_id=1;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_id=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_complexity_level=2;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_complexity_level=2;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_location=1;
|
pstr_drc_config->str_drc_instruction_str[0].drc_location=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].dwnmix_id_count=1;
|
pstr_drc_config->str_drc_instruction_str[0].dwnmix_id_count=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].drc_set_effect=1;
|
pstr_drc_config->str_drc_instruction_str[0].drc_set_effect=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].gain_set_index[1]=1;
|
pstr_drc_config->str_drc_instruction_str[0].gain_set_index[1]=1;
|
||||||
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_target_loudness_value_lower=-63;
|
||||||
pstr_drc_config->str_drc_instruction_str[0].num_drc_ch_groups=2;
|
pstr_drc_config->str_drc_instruction_str[0].num_drc_ch_groups=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].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[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].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[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].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[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].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].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[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].drc_set_target_loudness_value_lower=-63;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].num_drc_ch_groups=2;
|
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[0]=1;
|
pstr_drc_config->str_drc_instruction_str[1].gain_set_index_for_channel_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_set_index_for_channel_group[1]=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].band_count_of_ch_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[1].band_count_of_ch_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].band_count_of_ch_group[1]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_interpolation_type_for_channel_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[1].gain_interpolation_type_for_channel_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[1].gain_interpolation_type_for_channel_group[1]=1;
|
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[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].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].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[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].drc_set_target_loudness_value_lower=-63;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].num_drc_ch_groups=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[0]=2;
|
pstr_drc_config->str_drc_instruction_str[2].gain_set_index_for_channel_group[0]=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].gain_set_index_for_channel_group[1]=3;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[2].band_count_of_ch_group[1]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_interpolation_type_for_channel_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[2].gain_interpolation_type_for_channel_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[2].gain_interpolation_type_for_channel_group[1]=1;
|
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[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].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].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[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].drc_set_target_loudness_value_lower=-63;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].num_drc_ch_groups=2;
|
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[0]=3;
|
pstr_drc_config->str_drc_instruction_str[3].gain_set_index_for_channel_group[0]=3;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_set_index_for_channel_group[1]=0;
|
pstr_drc_config->str_drc_instruction_str[3].gain_set_index_for_channel_group[1]=0;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[1]=1;
|
pstr_drc_config->str_drc_instruction_str[3].band_count_of_ch_group[1]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_interpolation_type_for_channel_group[0]=1;
|
pstr_drc_config->str_drc_instruction_str[3].gain_interpolation_type_for_channel_group[0]=1;
|
||||||
pstr_drc_config->str_drc_instruction_str[3].gain_interpolation_type_for_channel_group[1]=1;
|
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[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].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].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[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;
|
||||||
}
|
}
|
||||||
|
|
@ -297,13 +303,13 @@ IA_ERRORCODE impd_drc_set_struct_pointer(ia_drc_api_struct *p_obj_drc)
|
||||||
p_obj_drc->str_payload.pstr_peak_limiter = (ia_drc_peak_limiter_struct*)persistant_ptr;
|
p_obj_drc->str_payload.pstr_peak_limiter = (ia_drc_peak_limiter_struct*)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_peak_limiter_struct)+32;
|
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 = (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;
|
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 = (ia_drc_qmf_filt_struct*)persistant_ptr;
|
||||||
persistant_ptr = (SIZE_T)persistant_ptr + sizeof(ia_drc_qmf_filt_struct)+32;
|
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;
|
||||||
|
|
@ -327,9 +333,9 @@ VOID init_qmf_filt_bank(ia_drc_qmf_filt_struct *qmf_filt)
|
||||||
qmf_filt->syn_tab_real[l][k] = gain_syn * cos((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->syn_tab_imag[l][k] = gain_syn * sin((0.0245436926) * (k+0.5) * (2*l-255.0));
|
qmf_filt->syn_tab_imag[l][k] = gain_syn * sin((0.0245436926) * (k+0.5) * (2*l-255.0));
|
||||||
qmf_filt->ana_tab_real[k][l] = 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] = gain_ana * sin((0.0245436926) * (k+0.5) * (2*l-1.0));
|
qmf_filt->ana_tab_imag[k][l] = gain_ana * sin((0.0245436926) * (k+0.5) * (2*l-1.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,9 +347,9 @@ 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 };
|
||||||
|
|
||||||
|
|
@ -352,8 +358,8 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
p_obj_drc->str_payload.pstr_selection_proc->first_frame=1;
|
p_obj_drc->str_payload.pstr_selection_proc->first_frame=1;
|
||||||
|
|
||||||
|
|
||||||
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);
|
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,
|
err_code = impd_init_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
||||||
|
|
@ -365,7 +371,7 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i=0; i<NUM_GAIN_DEC_INSTANCES; i++) {
|
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,
|
||||||
|
|
@ -373,25 +379,26 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
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_process(
|
|
||||||
p_obj_drc->pstr_bit_buf,
|
|
||||||
p_obj_drc->str_payload.pstr_drc_interface,
|
|
||||||
p_obj_drc->str_bit_handler.bitstream_unidrc_interface,
|
|
||||||
p_obj_drc->str_bit_handler.num_bytes_bs_unidrc_interface*8,
|
|
||||||
&p_obj_drc->str_bit_handler.num_bits_read_bs_unidrc_interface);
|
|
||||||
|
|
||||||
if (err_code!=IA_NO_ERROR)
|
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.target_loudness,
|
||||||
|
p_obj_drc->str_config.loud_norm_flag);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (err_code!=IA_NO_ERROR)
|
||||||
return err_code;
|
return err_code;
|
||||||
|
|
||||||
err_code = impd_drc_uni_selction_proc_init(p_obj_drc->str_payload.pstr_selection_proc,
|
err_code = impd_drc_uni_selction_proc_init(p_obj_drc->str_payload.pstr_selection_proc,
|
||||||
0,
|
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) {
|
||||||
|
|
@ -401,16 +408,16 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
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)
|
if (err_code!=IA_NO_ERROR)
|
||||||
return err_code;
|
return err_code;
|
||||||
err_code = impd_set_custom_params(p_obj_drc->str_config.control_parameter_index,p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
err_code = impd_set_custom_params(p_obj_drc->str_config.control_parameter_index,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(p_obj_drc->str_payload.pstr_drc_sel_proc_params);
|
err_code = impd_eval_custom_params_selection_process(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(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);
|
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);
|
||||||
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_params->peak_limiter) {
|
if (p_obj_drc->str_payload.pstr_drc_sel_proc_params->peak_limiter) {
|
||||||
|
|
@ -418,40 +425,42 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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->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_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)
|
if(err_code==1)
|
||||||
{
|
{
|
||||||
err_code=impd_drc_set_default_bitstream_config(p_obj_drc->str_payload.pstr_drc_config);
|
err_code=impd_drc_set_default_bitstream_config(p_obj_drc->str_payload.pstr_drc_config);
|
||||||
}
|
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)
|
if (err_code!=IA_NO_ERROR)
|
||||||
return err_code;
|
return err_code;
|
||||||
err_code = impd_process_drc_bitstream_dec_loudness_info_set(p_obj_drc->pstr_bit_buf,
|
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_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)
|
if (err_code!=IA_NO_ERROR)
|
||||||
return err_code;
|
return err_code;
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
err_code = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
err_code = impd_process_drc_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],
|
||||||
|
|
@ -473,7 +482,7 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
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++){
|
||||||
|
|
@ -510,7 +519,7 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
, p_obj_drc->str_payload.pstr_gain_dec[i]
|
, p_obj_drc->str_payload.pstr_gain_dec[i]
|
||||||
, 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
|
||||||
, &persistant_ptr
|
, &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_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);
|
||||||
|
|
@ -546,7 +555,7 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
@ -554,15 +563,15 @@ IA_ERRORCODE impd_drc_init(ia_drc_api_struct *p_obj_drc){
|
||||||
if (p_obj_drc->str_config.peak_limiter)
|
if (p_obj_drc->str_config.peak_limiter)
|
||||||
{
|
{
|
||||||
impd_peak_limiter_init(p_obj_drc->str_payload.pstr_peak_limiter,
|
impd_peak_limiter_init(p_obj_drc->str_payload.pstr_peak_limiter,
|
||||||
DEFAULT_ATTACK_TIME_MS,
|
DEFAULT_ATTACK_TIME_MS,
|
||||||
DEFAULT_RELEASE_TIME_MS,
|
DEFAULT_RELEASE_TIME_MS,
|
||||||
LIM_DEFAULT_THRESHOLD,
|
LIM_DEFAULT_THRESHOLD,
|
||||||
p_obj_drc->str_config.num_ch_out,
|
p_obj_drc->str_config.num_ch_out,
|
||||||
p_obj_drc->str_config.sampling_rate,
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
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,
|
||||||
|
|
@ -40,7 +40,7 @@ impd_drc_dec_interface_process(
|
||||||
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;
|
||||||
|
|
@ -55,3 +55,114 @@ impd_drc_dec_interface_process(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
impd_drc_dec_interface_add_effect_type(ia_drc_interface_struct* pstr_drc_interface,
|
||||||
|
WORD32 drc_effect_type,
|
||||||
|
WORD32 target_loudness,
|
||||||
|
WORD32 loud_norm)
|
||||||
|
{
|
||||||
|
WORD32 err = 0;
|
||||||
|
WORD32 i = 0;
|
||||||
|
|
||||||
|
if (pstr_drc_interface != NULL)
|
||||||
|
{
|
||||||
|
pstr_drc_interface->interface_signat_flag = 0;
|
||||||
|
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_len = 0;
|
||||||
|
|
||||||
|
pstr_drc_interface->system_interface_flag = 1;
|
||||||
|
|
||||||
|
pstr_drc_interface->system_interface.target_config_request_type = 0;
|
||||||
|
pstr_drc_interface->system_interface.num_downmix_id_requests = 0;
|
||||||
|
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_target_layout = 0;
|
||||||
|
pstr_drc_interface->system_interface.requested_target_ch_count = 0;
|
||||||
|
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface_flag= 1;
|
||||||
|
if(loud_norm==1)
|
||||||
|
{
|
||||||
|
pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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_param_interface.album_mode = 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.loudness_deviation_max = 63;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_method = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_method = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_system = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_system = 1;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_pre_proc = 0;
|
||||||
|
pstr_drc_interface->loudness_norm_param_interface.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;
|
||||||
|
if(drc_effect_type==-1)
|
||||||
|
{
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on=0;
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] = 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.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.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[2] = 2;
|
||||||
|
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.requested_dyn_rng_measurement_type[0] = 0;
|
||||||
|
pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[0] = 0;
|
||||||
|
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_parameter_interface_flag = 1;
|
||||||
|
pstr_drc_interface->drc_parameter_interface.change_compress = 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.boost = 1.0f;
|
||||||
|
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_uni_interface_ext_flag = 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return UNEXPECTED_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,20 +32,20 @@ WORD32 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 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 = drc_uni_interface_signature->interface_signat_data_len + 1;
|
||||||
for (i=0; i<interface_signat_data_len; i++) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,17 +55,17 @@ 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 = 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;
|
||||||
|
|
||||||
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 = 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;
|
||||||
|
|
||||||
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;
|
||||||
|
|
@ -73,20 +73,20 @@ WORD32 impd_sys_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
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] = 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;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
system_interface->requested_target_layout = impd_read_bits_buf(it_bit_buff, 8);
|
system_interface->requested_target_layout = 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;
|
||||||
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:
|
||||||
|
|
@ -100,16 +100,16 @@ WORD32 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 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 = 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_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);
|
||||||
|
|
@ -119,66 +119,66 @@ WORD32 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 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 = 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->change_loudness_measur_method = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_measur_method = 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_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 = 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->change_loudness_measur_system = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_norm_param_interface->change_loudness_measur_system = 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_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 = 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = 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_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 = 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = 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_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 = max(min(tmp*10,500),20);
|
loudness_norm_param_interface->device_cut_off_frequency = 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 = 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_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 {
|
||||||
|
|
@ -186,23 +186,23 @@ WORD32 impd_loudness_norm_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = 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_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 = -16+tmp*0.03125f;
|
loudness_norm_param_interface->loudness_norm_gain_modification_db = -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 = 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_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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,50 +213,50 @@ WORD32 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 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 = 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_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 = 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;
|
||||||
|
|
||||||
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] = 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;
|
||||||
|
|
||||||
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] = 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;
|
||||||
}
|
}
|
||||||
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] = (tmp>>1)&3;
|
||||||
drc_ctrl_interface->requested_dyn_range_is_single_val_flag[i] = tmp&1;
|
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)
|
||||||
|
|
@ -266,9 +266,9 @@ WORD32 impd_drc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
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)
|
||||||
|
|
@ -277,9 +277,9 @@ WORD32 impd_drc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
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)
|
||||||
|
|
@ -291,9 +291,9 @@ WORD32 impd_drc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
}
|
}
|
||||||
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] = 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;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(1);
|
return(1);
|
||||||
|
|
@ -308,19 +308,19 @@ WORD32 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 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 {
|
||||||
|
|
@ -329,9 +329,9 @@ 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 {
|
||||||
|
|
@ -339,14 +339,14 @@ WORD32 impd_drc_param_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drc_parameter_interface->change_drc_characteristic_target = impd_read_bits_buf(it_bit_buff, 1);
|
drc_parameter_interface->change_drc_characteristic_target = 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_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 = 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;
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
@ -357,30 +357,30 @@ static WORD32 impd_parse_loud_eq_param_interface(ia_bit_buf_struct* it_bit_buff,
|
||||||
//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 = 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_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 = 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;
|
||||||
}
|
}
|
||||||
loudness_eq_parameter_interface->sensitivity_flag = impd_read_bits_buf(it_bit_buff, 1);
|
loudness_eq_parameter_interface->sensitivity_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 (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 = 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_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);
|
||||||
|
|
@ -395,57 +395,57 @@ impd_unidrc_interface_extension_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
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 = &(drc_uni_interface_ext->specific_interface_ext[i]);
|
||||||
specific_interface_ext->uni_drc_interface_ext_type = uni_drc_interface_ext_type;
|
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 = impd_read_bits_buf(it_bit_buff, specific_interface_ext->ext_size_bits);
|
||||||
if(it_bit_buff->error)
|
if(it_bit_buff->error)
|
||||||
return 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.loudness_eq_parameter_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 (impd_drc_uni_interface->drc_uni_interface_ext.loudness_eq_parameter_interface_flag) {
|
if (impd_drc_uni_interface->drc_uni_interface_ext.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));
|
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);
|
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 = 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 (impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface_flag) {
|
if (impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface_flag) {
|
||||||
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface.eq_set_purpose_request = impd_read_bits_buf(it_bit_buff, 16);
|
impd_drc_uni_interface->drc_uni_interface_ext.eq_ctrl_interface.eq_set_purpose_request = 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;
|
||||||
}
|
}
|
||||||
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, specific_interface_ext->ext_bit_size);
|
||||||
if(it_bit_buff->error)
|
if(it_bit_buff->error)
|
||||||
return 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);
|
||||||
|
|
@ -455,57 +455,57 @@ WORD32 impd_unidrc_interface_read(ia_bit_buf_struct* it_bit_buff,
|
||||||
{
|
{
|
||||||
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(it_bit_buff, &(uniDrcInterface->drc_uni_interface_signature));
|
||||||
if (err) return(err);
|
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, &(uniDrcInterface->system_interface));
|
||||||
if (err) return(err);
|
if (err) return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->loudness_norm_ctrl_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->loudness_norm_ctrl_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->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(it_bit_buff, &(uniDrcInterface->loudness_norm_ctrl_interface));
|
||||||
if (err) return(err);
|
if (err) return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->loudness_norm_parameter_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->loudness_norm_parameter_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->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(it_bit_buff, &(uniDrcInterface->loudness_norm_param_interface));
|
||||||
if (err) return(err);
|
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, &(uniDrcInterface->drc_ctrl_interface));
|
||||||
if (err) return(err);
|
if (err) return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->drc_parameter_interface_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->drc_parameter_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_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(it_bit_buff, &(uniDrcInterface->drc_parameter_interface));
|
||||||
if (err) return(err);
|
if (err) return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniDrcInterface->drc_uni_interface_ext_flag = impd_read_bits_buf(it_bit_buff, 1);
|
uniDrcInterface->drc_uni_interface_ext_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_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(it_bit_buff, uniDrcInterface, &(uniDrcInterface->drc_uni_interface_ext));
|
||||||
if (err) return(err);
|
if (err) return(err);
|
||||||
|
|
|
||||||
|
|
@ -36,22 +36,22 @@
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_parametric_drc_instance_reset(WORD32 instance_idx,
|
WORD32 impd_parametric_drc_instance_reset(WORD32 instance_idx,
|
||||||
ia_parametric_drc_instance_params_struct* pstr_parametric_drc_instance_params)
|
ia_parametric_drc_instance_params_struct* 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);
|
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);
|
err = impd_parametric_ffwd_type_drc_reset(pstr_parametric_ffwd_type_drc_params);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -540,7 +540,7 @@ WORD32 impd_check_loud_info(WORD32 loudness_info_count,
|
||||||
{
|
{
|
||||||
err = impd_overall_loudness_present(&(loudness_info[n]), &loudness_info_present);
|
err = impd_overall_loudness_present(&(loudness_info[n]), &loudness_info_present);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
if (loudness_info_present)
|
if (loudness_info_present)
|
||||||
{
|
{
|
||||||
loudness_info_matching[*info_count] = &(loudness_info[n]);
|
loudness_info_matching[*info_count] = &(loudness_info[n]);
|
||||||
|
|
@ -548,9 +548,9 @@ WORD32 impd_check_loud_info(WORD32 loudness_info_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_check_loud_payload(WORD32 loudness_info_count,
|
WORD32 impd_check_loud_payload(WORD32 loudness_info_count,
|
||||||
|
|
@ -563,7 +563,7 @@ WORD32 impd_check_loud_payload(WORD32 loudness_info_count,
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
|
|
||||||
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, drc_set_id_requested, info_count, loudness_info_matching);
|
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, drc_set_id_requested, info_count, loudness_info_matching);
|
||||||
if (err || *info_count) goto matchEnd;
|
if (err || *info_count) goto matchEnd;
|
||||||
err = impd_check_loud_info(loudness_info_count, loudness_info, ID_FOR_ANY_DOWNMIX, drc_set_id_requested, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
err = impd_check_loud_info(loudness_info_count, loudness_info, ID_FOR_ANY_DOWNMIX, drc_set_id_requested, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
||||||
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, ID_FOR_ANY_DRC, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, ID_FOR_ANY_DRC, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
||||||
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, ID_FOR_NO_DRC, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
err = impd_check_loud_info(loudness_info_count, loudness_info, requested_dwnmix_id, ID_FOR_NO_DRC, info_count, loudness_info_matching); if (err || *info_count) goto matchEnd;
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,10 @@ static WORD32 impd_down_mix ( ia_drc_sel_proc_output_struct *uni_drc_sel_proc_ou
|
||||||
|
|
||||||
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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -90,22 +90,22 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
last_frame=1;
|
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_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
audio_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
||||||
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);
|
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++){
|
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_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];
|
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];
|
||||||
|
|
@ -113,7 +113,7 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
|
|
||||||
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->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],
|
||||||
|
|
@ -128,10 +128,10 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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.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.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
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -146,10 +146,10 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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 = 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
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,18 +201,18 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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] = 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];
|
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->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);
|
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 != BITSTREAM_FILE_FORMAT_SPLIT) {
|
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,
|
error = impd_process_drc_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],
|
||||||
|
|
@ -230,7 +230,7 @@ WORD32 impd_init_process_audio_main_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
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];
|
||||||
|
|
@ -97,14 +97,14 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
last_frame=1;
|
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_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
audio_io_buf_real[i]=scratch_buffer+i*(p_obj_drc->str_config.frame_size+32);
|
||||||
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);
|
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++){
|
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_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];
|
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];
|
||||||
|
|
@ -112,7 +112,7 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
|
|
||||||
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->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],
|
||||||
|
|
@ -127,10 +127,10 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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.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.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
|
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) {
|
||||||
|
|
@ -140,10 +140,10 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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 = 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
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -196,18 +196,18 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
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] = 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];
|
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->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);
|
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 != BITSTREAM_FILE_FORMAT_SPLIT) {
|
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,
|
error = impd_process_drc_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],
|
||||||
|
|
@ -225,7 +225,7 @@ WORD32 impd_init_process_audio_main_stft (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,21 +56,21 @@ static IA_ERRORCODE impd_down_mix ( ia_drc_sel_proc_output_struct *uni_drc_sel_p
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -88,8 +88,8 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
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];
|
||||||
|
|
@ -98,11 +98,11 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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->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],
|
||||||
|
|
@ -116,55 +116,57 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
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_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.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.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
|
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) {
|
||||||
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 + 8
|
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_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_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 = p_obj_drc->str_bit_handler.byte_index_bs + 1;
|
||||||
if(p_obj_drc->str_bit_handler.gain_stream_flag==0)
|
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));
|
||||||
|
|
||||||
if(num_sample_to_process<p_obj_drc->str_config.frame_size)
|
p_obj_drc->str_config.frame_size = num_sample_to_process;
|
||||||
|
|
||||||
|
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])/32767.0f;
|
audio_buff[i][j]=((FLOAT32)input_buffer16[j*p_obj_drc->str_config.num_ch_in + i])/32767.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
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]=input_buffer[j*p_obj_drc->str_config.num_ch_in + i];
|
audio_buff[i][j]=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],
|
||||||
|
|
@ -217,7 +219,7 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err_code=impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
|
err_code=impd_limiter_process(p_obj_drc->str_payload.pstr_peak_limiter,
|
||||||
output_buffer,
|
output_buffer,
|
||||||
p_obj_drc->str_config.frame_size);
|
p_obj_drc->str_config.frame_size);
|
||||||
|
|
||||||
|
|
@ -232,12 +234,12 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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++)
|
for (j=0; j < p_obj_drc->str_config.frame_size; j++)
|
||||||
{
|
{
|
||||||
if(audio_buff[i][j]<-1.0f)
|
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;
|
||||||
|
|
||||||
|
|
@ -246,15 +248,15 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
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_buff[i][j];
|
output_buffer[j*p_obj_drc->str_config.num_ch_out + i] = audio_buff[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -265,22 +267,22 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
if(p_obj_drc->p_state->delay_in_output!=0){
|
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);
|
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(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);
|
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,(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);
|
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->delay_adjust_samples = p_obj_drc->p_state->delay_in_output;
|
p_obj_drc->p_state->delay_adjust_samples = p_obj_drc->p_state->delay_in_output;
|
||||||
p_obj_drc->p_state->delay_in_output=0;
|
p_obj_drc->p_state->delay_in_output=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(last_frame==1)
|
if(last_frame==1)
|
||||||
{
|
{
|
||||||
if((num_sample_to_process+p_obj_drc->p_state->delay_adjust_samples)<=p_obj_drc->str_config.frame_size)
|
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);
|
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
|
||||||
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);
|
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){
|
||||||
|
|
||||||
|
|
@ -288,7 +290,7 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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(p_obj_drc->str_payload.pstr_bitstream_dec,
|
err_code = impd_process_drc_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],
|
||||||
|
|
@ -305,7 +307,7 @@ IA_ERRORCODE impd_process_time_domain(ia_drc_api_struct *p_obj_drc)
|
||||||
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err_code;
|
return err_code;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
|
|
||||||
VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
||||||
FLOAT64 *buff,
|
FLOAT64 *buff,
|
||||||
FLOAT32 *input_real,
|
FLOAT32 *input_real,
|
||||||
FLOAT32 *input_imag,
|
FLOAT32 *input_imag,
|
||||||
FLOAT32 *output)
|
FLOAT32 *output)
|
||||||
|
|
@ -79,7 +79,7 @@ VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
||||||
|
|
||||||
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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ VOID process_qmf_syn_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
||||||
|
|
||||||
|
|
||||||
VOID process_qmf_ana_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
VOID process_qmf_ana_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
||||||
FLOAT64 *buff,
|
FLOAT64 *buff,
|
||||||
FLOAT32 *input,
|
FLOAT32 *input,
|
||||||
FLOAT32 *output_real,
|
FLOAT32 *output_real,
|
||||||
FLOAT32 *output_imag)
|
FLOAT32 *output_imag)
|
||||||
|
|
@ -115,7 +115,7 @@ VOID process_qmf_ana_filt_bank(ia_drc_qmf_filt_struct *qmf_filt,
|
||||||
|
|
||||||
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]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,8 +186,8 @@ 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];
|
||||||
|
|
@ -198,18 +198,18 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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/(p_obj_drc->str_config.pcm_size>>3)) < (UWORD32)p_obj_drc->str_config.frame_size)
|
||||||
last_frame=1;
|
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]=scratch_buffer+(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);
|
audio_io_buf_real[i]=scratch_buffer+(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);
|
||||||
audio_io_buf_imag[i]=scratch_buffer+2*(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);;
|
audio_io_buf_imag[i]=scratch_buffer+2*(p_obj_drc->str_config.frame_size*p_obj_drc->str_config.num_ch_in+512);;
|
||||||
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){
|
||||||
audio_in_out_buf[i][j]=((FLOAT32)input_buffer16[j*p_obj_drc->str_config.num_ch_in + i])/32767.0f;
|
audio_in_out_buf[i][j]=((FLOAT32)input_buffer16[j*p_obj_drc->str_config.num_ch_in + i])/32767.0f;
|
||||||
|
|
@ -222,7 +222,7 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
|
|
||||||
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->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],
|
||||||
|
|
@ -237,10 +237,10 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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.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.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
|
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)
|
||||||
|
|
@ -249,18 +249,18 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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_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 = 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
|
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(p_obj_drc->str_payload.pstr_qmf_filter,
|
process_qmf_ana_filt_bank(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+i*4*p_obj_drc->str_config.frame_size,
|
||||||
&(audio_in_out_buf[i][j]),
|
&(audio_in_out_buf[i][j]),
|
||||||
&(audio_io_buf_real[i][j]),
|
&(audio_io_buf_real[i][j]),
|
||||||
&(audio_io_buf_imag[i][j]));
|
&(audio_io_buf_imag[i][j]));
|
||||||
|
|
@ -281,7 +281,7 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -306,8 +306,8 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
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(p_obj_drc->str_payload.pstr_qmf_filter,
|
process_qmf_syn_filt_bank(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+i*4*p_obj_drc->str_config.frame_size,
|
||||||
&(audio_io_buf_real[i][j]),
|
&(audio_io_buf_real[i][j]),
|
||||||
&(audio_io_buf_imag[i][j]),
|
&(audio_io_buf_imag[i][j]),
|
||||||
&(audio_in_out_buf[i][j]));
|
&(audio_in_out_buf[i][j]));
|
||||||
|
|
@ -347,7 +347,7 @@ WORD32 impd_init_process_audio_main_td_qmf (ia_drc_api_struct *p_obj_drc)
|
||||||
|
|
||||||
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) {
|
||||||
error = impd_process_drc_bitstream_dec(p_obj_drc->str_payload.pstr_bitstream_dec,
|
error = impd_process_drc_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],
|
||||||
|
|
|
||||||
|
|
@ -41,25 +41,25 @@
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drc( WORD32 drc_frame_size,
|
WORD32 impd_init_parametric_drc( WORD32 drc_frame_size,
|
||||||
WORD32 sampling_rate,
|
WORD32 sampling_rate,
|
||||||
WORD32 sub_band_domain_mode,
|
WORD32 sub_band_domain_mode,
|
||||||
ia_parametric_drc_params_struct *p_parametricdrc_params)
|
ia_parametric_drc_params_struct *p_parametricdrc_params)
|
||||||
{
|
{
|
||||||
|
|
||||||
WORD32 sub_band_count_tbl[4]={0,64,71,256};
|
WORD32 sub_band_count_tbl[4]={0,64,71,256};
|
||||||
p_parametricdrc_params->drc_frame_size = drc_frame_size;
|
p_parametricdrc_params->drc_frame_size = drc_frame_size;
|
||||||
p_parametricdrc_params->sampling_rate = sampling_rate;
|
p_parametricdrc_params->sampling_rate = sampling_rate;
|
||||||
p_parametricdrc_params->sub_band_domain_mode = sub_band_domain_mode;
|
p_parametricdrc_params->sub_band_domain_mode = sub_band_domain_mode;
|
||||||
|
|
||||||
p_parametricdrc_params->sub_band_count=sub_band_count_tbl[sub_band_domain_mode];
|
p_parametricdrc_params->sub_band_count=sub_band_count_tbl[sub_band_domain_mode];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drc_feed_fwd(ia_drc_config* pstr_drc_config,
|
WORD32 impd_init_parametric_drc_feed_fwd(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 instance_idx,
|
WORD32 instance_idx,
|
||||||
WORD32 ch_count_from_dwnmix_id,
|
WORD32 ch_count_from_dwnmix_id,
|
||||||
ia_parametric_drc_params_struct* p_parametricdrc_params)
|
ia_parametric_drc_params_struct* p_parametricdrc_params)
|
||||||
{
|
{
|
||||||
WORD32 err = 0, i = 0;
|
WORD32 err = 0, i = 0;
|
||||||
|
|
||||||
|
|
@ -78,13 +78,13 @@ WORD32 impd_init_parametric_drc_feed_fwd(ia_drc_config* pstr_drc_config,
|
||||||
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type = 0;
|
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type = 0;
|
||||||
|
|
||||||
if (pstr_parametric_ffwd_type_drc_params->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_QMF64)
|
if (pstr_parametric_ffwd_type_drc_params->sub_band_domain_mode == SUBBAND_DOMAIN_MODE_QMF64)
|
||||||
{
|
{
|
||||||
if (p_parametricdrc_params->sampling_rate == 48000)
|
if (p_parametricdrc_params->sampling_rate == 48000)
|
||||||
{
|
{
|
||||||
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type = 1;
|
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* support of other sampling rates than 48000 might be missing */
|
/* support of other sampling rates than 48000 might be missing */
|
||||||
return UNEXPECTED_ERROR;
|
return UNEXPECTED_ERROR;
|
||||||
}
|
}
|
||||||
|
|
@ -97,53 +97,53 @@ WORD32 impd_init_parametric_drc_feed_fwd(ia_drc_config* pstr_drc_config,
|
||||||
pstr_parametric_ffwd_type_drc_params->level_estim_frame_count = hParametricDrcTypeFeedForwardBs->level_estim_integration_time/pstr_parametric_ffwd_type_drc_params->frame_size;
|
pstr_parametric_ffwd_type_drc_params->level_estim_frame_count = hParametricDrcTypeFeedForwardBs->level_estim_integration_time/pstr_parametric_ffwd_type_drc_params->frame_size;
|
||||||
|
|
||||||
|
|
||||||
memset(pstr_parametric_ffwd_type_drc_params->level,0,PARAM_DRC_TYPE_FF_LEVEL_ESTIM_FRAME_COUNT_MAX*sizeof(FLOAT32));
|
memset(pstr_parametric_ffwd_type_drc_params->level,0,PARAM_DRC_TYPE_FF_LEVEL_ESTIM_FRAME_COUNT_MAX*sizeof(FLOAT32));
|
||||||
|
|
||||||
if (ch_count_from_dwnmix_id != 0)
|
if (ch_count_from_dwnmix_id != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
memcpy(pstr_parametric_ffwd_type_drc_params->level_estim_ch_weight,
|
memcpy(pstr_parametric_ffwd_type_drc_params->level_estim_ch_weight,
|
||||||
hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].level_estim_ch_weight,ch_count_from_dwnmix_id*sizeof(FLOAT32));
|
hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].level_estim_ch_weight,ch_count_from_dwnmix_id*sizeof(FLOAT32));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
for (i=0; i<pstr_parametric_ffwd_type_drc_params->audio_num_chan; i++)
|
for (i=0; i<pstr_parametric_ffwd_type_drc_params->audio_num_chan; i++)
|
||||||
{
|
{
|
||||||
pstr_parametric_ffwd_type_drc_params->level_estim_ch_weight[i] = (FLOAT32)channel_map[i];
|
pstr_parametric_ffwd_type_drc_params->level_estim_ch_weight[i] = (FLOAT32)channel_map[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pstr_parametric_ffwd_type_drc_params->sub_band_domain_mode==SUBBAND_DOMAIN_MODE_OFF)
|
if (pstr_parametric_ffwd_type_drc_params->sub_band_domain_mode==SUBBAND_DOMAIN_MODE_OFF)
|
||||||
{
|
{
|
||||||
err = impd_init_lvl_est_filt_time(pstr_parametric_ffwd_type_drc_params->level_estim_k_weighting_type,
|
err = impd_init_lvl_est_filt_time(pstr_parametric_ffwd_type_drc_params->level_estim_k_weighting_type,
|
||||||
p_parametricdrc_params->sampling_rate,
|
p_parametricdrc_params->sampling_rate,
|
||||||
&pstr_parametric_ffwd_type_drc_params->pre_filt_coeff,
|
&pstr_parametric_ffwd_type_drc_params->pre_filt_coeff,
|
||||||
&pstr_parametric_ffwd_type_drc_params->rlb_filt_coeff);
|
&pstr_parametric_ffwd_type_drc_params->rlb_filt_coeff);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = impd_init_lvl_est_filt_subband(pstr_parametric_ffwd_type_drc_params->level_estim_k_weighting_type,
|
err = impd_init_lvl_est_filt_subband(pstr_parametric_ffwd_type_drc_params->level_estim_k_weighting_type,
|
||||||
p_parametricdrc_params->sampling_rate,
|
p_parametricdrc_params->sampling_rate,
|
||||||
p_parametricdrc_params->sub_band_domain_mode,
|
p_parametricdrc_params->sub_band_domain_mode,
|
||||||
p_parametricdrc_params->sub_band_count,
|
p_parametricdrc_params->sub_band_count,
|
||||||
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type,
|
pstr_parametric_ffwd_type_drc_params->sub_band_compensation_type,
|
||||||
pstr_parametric_ffwd_type_drc_params->weighting_filt,
|
pstr_parametric_ffwd_type_drc_params->weighting_filt,
|
||||||
&pstr_parametric_ffwd_type_drc_params->filt_coeff_subband);
|
&pstr_parametric_ffwd_type_drc_params->filt_coeff_subband);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
pstr_parametric_ffwd_type_drc_params->node_count = hParametricDrcTypeFeedForwardBs->node_count;
|
pstr_parametric_ffwd_type_drc_params->node_count = hParametricDrcTypeFeedForwardBs->node_count;
|
||||||
|
|
||||||
|
|
||||||
memcpy(pstr_parametric_ffwd_type_drc_params->node_level,hParametricDrcTypeFeedForwardBs->node_level,pstr_parametric_ffwd_type_drc_params->node_count*sizeof(WORD32));
|
memcpy(pstr_parametric_ffwd_type_drc_params->node_level,hParametricDrcTypeFeedForwardBs->node_level,pstr_parametric_ffwd_type_drc_params->node_count*sizeof(WORD32));
|
||||||
memcpy(pstr_parametric_ffwd_type_drc_params->node_gain,hParametricDrcTypeFeedForwardBs->node_gain,pstr_parametric_ffwd_type_drc_params->node_count*sizeof(WORD32));
|
memcpy(pstr_parametric_ffwd_type_drc_params->node_gain,hParametricDrcTypeFeedForwardBs->node_gain,pstr_parametric_ffwd_type_drc_params->node_count*sizeof(WORD32));
|
||||||
|
|
||||||
pstr_parametric_ffwd_type_drc_params->ref_level_parametric_drc = hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].drc_input_loudness;
|
pstr_parametric_ffwd_type_drc_params->ref_level_parametric_drc = hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].drc_input_loudness;
|
||||||
|
|
||||||
|
|
@ -167,20 +167,20 @@ WORD32 impd_init_parametric_drc_feed_fwd(ia_drc_config* pstr_drc_config,
|
||||||
|
|
||||||
err = impd_parametric_ffwd_type_drc_reset(pstr_parametric_ffwd_type_drc_params);
|
err = impd_parametric_ffwd_type_drc_reset(pstr_parametric_ffwd_type_drc_params);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drc_lim(ia_drc_config* pstr_drc_config,
|
WORD32 impd_init_parametric_drc_lim(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 instance_idx,
|
WORD32 instance_idx,
|
||||||
WORD32 ch_count_from_dwnmix_id,
|
WORD32 ch_count_from_dwnmix_id,
|
||||||
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
||||||
pVOID *mem_ptr)
|
pVOID *mem_ptr)
|
||||||
{
|
{
|
||||||
WORD32 err = 0, i = 0;
|
WORD32 err = 0, i = 0;
|
||||||
UWORD32 j;
|
UWORD32 j;
|
||||||
UWORD32 attack, sec_len;
|
UWORD32 attack, sec_len;
|
||||||
|
|
||||||
WORD32 parametric_drc_idx = p_parametricdrc_params->parametric_drc_idx[instance_idx];
|
WORD32 parametric_drc_idx = p_parametricdrc_params->parametric_drc_idx[instance_idx];
|
||||||
|
|
@ -195,16 +195,16 @@ WORD32 impd_init_parametric_drc_lim(ia_drc_config* pstr_drc_config,
|
||||||
pstr_parametric_lim_type_drc_params->audio_num_chan = p_parametricdrc_params->audio_num_chan;
|
pstr_parametric_lim_type_drc_params->audio_num_chan = p_parametricdrc_params->audio_num_chan;
|
||||||
|
|
||||||
if (ch_count_from_dwnmix_id != 0)
|
if (ch_count_from_dwnmix_id != 0)
|
||||||
{
|
{
|
||||||
memcpy(pstr_parametric_lim_type_drc_params->level_estim_ch_weight,
|
memcpy(pstr_parametric_lim_type_drc_params->level_estim_ch_weight,
|
||||||
hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].level_estim_ch_weight,ch_count_from_dwnmix_id*sizeof(FLOAT32));
|
hDrcCoefficientsParametricDrcBs->str_parametric_drc_gain_set_params[gain_set_index].level_estim_ch_weight,ch_count_from_dwnmix_id*sizeof(FLOAT32));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=0; i<pstr_parametric_lim_type_drc_params->audio_num_chan; i++)
|
for (i=0; i<pstr_parametric_lim_type_drc_params->audio_num_chan; i++)
|
||||||
{
|
{
|
||||||
pstr_parametric_lim_type_drc_params->level_estim_ch_weight[i] = (FLOAT32)channel_map[i];
|
pstr_parametric_lim_type_drc_params->level_estim_ch_weight[i] = (FLOAT32)channel_map[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,7 +218,7 @@ WORD32 impd_init_parametric_drc_lim(ia_drc_config* pstr_drc_config,
|
||||||
pstr_parametric_lim_type_drc_params->num_max_buf_sec++;
|
pstr_parametric_lim_type_drc_params->num_max_buf_sec++;
|
||||||
|
|
||||||
pstr_parametric_lim_type_drc_params->max_buf =(FLOAT32*)(*mem_ptr);
|
pstr_parametric_lim_type_drc_params->max_buf =(FLOAT32*)(*mem_ptr);
|
||||||
*mem_ptr =(pVOID)((SIZE_T)(*mem_ptr)+pstr_parametric_lim_type_drc_params->num_max_buf_sec * sec_len*sizeof(FLOAT32));
|
*mem_ptr =(pVOID)((SIZE_T)(*mem_ptr)+pstr_parametric_lim_type_drc_params->num_max_buf_sec * sec_len*sizeof(FLOAT32));
|
||||||
|
|
||||||
pstr_parametric_lim_type_drc_params->attack_ms = (FLOAT32)hParametricDrcTypeLimBs->parametric_lim_attack;
|
pstr_parametric_lim_type_drc_params->attack_ms = (FLOAT32)hParametricDrcTypeLimBs->parametric_lim_attack;
|
||||||
pstr_parametric_lim_type_drc_params->release_ms = (FLOAT32)hParametricDrcTypeLimBs->parametric_lim_release;
|
pstr_parametric_lim_type_drc_params->release_ms = (FLOAT32)hParametricDrcTypeLimBs->parametric_lim_release;
|
||||||
|
|
@ -245,10 +245,10 @@ WORD32 impd_init_parametric_drc_lim(ia_drc_config* pstr_drc_config,
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_parametric_drcInstance(ia_drc_config* pstr_drc_config,
|
WORD32 impd_init_parametric_drcInstance(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 instance_idx,
|
WORD32 instance_idx,
|
||||||
WORD32 ch_count_from_dwnmix_id,
|
WORD32 ch_count_from_dwnmix_id,
|
||||||
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
||||||
pVOID *mem_ptr)
|
pVOID *mem_ptr)
|
||||||
{
|
{
|
||||||
WORD32 err = 0;
|
WORD32 err = 0;
|
||||||
|
|
||||||
|
|
@ -260,33 +260,33 @@ WORD32 impd_init_parametric_drcInstance(ia_drc_config* pstr_drc_config,
|
||||||
p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].str_spline_nodes.num_nodes = p_parametricdrc_params->num_nodes;
|
p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].str_spline_nodes.num_nodes = p_parametricdrc_params->num_nodes;
|
||||||
|
|
||||||
if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].disable_paramteric_drc == 0)
|
if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].disable_paramteric_drc == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].parametric_drc_type == PARAM_DRC_TYPE_FF)
|
if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].parametric_drc_type == PARAM_DRC_TYPE_FF)
|
||||||
{
|
{
|
||||||
|
|
||||||
err = impd_init_parametric_drc_feed_fwd(pstr_drc_config,
|
err = impd_init_parametric_drc_feed_fwd(pstr_drc_config,
|
||||||
instance_idx,
|
instance_idx,
|
||||||
ch_count_from_dwnmix_id,
|
ch_count_from_dwnmix_id,
|
||||||
p_parametricdrc_params);
|
p_parametricdrc_params);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].parametric_drc_type == PARAM_DRC_TYPE_LIM)
|
else if (p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].parametric_drc_type == PARAM_DRC_TYPE_LIM)
|
||||||
{
|
{
|
||||||
|
|
||||||
p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].str_spline_nodes.num_nodes = p_parametricdrc_params->drc_frame_size;
|
p_parametricdrc_params->str_parametric_drc_instance_params[instance_idx].str_spline_nodes.num_nodes = p_parametricdrc_params->drc_frame_size;
|
||||||
|
|
||||||
err = impd_init_parametric_drc_lim(pstr_drc_config,
|
err = impd_init_parametric_drc_lim(pstr_drc_config,
|
||||||
instance_idx,
|
instance_idx,
|
||||||
ch_count_from_dwnmix_id,
|
ch_count_from_dwnmix_id,
|
||||||
p_parametricdrc_params,
|
p_parametricdrc_params,
|
||||||
mem_ptr);
|
mem_ptr);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -301,8 +301,8 @@ WORD32 impd_init_parametric_drcInstance(ia_drc_config* pstr_drc_config,
|
||||||
|
|
||||||
|
|
||||||
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 *p_parametricdrc_params,
|
ia_parametric_drc_params_struct *p_parametricdrc_params,
|
||||||
pVOID *mem_ptr)
|
pVOID *mem_ptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -313,23 +313,23 @@ WORD32 impd_init_parametric_drc_after_config(ia_drc_config* pstr_drc_con
|
||||||
p_parametricdrc_params->num_nodes = p_parametricdrc_params->drc_frame_size/p_parametricdrc_params->parametric_drc_frame_size;
|
p_parametricdrc_params->num_nodes = p_parametricdrc_params->drc_frame_size/p_parametricdrc_params->parametric_drc_frame_size;
|
||||||
|
|
||||||
switch (p_parametricdrc_params->sub_band_domain_mode) {
|
switch (p_parametricdrc_params->sub_band_domain_mode) {
|
||||||
case SUBBAND_DOMAIN_MODE_QMF64:
|
case SUBBAND_DOMAIN_MODE_QMF64:
|
||||||
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
break;
|
break;
|
||||||
case SUBBAND_DOMAIN_MODE_QMF71:
|
case SUBBAND_DOMAIN_MODE_QMF71:
|
||||||
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF71;
|
||||||
break;
|
break;
|
||||||
case SUBBAND_DOMAIN_MODE_STFT256:
|
case SUBBAND_DOMAIN_MODE_STFT256:
|
||||||
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
L = AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_STFT256;
|
||||||
break;
|
break;
|
||||||
case SUBBAND_DOMAIN_MODE_OFF:
|
case SUBBAND_DOMAIN_MODE_OFF:
|
||||||
default:
|
default:
|
||||||
L = 0;
|
L = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_parametricdrc_params->sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF && p_parametricdrc_params->parametric_drc_frame_size != L)
|
if (p_parametricdrc_params->sub_band_domain_mode != SUBBAND_DOMAIN_MODE_OFF && p_parametricdrc_params->parametric_drc_frame_size != L)
|
||||||
{
|
{
|
||||||
return (EXTERNAL_ERROR);
|
return (EXTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,7 +367,7 @@ WORD32 impd_init_parametric_drc_after_config(ia_drc_config* pstr_drc_con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (drcInputLoudnessFound == 0)
|
if (drcInputLoudnessFound == 0)
|
||||||
{
|
{
|
||||||
for (m=0; m<loudness_info->measurement_count; m++)
|
for (m=0; m<loudness_info->measurement_count; m++)
|
||||||
{
|
{
|
||||||
if (loudness_info->loudness_measure[m].method_def == METHOD_DEFINITION_ANCHOR_LOUDNESS)
|
if (loudness_info->loudness_measure[m].method_def == METHOD_DEFINITION_ANCHOR_LOUDNESS)
|
||||||
|
|
@ -422,9 +422,9 @@ WORD32 impd_init_parametric_drc_after_config(ia_drc_config* pstr_drc_con
|
||||||
}
|
}
|
||||||
|
|
||||||
impd_init_parametric_drcInstance(pstr_drc_config,
|
impd_init_parametric_drcInstance(pstr_drc_config,
|
||||||
instance_idx,
|
instance_idx,
|
||||||
ch_count_from_dwnmix_id,
|
ch_count_from_dwnmix_id,
|
||||||
p_parametricdrc_params,
|
p_parametricdrc_params,
|
||||||
mem_ptr);
|
mem_ptr);
|
||||||
if (err) return (err);
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
@ -435,47 +435,47 @@ WORD32 impd_init_parametric_drc_after_config(ia_drc_config* pstr_drc_con
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_init_lvl_est_filt_time( WORD32 level_estim_k_weighting_type,
|
WORD32 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 i;
|
WORD32 i;
|
||||||
const FLOAT32* ptr_samp_tbl;
|
const FLOAT32* ptr_samp_tbl;
|
||||||
|
|
||||||
switch(sampling_rate)
|
switch(sampling_rate)
|
||||||
{
|
{
|
||||||
case 96000:i=0;
|
case 96000:i=0;
|
||||||
break;
|
break;
|
||||||
case 88200:i=1;
|
case 88200:i=1;
|
||||||
break;
|
break;
|
||||||
case 64000:i=2;
|
case 64000:i=2;
|
||||||
break;
|
break;
|
||||||
case 48000:i=3;
|
case 48000:i=3;
|
||||||
break;
|
break;
|
||||||
case 44100:i=4;
|
case 44100:i=4;
|
||||||
break;
|
break;
|
||||||
case 32000:i=5;
|
case 32000:i=5;
|
||||||
break;
|
break;
|
||||||
case 24000:i=6;
|
case 24000:i=6;
|
||||||
break;
|
break;
|
||||||
case 22050:i=7;
|
case 22050:i=7;
|
||||||
break;
|
break;
|
||||||
case 16000:i=8;
|
case 16000:i=8;
|
||||||
break;
|
break;
|
||||||
case 12000:i=9;
|
case 12000:i=9;
|
||||||
break;
|
break;
|
||||||
case 11025:i=10;
|
case 11025:i=10;
|
||||||
break;
|
break;
|
||||||
case 8000:i=11;
|
case 8000:i=11;
|
||||||
break;
|
break;
|
||||||
case 7350:i=12;
|
case 7350:i=12;
|
||||||
break;
|
break;
|
||||||
default:i=3;
|
default:i=3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_samp_tbl = samp_rate_tbl[i];
|
ptr_samp_tbl = samp_rate_tbl[i];
|
||||||
|
|
||||||
if (level_estim_k_weighting_type==2) {
|
if (level_estim_k_weighting_type==2) {
|
||||||
|
|
||||||
|
|
@ -502,78 +502,78 @@ WORD32 impd_init_lvl_est_filt_time( WORD32 level_estim_k_weighting_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_type,
|
WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_type,
|
||||||
WORD32 sampling_rate,
|
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,
|
WORD32 sub_band_compensation_type,
|
||||||
FLOAT32 *weighting_filt,
|
FLOAT32 *weighting_filt,
|
||||||
ia_2nd_order_filt_coeff_struct* filt_coeff_subband)
|
ia_2nd_order_filt_coeff_struct* filt_coeff_subband)
|
||||||
{
|
{
|
||||||
FLOAT32 w0, alpha, sinw0, cosw0;
|
FLOAT32 w0, alpha, sinw0, cosw0;
|
||||||
FLOAT32 b0, b1, b2, a0, a1, a2;
|
FLOAT32 b0, b1, b2, a0, a1, a2;
|
||||||
FLOAT32 num_real,num_imag,den_real,den_imag;
|
FLOAT32 num_real,num_imag,den_real,den_imag;
|
||||||
FLOAT32 *f_bands_nrm;
|
FLOAT32 *f_bands_nrm;
|
||||||
WORD32 b;
|
WORD32 b;
|
||||||
WORD32 i;
|
WORD32 i;
|
||||||
const FLOAT32* ptr_samp_tbl;
|
const FLOAT32* ptr_samp_tbl;
|
||||||
|
|
||||||
switch(sampling_rate)
|
switch(sampling_rate)
|
||||||
{
|
{
|
||||||
case 96000:i=0;
|
case 96000:i=0;
|
||||||
break;
|
break;
|
||||||
case 88200:i=1;
|
case 88200:i=1;
|
||||||
break;
|
break;
|
||||||
case 64000:i=2;
|
case 64000:i=2;
|
||||||
break;
|
break;
|
||||||
case 48000:i=3;
|
case 48000:i=3;
|
||||||
break;
|
break;
|
||||||
case 44100:i=4;
|
case 44100:i=4;
|
||||||
break;
|
break;
|
||||||
case 32000:i=5;
|
case 32000:i=5;
|
||||||
break;
|
break;
|
||||||
case 24000:i=6;
|
case 24000:i=6;
|
||||||
break;
|
break;
|
||||||
case 22050:i=7;
|
case 22050:i=7;
|
||||||
break;
|
break;
|
||||||
case 16000:i=8;
|
case 16000:i=8;
|
||||||
break;
|
break;
|
||||||
case 12000:i=9;
|
case 12000:i=9;
|
||||||
break;
|
break;
|
||||||
case 11025:i=10;
|
case 11025:i=10;
|
||||||
break;
|
break;
|
||||||
case 8000:i=11;
|
case 8000:i=11;
|
||||||
break;
|
break;
|
||||||
case 7350:i=12;
|
case 7350:i=12;
|
||||||
break;
|
break;
|
||||||
default:i=3;
|
default:i=3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_samp_tbl = samp_rate_tbl[i];
|
ptr_samp_tbl = samp_rate_tbl[i];
|
||||||
|
|
||||||
switch (sub_band_domain_mode)
|
switch (sub_band_domain_mode)
|
||||||
{
|
{
|
||||||
case SUBBAND_DOMAIN_MODE_QMF64:
|
case SUBBAND_DOMAIN_MODE_QMF64:
|
||||||
f_bands_nrm = f_bands_nrm_QMF64;
|
f_bands_nrm = f_bands_nrm_QMF64;
|
||||||
break;
|
break;
|
||||||
case SUBBAND_DOMAIN_MODE_QMF71:
|
case SUBBAND_DOMAIN_MODE_QMF71:
|
||||||
f_bands_nrm = f_bands_nrm_QMF71;
|
f_bands_nrm = f_bands_nrm_QMF71;
|
||||||
break;
|
break;
|
||||||
case SUBBAND_DOMAIN_MODE_STFT256:
|
case SUBBAND_DOMAIN_MODE_STFT256:
|
||||||
f_bands_nrm = f_bands_nrm_STFT256;
|
f_bands_nrm = f_bands_nrm_STFT256;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return UNEXPECTED_ERROR;
|
return UNEXPECTED_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (b=0; b<sub_band_count; b++)
|
for (b=0; b<sub_band_count; b++)
|
||||||
{
|
{
|
||||||
weighting_filt[b] = 1.f;
|
weighting_filt[b] = 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level_estim_k_weighting_type == 2)
|
if (level_estim_k_weighting_type == 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
b0 = ptr_samp_tbl[0];
|
b0 = ptr_samp_tbl[0];
|
||||||
b1 = ptr_samp_tbl[1];
|
b1 = ptr_samp_tbl[1];
|
||||||
|
|
@ -583,7 +583,7 @@ WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_ty
|
||||||
a0 = 1.f;
|
a0 = 1.f;
|
||||||
|
|
||||||
for (b=0; b<sub_band_count; b++)
|
for (b=0; b<sub_band_count; b++)
|
||||||
{
|
{
|
||||||
|
|
||||||
num_real = b0 + b1 * (FLOAT32)cos(PI*f_bands_nrm[b]) + b2 * (FLOAT32)cos(PI*2*f_bands_nrm[b]);
|
num_real = b0 + b1 * (FLOAT32)cos(PI*f_bands_nrm[b]) + b2 * (FLOAT32)cos(PI*2*f_bands_nrm[b]);
|
||||||
num_imag = - b1 * (FLOAT32)sin(PI*f_bands_nrm[b]) - b2 * (FLOAT32)sin(PI*2*f_bands_nrm[b]);
|
num_imag = - b1 * (FLOAT32)sin(PI*f_bands_nrm[b]) - b2 * (FLOAT32)sin(PI*2*f_bands_nrm[b]);
|
||||||
|
|
@ -595,7 +595,7 @@ WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_ty
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level_estim_k_weighting_type == 1 || level_estim_k_weighting_type == 2)
|
if (level_estim_k_weighting_type == 1 || level_estim_k_weighting_type == 2)
|
||||||
{
|
{
|
||||||
b0 = ptr_samp_tbl[5];
|
b0 = ptr_samp_tbl[5];
|
||||||
b1 = ptr_samp_tbl[6];
|
b1 = ptr_samp_tbl[6];
|
||||||
b2 = ptr_samp_tbl[7];
|
b2 = ptr_samp_tbl[7];
|
||||||
|
|
@ -605,10 +605,10 @@ WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_ty
|
||||||
|
|
||||||
|
|
||||||
for (b=0; b<sub_band_count; b++)
|
for (b=0; b<sub_band_count; b++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(sub_band_compensation_type==1 && b==0))
|
if (!(sub_band_compensation_type==1 && b==0))
|
||||||
{
|
{
|
||||||
num_real =(FLOAT32)( b0 + b1 * cos(PI*f_bands_nrm[b]) + b2 * cos(PI*2*f_bands_nrm[b]));
|
num_real =(FLOAT32)( b0 + b1 * cos(PI*f_bands_nrm[b]) + b2 * cos(PI*2*f_bands_nrm[b]));
|
||||||
num_imag =(FLOAT32)( - b1 * sin(PI*f_bands_nrm[b]) - b2 * sin(PI*2*f_bands_nrm[b]));
|
num_imag =(FLOAT32)( - b1 * sin(PI*f_bands_nrm[b]) - b2 * sin(PI*2*f_bands_nrm[b]));
|
||||||
den_real = (FLOAT32)(a0 + a1 * cos(PI*f_bands_nrm[b]) + a2 * cos(PI*2*f_bands_nrm[b]));
|
den_real = (FLOAT32)(a0 + a1 * cos(PI*f_bands_nrm[b]) + a2 * cos(PI*2*f_bands_nrm[b]));
|
||||||
|
|
@ -619,7 +619,7 @@ WORD32 impd_init_lvl_est_filt_subband( WORD32 level_estim_k_weighting_ty
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sub_band_compensation_type==1)
|
if (sub_band_compensation_type==1)
|
||||||
{
|
{
|
||||||
|
|
||||||
w0 = 2.0f*PI * 38.0f / (FLOAT32)sampling_rate * AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
w0 = 2.0f*PI * 38.0f / (FLOAT32)sampling_rate * AUDIO_CODEC_SUBBAND_DOWNSAMPLING_FACTOR_QMF64;
|
||||||
sinw0 = (FLOAT32)sin(w0);
|
sinw0 = (FLOAT32)sin(w0);
|
||||||
|
|
@ -673,10 +673,10 @@ WORD32 impd_parametric_ffwd_type_drc_reset(ia_parametric_drc_type_ff_params_stru
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 impd_parametric_drc_instance_process (FLOAT32* audio_in_out_buf[],
|
WORD32 impd_parametric_drc_instance_process (FLOAT32* audio_in_out_buf[],
|
||||||
FLOAT32* audio_real_buff[],
|
FLOAT32* audio_real_buff[],
|
||||||
FLOAT32* audio_imag_buff[],
|
FLOAT32* audio_imag_buff[],
|
||||||
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
ia_parametric_drc_params_struct* p_parametricdrc_params,
|
||||||
ia_parametric_drc_instance_params_struct* pstr_parametric_drc_instance_params)
|
ia_parametric_drc_instance_params_struct* pstr_parametric_drc_instance_params)
|
||||||
{
|
{
|
||||||
WORD32 err = 0, i = 0;
|
WORD32 err = 0, i = 0;
|
||||||
|
|
||||||
|
|
@ -697,11 +697,11 @@ WORD32 impd_parametric_drc_instance_process (FLOAT32*
|
||||||
ia_parametric_drc_type_ff_params_struct* pstr_parametric_ffwd_type_drc_params = &(pstr_parametric_drc_instance_params->str_parametric_drc_type_ff_params);
|
ia_parametric_drc_type_ff_params_struct* pstr_parametric_ffwd_type_drc_params = &(pstr_parametric_drc_instance_params->str_parametric_drc_type_ff_params);
|
||||||
for (i=0; i<p_parametricdrc_params->num_nodes; i++) {
|
for (i=0; i<p_parametricdrc_params->num_nodes; i++) {
|
||||||
err = impd_parametric_ffwd_type_drc_process(audio_in_out_buf,
|
err = impd_parametric_ffwd_type_drc_process(audio_in_out_buf,
|
||||||
audio_real_buff,
|
audio_real_buff,
|
||||||
audio_imag_buff,
|
audio_imag_buff,
|
||||||
i,
|
i,
|
||||||
pstr_parametric_ffwd_type_drc_params,
|
pstr_parametric_ffwd_type_drc_params,
|
||||||
&pstr_parametric_drc_instance_params->str_spline_nodes);
|
&pstr_parametric_drc_instance_params->str_spline_nodes);
|
||||||
if (err) return (err);
|
if (err) return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -742,11 +742,11 @@ VOID iir_second_order_filter (ia_2nd_order_filt_coeff_struct* coeff,
|
||||||
state->z2=z2;
|
state->z2=z2;
|
||||||
}
|
}
|
||||||
WORD32 impd_parametric_ffwd_type_drc_process(FLOAT32* audio_in_out_buf[],
|
WORD32 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 c, t, b, n, i, offset;
|
WORD32 c, t, b, n, i, offset;
|
||||||
FLOAT32 x, y, channelLevel, level, levelDb, loc_db_gain, levelDelta, alpha;
|
FLOAT32 x, y, channelLevel, level, levelDb, loc_db_gain, levelDelta, alpha;
|
||||||
|
|
@ -950,9 +950,9 @@ WORD32 impd_parametric_ffwd_type_drc_process(FLOAT32*
|
||||||
|
|
||||||
|
|
||||||
WORD32 impd_parametric_lim_type_drc_process(FLOAT32* samples[],
|
WORD32 impd_parametric_lim_type_drc_process(FLOAT32* samples[],
|
||||||
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)
|
||||||
{
|
{
|
||||||
WORD32 i, j;
|
WORD32 i, j;
|
||||||
FLOAT32 tmp, gain;
|
FLOAT32 tmp, gain;
|
||||||
|
|
@ -977,7 +977,7 @@ WORD32 impd_parametric_lim_type_drc_process(FLOAT32*
|
||||||
tmp =0.0f;
|
tmp =0.0f;
|
||||||
for (j = 0; j < num_channels; j++){
|
for (j = 0; j < num_channels; j++){
|
||||||
if (!level_estim_ch_weight[j])
|
if (!level_estim_ch_weight[j])
|
||||||
continue;
|
continue;
|
||||||
tmp = max(tmp, (FLOAT32)fabs(loudness_normalization_gain*(level_estim_ch_weight[j])*(samples[j][i])));
|
tmp = max(tmp, (FLOAT32)fabs(loudness_normalization_gain*(level_estim_ch_weight[j])*(samples[j][i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,14 +72,14 @@ impd_parse_dwnmix_instructions(ia_bit_buf_struct* it_bit_buff,
|
||||||
|
|
||||||
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
|
||||||
);
|
);
|
||||||
|
|
@ -90,7 +90,7 @@ impd_parse_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -100,7 +100,7 @@ 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);
|
||||||
|
|
|
||||||
|
|
@ -35,54 +35,54 @@
|
||||||
|
|
||||||
|
|
||||||
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,
|
FLOAT32 limit_threshold,
|
||||||
UWORD32 num_channels,
|
UWORD32 num_channels,
|
||||||
UWORD32 sample_rate,
|
UWORD32 sample_rate,
|
||||||
FLOAT32 *buffer
|
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, (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) );
|
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)
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,12 @@ typedef struct ia_drc_peak_limiter_struct {
|
||||||
}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,
|
FLOAT32 limit_threshold,
|
||||||
UWORD32 num_channels,
|
UWORD32 num_channels,
|
||||||
UWORD32 sample_rate,
|
UWORD32 sample_rate,
|
||||||
FLOAT32 *buffer);
|
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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,8 @@ WORD32 impd_apply_gains_and_add(ia_drc_instructions_struct* pstr_drc_instruction
|
||||||
iEnd);
|
iEnd);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (i=iStart; i<iEnd; i++){
|
for (i=iStart; i<iEnd; i++){
|
||||||
deinterleaved_audio[signalIndex][i] = lpcm_gains[i];
|
deinterleaved_audio[signalIndex][i] = lpcm_gains[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -345,7 +345,7 @@ impd_filter_banks_process(ia_drc_instructions_struct* pstr_drc_instruction_arr,
|
||||||
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;
|
||||||
|
|
|
||||||
|
|
@ -30,19 +30,19 @@
|
||||||
|
|
||||||
const FLOAT32 samp_rate_tbl[13][12]=
|
const FLOAT32 samp_rate_tbl[13][12]=
|
||||||
{
|
{
|
||||||
{1.559742927551f,-2.926673889160f,1.378173947334f,-1.844531774521f,0.855774641037f,0.997517585754f,-1.995035171509f,0.997517585754f,-1.995032072067f,0.995038211346f},
|
{1.559742927551f,-2.926673889160f,1.378173947334f,-1.844531774521f,0.855774641037f,0.997517585754f,-1.995035171509f,0.997517585754f,-1.995032072067f,0.995038211346f},
|
||||||
{1.557545065880f,-2.905559301376f,1.361245870590f,-1.830842256546f,0.844074070454f,0.997298538685f,-1.994597077370f,0.997298538685f,-1.994593381882f,0.994600534439f},
|
{1.557545065880f,-2.905559301376f,1.361245870590f,-1.830842256546f,0.844074070454f,0.997298538685f,-1.994597077370f,0.997298538685f,-1.994593381882f,0.994600534439f},
|
||||||
{1.547380685806f,-2.808161973953f,1.285161137581f,-1.767331838608f,0.791711509228f,0.996279776096f,-1.992559552193f,0.996279776096f,-1.992552518845f,0.992566406727f},
|
{1.547380685806f,-2.808161973953f,1.285161137581f,-1.767331838608f,0.791711509228f,0.996279776096f,-1.992559552193f,0.996279776096f,-1.992552518845f,0.992566406727f},
|
||||||
{1.535182833672f,-2.691803932190f,1.198426246643f,-1.690699458122f,0.732504665852f,0.995044350624f,-1.990088701248f,0.995044350624f,-1.990076303482f,0.990100920200f},
|
{1.535182833672f,-2.691803932190f,1.198426246643f,-1.690699458122f,0.732504665852f,0.995044350624f,-1.990088701248f,0.995044350624f,-1.990076303482f,0.990100920200f},
|
||||||
{1.530909657478f,-2.651169300079f,1.169166922569f,-1.663750052452f,0.712657511234f,0.994607865810f,-1.989215731621f,0.994607865810f,-1.989201068878f,0.989230215549f},
|
{1.530909657478f,-2.651169300079f,1.169166922569f,-1.663750052452f,0.712657511234f,0.994607865810f,-1.989215731621f,0.994607865810f,-1.989201068878f,0.989230215549f},
|
||||||
{1.511321425438f,-2.465713739395f,1.042117238045f,-1.539572954178f,0.627297878265f,0.992580235004f,-1.985160470009f,0.992580235004f,-1.985132932663f,0.985188126564f},
|
{1.511321425438f,-2.465713739395f,1.042117238045f,-1.539572954178f,0.627297878265f,0.992580235004f,-1.985160470009f,0.992580235004f,-1.985132932663f,0.985188126564f},
|
||||||
{1.488207340240f,-2.248480796814f,0.906192243099f,-1.391770243645f,0.537688970566f,0.990125238895f,-1.980250477791f,0.990125238895f,-1.980201482773f,0.980299532413f},
|
{1.488207340240f,-2.248480796814f,0.906192243099f,-1.391770243645f,0.537688970566f,0.990125238895f,-1.980250477791f,0.990125238895f,-1.980201482773f,0.980299532413f},
|
||||||
{1.480212569237f,-2.173723459244f,0.862487196922f,-1.340346932411f,0.509323298931f,0.989259064198f,-1.978518128395f,0.989259064198f,-1.978460073471f,0.978576123714f},
|
{1.480212569237f,-2.173723459244f,0.862487196922f,-1.340346932411f,0.509323298931f,0.989259064198f,-1.978518128395f,0.989259064198f,-1.978460073471f,0.978576123714f},
|
||||||
{1.444234013557f,-1.839543223381f,0.685432314873f,-1.107139229774f,0.397262454033f,0.985242545605f,-1.970485091209f,0.985242545605f,-1.970375299454f,0.970594763756f},
|
{1.444234013557f,-1.839543223381f,0.685432314873f,-1.107139229774f,0.397262454033f,0.985242545605f,-1.970485091209f,0.985242545605f,-1.970375299454f,0.970594763756f},
|
||||||
{1.403080821037f,-1.461511373520f,0.519652962685f,-0.837045848370f,0.298268288374f,0.980395674706f,-1.960791349411f,0.980395674706f,-1.960597157478f,0.960985362530f},
|
{1.403080821037f,-1.461511373520f,0.519652962685f,-0.837045848370f,0.298268288374f,0.980395674706f,-1.960791349411f,0.980395674706f,-1.960597157478f,0.960985362530f},
|
||||||
{1.389132857323f,-1.334347724915f,0.471855700016f,-0.744739949703f,0.271380871534f,0.978689610958f,-1.957379221916f,0.978689610958f,-1.957149744034f,0.957608699799f},
|
{1.389132857323f,-1.334347724915f,0.471855700016f,-0.744739949703f,0.271380871534f,0.978689610958f,-1.957379221916f,0.978689610958f,-1.957149744034f,0.957608699799f},
|
||||||
{1.327733159065f,-0.780098080635f,0.309720277786f,-0.334008187056f,0.191363617778f,0.970807731152f,-1.941615462303f,0.970807731152f,-1.941183090210f,0.942047894001f},
|
{1.327733159065f,-0.780098080635f,0.309720277786f,-0.334008187056f,0.191363617778f,0.970807731152f,-1.941615462303f,0.970807731152f,-1.941183090210f,0.942047894001f},
|
||||||
{1.308971643448f,-0.612507879734f,0.275601744652f,-0.207099482417f,0.179165065289f,0.968287348747f,-1.936574697495f,0.968287348747f,-1.936063885689f,0.937085747719f}
|
{1.308971643448f,-0.612507879734f,0.275601744652f,-0.207099482417f,0.179165065289f,0.968287348747f,-1.936574697495f,0.968287348747f,-1.936063885689f,0.937085747719f}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -79,55 +79,55 @@ const ia_delta_gain_code_table_struct ia_drc_gain_tbls_prof_0_1[NUM_GAIN_TBL_PRO
|
||||||
|
|
||||||
const ia_delta_gain_code_table_struct ia_drc_gain_tbls_prof_2[NUM_GAIN_TBL_PROF_2_ENTRIES] =
|
const ia_delta_gain_code_table_struct ia_drc_gain_tbls_prof_2[NUM_GAIN_TBL_PROF_2_ENTRIES] =
|
||||||
{
|
{
|
||||||
{ 3, 0x007, -0.125f },
|
{ 3, 0x007, -0.125f },
|
||||||
{ 4, 0x00C, -0.625f },
|
{ 4, 0x00C, -0.625f },
|
||||||
{ 4, 0x009, -0.500f },
|
{ 4, 0x009, -0.500f },
|
||||||
{ 4, 0x005, -0.375f },
|
{ 4, 0x005, -0.375f },
|
||||||
{ 4, 0x003, -0.250f },
|
{ 4, 0x003, -0.250f },
|
||||||
{ 4, 0x001, 0.000f },
|
{ 4, 0x001, 0.000f },
|
||||||
{ 4, 0x00B, 0.125f },
|
{ 4, 0x00B, 0.125f },
|
||||||
{ 5, 0x011, -0.875f },
|
{ 5, 0x011, -0.875f },
|
||||||
{ 5, 0x00E, -0.750f },
|
{ 5, 0x00E, -0.750f },
|
||||||
{ 5, 0x005, 0.250f },
|
{ 5, 0x005, 0.250f },
|
||||||
{ 5, 0x004, 0.375f },
|
{ 5, 0x004, 0.375f },
|
||||||
{ 5, 0x008, 0.500f },
|
{ 5, 0x008, 0.500f },
|
||||||
{ 5, 0x000, 0.625f },
|
{ 5, 0x000, 0.625f },
|
||||||
{ 5, 0x00D, 0.750f },
|
{ 5, 0x00D, 0.750f },
|
||||||
{ 5, 0x00F, 0.875f },
|
{ 5, 0x00F, 0.875f },
|
||||||
{ 5, 0x010, 1.000f },
|
{ 5, 0x010, 1.000f },
|
||||||
{ 5, 0x01B, 1.125f },
|
{ 5, 0x01B, 1.125f },
|
||||||
{ 6, 0x02B, -1.250f },
|
{ 6, 0x02B, -1.250f },
|
||||||
{ 6, 0x028, -1.125f },
|
{ 6, 0x028, -1.125f },
|
||||||
{ 6, 0x002, -1.000f },
|
{ 6, 0x002, -1.000f },
|
||||||
{ 6, 0x012, 1.250f },
|
{ 6, 0x012, 1.250f },
|
||||||
{ 6, 0x018, 1.375f },
|
{ 6, 0x018, 1.375f },
|
||||||
{ 6, 0x029, 1.500f },
|
{ 6, 0x029, 1.500f },
|
||||||
{ 7, 0x06A, -4.000f },
|
{ 7, 0x06A, -4.000f },
|
||||||
{ 7, 0x054, -1.750f },
|
{ 7, 0x054, -1.750f },
|
||||||
{ 7, 0x068, -1.625f },
|
{ 7, 0x068, -1.625f },
|
||||||
{ 7, 0x026, -1.500f },
|
{ 7, 0x026, -1.500f },
|
||||||
{ 7, 0x006, -1.375f },
|
{ 7, 0x006, -1.375f },
|
||||||
{ 7, 0x032, 1.625f },
|
{ 7, 0x032, 1.625f },
|
||||||
{ 8, 0x0D2, -2.250f },
|
{ 8, 0x0D2, -2.250f },
|
||||||
{ 8, 0x0AB, -2.125f },
|
{ 8, 0x0AB, -2.125f },
|
||||||
{ 8, 0x0AA, -2.000f },
|
{ 8, 0x0AA, -2.000f },
|
||||||
{ 8, 0x04F, -1.875f },
|
{ 8, 0x04F, -1.875f },
|
||||||
{ 8, 0x04E, 1.750f },
|
{ 8, 0x04E, 1.750f },
|
||||||
{ 8, 0x0D7, 1.875f },
|
{ 8, 0x0D7, 1.875f },
|
||||||
{ 8, 0x00E, 2.000f },
|
{ 8, 0x00E, 2.000f },
|
||||||
{ 9, 0x1AD, -3.625f },
|
{ 9, 0x1AD, -3.625f },
|
||||||
{ 9, 0x1AC, -3.375f },
|
{ 9, 0x1AC, -3.375f },
|
||||||
{ 9, 0x1A6, -3.250f },
|
{ 9, 0x1A6, -3.250f },
|
||||||
{ 9, 0x0CD, -3.125f },
|
{ 9, 0x0CD, -3.125f },
|
||||||
{ 9, 0x0CE, -2.750f },
|
{ 9, 0x0CE, -2.750f },
|
||||||
{ 9, 0x1A7, -2.625f },
|
{ 9, 0x1A7, -2.625f },
|
||||||
{ 9, 0x01F, -2.500f },
|
{ 9, 0x01F, -2.500f },
|
||||||
{ 9, 0x0CC, -2.375f },
|
{ 9, 0x0CC, -2.375f },
|
||||||
{ 10, 0x03C, -3.500f },
|
{ 10, 0x03C, -3.500f },
|
||||||
{ 10, 0x19E, -3.000f },
|
{ 10, 0x19E, -3.000f },
|
||||||
{ 10, 0x19F, -2.875f },
|
{ 10, 0x19F, -2.875f },
|
||||||
{ 11, 0x07A, -3.875f },
|
{ 11, 0x07A, -3.875f },
|
||||||
{ 11, 0x07B, -3.750f }
|
{ 11, 0x07B, -3.750f }
|
||||||
};
|
};
|
||||||
|
|
||||||
const FLOAT32 channel_weight[] =
|
const FLOAT32 channel_weight[] =
|
||||||
|
|
@ -1271,21 +1271,21 @@ FLOAT64 qmf_filter_coeff[640] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = {
|
const ia_filter_bank_params_struct normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = {
|
||||||
{2.0f/1024.0f, 0.0000373252f, 0.9913600345f},
|
{2.0f/1024.0f, 0.0000373252f, 0.9913600345f},
|
||||||
{3.0f/1024.0f, 0.0000836207f, 0.9870680830f},
|
{3.0f/1024.0f, 0.0000836207f, 0.9870680830f},
|
||||||
{4.0f/1024.0f, 0.0001480220f, 0.9827947083f},
|
{4.0f/1024.0f, 0.0001480220f, 0.9827947083f},
|
||||||
{5.0f/1024.0f, 0.0002302960f, 0.9785398263f},
|
{5.0f/1024.0f, 0.0002302960f, 0.9785398263f},
|
||||||
{6.0f/1024.0f, 0.0003302134f, 0.9743033527f},
|
{6.0f/1024.0f, 0.0003302134f, 0.9743033527f},
|
||||||
{2.0f/256.0f, 0.0005820761f, 0.9658852897f},
|
{2.0f/256.0f, 0.0005820761f, 0.9658852897f},
|
||||||
{3.0f/256.0f, 0.0012877837f, 0.9492662926f},
|
{3.0f/256.0f, 0.0012877837f, 0.9492662926f},
|
||||||
{2.0f/128.0f, 0.0022515827f, 0.9329321561f},
|
{2.0f/128.0f, 0.0022515827f, 0.9329321561f},
|
||||||
{3.0f/128.0f, 0.0049030350f, 0.9010958535f},
|
{3.0f/128.0f, 0.0049030350f, 0.9010958535f},
|
||||||
{2.0f/64.0f, 0.0084426929f, 0.8703307793f},
|
{2.0f/64.0f, 0.0084426929f, 0.8703307793f},
|
||||||
{3.0f/64.0f, 0.0178631928f, 0.8118317459f},
|
{3.0f/64.0f, 0.0178631928f, 0.8118317459f},
|
||||||
{2.0f/32.0f, 0.0299545822f, 0.7570763753f},
|
{2.0f/32.0f, 0.0299545822f, 0.7570763753f},
|
||||||
{3.0f/32.0f, 0.0604985076f, 0.6574551915f},
|
{3.0f/32.0f, 0.0604985076f, 0.6574551915f},
|
||||||
{2.0f/16.0f, 0.0976310729f, 0.5690355937f},
|
{2.0f/16.0f, 0.0976310729f, 0.5690355937f},
|
||||||
{3.0f/16.0f, 0.1866943331f, 0.4181633458f},
|
{3.0f/16.0f, 0.1866943331f, 0.4181633458f},
|
||||||
{2.0f/8.0f, 0.2928932188f, 0.2928932188f},
|
{2.0f/8.0f, 0.2928932188f, 0.2928932188f},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,8 @@ impd_match_effect_types(ia_drc_config* pstr_drc_config,
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ impd_drc_set_preselection(ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_param
|
||||||
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,
|
||||||
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
WORD32* selection_candidate_count,
|
WORD32* selection_candidate_count,
|
||||||
ia_selection_candidate_info_struct* selection_candidate_info);
|
ia_selection_candidate_info_struct* selection_candidate_info);
|
||||||
|
|
||||||
|
|
@ -152,10 +152,10 @@ WORD32 impd_drc_set_final_selection(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
||||||
WORD32 eq_set_purpose_requested,
|
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,
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ impd_drc_uni_sel_proc_process(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
{
|
{
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = activeDrcSetIndex;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = activeDrcSetIndex;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = -1;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = -1;
|
||||||
return(UNEXPECTED_ERROR);
|
return(UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
|
|
@ -516,52 +516,52 @@ WORD32 impd_match_eq_set(ia_drc_config* drc_config,
|
||||||
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
||||||
WORD32 eq_set_purpose_requested,
|
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 i,j,k;
|
WORD32 i,j,k;
|
||||||
WORD32 match_found_flag;
|
WORD32 match_found_flag;
|
||||||
WORD32 loop_cnt = 0;
|
WORD32 loop_cnt = 0;
|
||||||
ia_eq_instructions_struct* str_eq_instructions = NULL;
|
ia_eq_instructions_struct* str_eq_instructions = NULL;
|
||||||
match_found_flag = 0;
|
match_found_flag = 0;
|
||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
while ((k==0) && (loop_cnt < 2))
|
while ((k==0) && (loop_cnt < 2))
|
||||||
{
|
{
|
||||||
for (j=0; j < *selection_candidate_count; j++)
|
for (j=0; j < *selection_candidate_count; j++)
|
||||||
{
|
{
|
||||||
WORD32 eq_set_id_requested = selection_candidate_info[j].eq_set_id;
|
WORD32 eq_set_id_requested = selection_candidate_info[j].eq_set_id;
|
||||||
|
|
||||||
for (i=0; i<drc_config->str_drc_config_ext.eq_instructions_count; i++)
|
for (i=0; i<drc_config->str_drc_config_ext.eq_instructions_count; i++)
|
||||||
{
|
{
|
||||||
str_eq_instructions = &drc_config->str_drc_config_ext.str_eq_instructions[i];
|
str_eq_instructions = &drc_config->str_drc_config_ext.str_eq_instructions[i];
|
||||||
|
|
||||||
if (str_eq_instructions->depends_on_eq_set_present == 0) {
|
if (str_eq_instructions->depends_on_eq_set_present == 0) {
|
||||||
if (eq_set_id_valid_flag[str_eq_instructions->eq_set_id] == 0) continue;
|
if (eq_set_id_valid_flag[str_eq_instructions->eq_set_id] == 0) continue;
|
||||||
}
|
}
|
||||||
if (eq_set_id_valid_flag[str_eq_instructions->eq_set_id] == 0) continue;
|
if (eq_set_id_valid_flag[str_eq_instructions->eq_set_id] == 0) continue;
|
||||||
if ((str_eq_instructions->eq_set_id == eq_set_id_requested) && (str_eq_instructions->eq_set_purpose & eq_set_purpose_requested))
|
if ((str_eq_instructions->eq_set_id == eq_set_id_requested) && (str_eq_instructions->eq_set_purpose & eq_set_purpose_requested))
|
||||||
{
|
{
|
||||||
match_found_flag = 1;
|
match_found_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_found_flag > 0)
|
if (match_found_flag > 0)
|
||||||
{
|
{
|
||||||
memcpy(&selection_candidate_info_step_2[k], &selection_candidate_info[j], sizeof(ia_selection_candidate_info_struct));
|
memcpy(&selection_candidate_info_step_2[k], &selection_candidate_info[j], sizeof(ia_selection_candidate_info_struct));
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eq_set_purpose_requested = EQ_PURPOSE_DEFAULT;
|
eq_set_purpose_requested = EQ_PURPOSE_DEFAULT;
|
||||||
loop_cnt++;
|
loop_cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k>0) {
|
if (k>0) {
|
||||||
memcpy(&selection_candidate_info[0], &selection_candidate_info_step_2[0], k * sizeof(ia_selection_candidate_info_struct));
|
memcpy(&selection_candidate_info[0], &selection_candidate_info_step_2[0], k * sizeof(ia_selection_candidate_info_struct));
|
||||||
*selection_candidate_count = k;
|
*selection_candidate_count = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
@ -879,11 +879,11 @@ WORD32 impd_manage_complexity (ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
if (gain_set_params->band_count > pstr_drc_sel_proc_params_struct->num_bands_supported)
|
if (gain_set_params->band_count > pstr_drc_sel_proc_params_struct->num_bands_supported)
|
||||||
{
|
{
|
||||||
if (p<2)
|
if (p<2)
|
||||||
{
|
{
|
||||||
numBandsTooLarge = 1;
|
numBandsTooLarge = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pstr_drc_uni_sel_proc->drc_set_id_valid_flag[str_drc_instruction_str->drc_set_id] = 0;
|
pstr_drc_uni_sel_proc->drc_set_id_valid_flag[str_drc_instruction_str->drc_set_id] = 0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.sel_drc_set_ids[p] = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.sel_drc_set_ids[p] = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1020,7 +1020,7 @@ WORD32 impd_manage_complexity (ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (p=2; p<4; p++)
|
for (p=2; p<4; p++)
|
||||||
{
|
{
|
||||||
pstr_drc_uni_sel_proc->drc_set_id_valid_flag[str_drc_instruction_str->drc_set_id] = 0;
|
pstr_drc_uni_sel_proc->drc_set_id_valid_flag[str_drc_instruction_str->drc_set_id] = 0;
|
||||||
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.sel_drc_set_ids[p] = 0;
|
pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.sel_drc_set_ids[p] = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1051,7 +1051,7 @@ WORD32 impd_find_loud_eq_instructions_idx_for_id(ia_drc_config* drc_config,
|
||||||
if (drc_config->str_drc_config_ext.loud_eq_instructions[i].loud_eq_set_id == loud_eq_set_id_requested) break;
|
if (drc_config->str_drc_config_ext.loud_eq_instructions[i].loud_eq_set_id == loud_eq_set_id_requested) break;
|
||||||
}
|
}
|
||||||
if (i == drc_config->str_drc_config_ext.loud_eq_instructions_count)
|
if (i == drc_config->str_drc_config_ext.loud_eq_instructions_count)
|
||||||
{
|
{
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
*instructions_idx = i;
|
*instructions_idx = i;
|
||||||
|
|
@ -1074,7 +1074,7 @@ WORD32 impd_find_eq_instructions(ia_drc_config* drc_config,
|
||||||
if (eq_set_id_requested == drc_config->str_drc_config_ext.str_eq_instructions[i].eq_set_id) break;
|
if (eq_set_id_requested == drc_config->str_drc_config_ext.str_eq_instructions[i].eq_set_id) break;
|
||||||
}
|
}
|
||||||
if (i == drc_config->str_drc_config_ext.eq_instructions_count)
|
if (i == drc_config->str_drc_config_ext.eq_instructions_count)
|
||||||
{
|
{
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
*str_eq_instructions = &drc_config->str_drc_config_ext.str_eq_instructions[i];
|
*str_eq_instructions = &drc_config->str_drc_config_ext.str_eq_instructions[i];
|
||||||
|
|
@ -1091,11 +1091,10 @@ WORD32 impd_find_downmix(ia_drc_config* drc_config,
|
||||||
if (requested_dwnmix_id == drc_config->dwnmix_instructions[i].downmix_id) break;
|
if (requested_dwnmix_id == drc_config->dwnmix_instructions[i].downmix_id) break;
|
||||||
}
|
}
|
||||||
if (i == drc_config->dwnmix_instructions_count)
|
if (i == drc_config->dwnmix_instructions_count)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (UNEXPECTED_ERROR);
|
return (UNEXPECTED_ERROR);
|
||||||
}
|
}
|
||||||
*dwnmix_instructions = &drc_config->dwnmix_instructions[i];
|
*dwnmix_instructions = &drc_config->dwnmix_instructions[i];
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,8 +98,8 @@ typedef struct ia_drc_sel_pro_struct
|
||||||
WORD32 loudness_info_set_flag;
|
WORD32 loudness_info_set_flag;
|
||||||
WORD32 sel_proc_request_flag;
|
WORD32 sel_proc_request_flag;
|
||||||
WORD32 subband_domain_mode;
|
WORD32 subband_domain_mode;
|
||||||
WORD32 eq_inst_index[SUB_EQ_COUNT];
|
WORD32 eq_inst_index[SUB_EQ_COUNT];
|
||||||
WORD32 drc_instructions_index[SUB_DRC_COUNT];
|
WORD32 drc_instructions_index[SUB_DRC_COUNT];
|
||||||
|
|
||||||
ia_drc_sel_proc_params_struct uni_drc_sel_proc_params;
|
ia_drc_sel_proc_params_struct uni_drc_sel_proc_params;
|
||||||
|
|
||||||
|
|
@ -142,12 +142,12 @@ impd_find_downmix(ia_drc_config* drc_config,
|
||||||
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 drc_set_id,
|
||||||
|
|
@ -157,7 +157,7 @@ impd_match_eq_set(ia_drc_config* drc_config,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORD32
|
WORD32
|
||||||
impd_select_loud_eq(ia_drc_config* pstr_drc_config,
|
impd_select_loud_eq(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 requested_dwnmix_id,
|
WORD32 requested_dwnmix_id,
|
||||||
WORD32 drc_set_id_requested,
|
WORD32 drc_set_id_requested,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -41,7 +41,7 @@ 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++) {
|
||||||
|
|
@ -122,12 +122,12 @@ WORD32 impd_shape_filt_block_init(ia_shape_filter_block_params_struct* shape_flt
|
||||||
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 = &shape_flter_block_params->str_lf_cut_params;
|
ia_shape_filter_params_struct* 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_filt_lf_gain_offset_tbl[params->corner_freq_index][params->filter_strength_index];
|
||||||
shape_filter_block->shape_filter[0].y1_bound = shape_filt_lf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
shape_filter_block->shape_filter[0].y1_bound = shape_filt_lf_y1_bound_tbl[params->corner_freq_index][params->filter_strength_index];
|
||||||
|
|
@ -215,7 +215,7 @@ WORD32 impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block
|
||||||
WORD32 start,
|
WORD32 start,
|
||||||
WORD32 end)
|
WORD32 end)
|
||||||
{
|
{
|
||||||
WORD32 i,j, err=0;
|
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){
|
||||||
|
|
@ -261,5 +261,5 @@ WORD32 impd_shape_filt_block_time_process(shape_filter_block* shape_filter_block
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -21,22 +21,22 @@
|
||||||
#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 normal_cross_freq[FILTER_BANK_PARAMETER_COUNT] = {
|
||||||
{2.0f/1024.0f, 0.0000373252f, 0.9913600345f},
|
{2.0f/1024.0f, 0.0000373252f, 0.9913600345f},
|
||||||
{3.0f/1024.0f, 0.0000836207f, 0.9870680830f},
|
{3.0f/1024.0f, 0.0000836207f, 0.9870680830f},
|
||||||
{4.0f/1024.0f, 0.0001480220f, 0.9827947083f},
|
{4.0f/1024.0f, 0.0001480220f, 0.9827947083f},
|
||||||
{5.0f/1024.0f, 0.0002302960f, 0.9785398263f},
|
{5.0f/1024.0f, 0.0002302960f, 0.9785398263f},
|
||||||
{6.0f/1024.0f, 0.0003302134f, 0.9743033527f},
|
{6.0f/1024.0f, 0.0003302134f, 0.9743033527f},
|
||||||
{2.0f/256.0f, 0.0005820761f, 0.9658852897f},
|
{2.0f/256.0f, 0.0005820761f, 0.9658852897f},
|
||||||
{3.0f/256.0f, 0.0012877837f, 0.9492662926f},
|
{3.0f/256.0f, 0.0012877837f, 0.9492662926f},
|
||||||
{2.0f/128.0f, 0.0022515827f, 0.9329321561f},
|
{2.0f/128.0f, 0.0022515827f, 0.9329321561f},
|
||||||
{3.0f/128.0f, 0.0049030350f, 0.9010958535f},
|
{3.0f/128.0f, 0.0049030350f, 0.9010958535f},
|
||||||
{2.0f/64.0f, 0.0084426929f, 0.8703307793f},
|
{2.0f/64.0f, 0.0084426929f, 0.8703307793f},
|
||||||
{3.0f/64.0f, 0.0178631928f, 0.8118317459f},
|
{3.0f/64.0f, 0.0178631928f, 0.8118317459f},
|
||||||
{2.0f/32.0f, 0.0299545822f, 0.7570763753f},
|
{2.0f/32.0f, 0.0299545822f, 0.7570763753f},
|
||||||
{3.0f/32.0f, 0.0604985076f, 0.6574551915f},
|
{3.0f/32.0f, 0.0604985076f, 0.6574551915f},
|
||||||
{2.0f/16.0f, 0.0976310729f, 0.5690355937f},
|
{2.0f/16.0f, 0.0976310729f, 0.5690355937f},
|
||||||
{3.0f/16.0f, 0.1866943331f, 0.4181633458f},
|
{3.0f/16.0f, 0.1866943331f, 0.4181633458f},
|
||||||
{2.0f/8.0f, 0.2928932188f, 0.2928932188f},
|
{2.0f/8.0f, 0.2928932188f, 0.2928932188f},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ WORD32 impd_init_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_stru
|
||||||
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_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_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,
|
UWORD8* bitstream_config,
|
||||||
|
|
@ -38,13 +38,13 @@ WORD32 impd_process_drc_bitstream_dec(ia_drc_bits_dec_struct* p_uni_drc_bs_dec_s
|
||||||
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_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_config* pstr_drc_config,
|
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_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_config* pstr_drc_config,
|
ia_drc_config* pstr_drc_config,
|
||||||
ia_drc_gain_struct* pstr_drc_gain,
|
ia_drc_gain_struct* pstr_drc_gain,
|
||||||
UWORD8* bitstream_gain,
|
UWORD8* bitstream_gain,
|
||||||
|
|
@ -53,7 +53,7 @@ WORD32 impd_process_drc_bitstream_dec_gain(ia_drc_bits_dec_struct* p_uni_drc_bs_
|
||||||
WORD32* num_bits_read);
|
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
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ impd_parse_dwnmix_instructions(ia_bit_buf_struct* it_bit_buff,
|
||||||
|
|
||||||
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
|
||||||
);
|
);
|
||||||
|
|
@ -88,7 +88,7 @@ impd_parse_loudness_info_set(ia_bit_buf_struct* it_bit_buff,
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -98,7 +98,7 @@ 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);
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ impd_match_effect_types(ia_drc_config* pstr_drc_config,
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
@ -128,10 +128,10 @@ WORD32 impd_drc_set_final_selection(ia_drc_config* pstr_drc_config,
|
||||||
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
WORD32 impd_match_eq_set_purpose(ia_drc_config* drc_config,
|
||||||
WORD32 eq_set_purpose_requested,
|
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,
|
||||||
|
|
|
||||||
|
|
@ -34,25 +34,25 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Constant hash defines */
|
/* Constant hash defines */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
#define IA_ERROR_NON_FATAL_IDX 0x0
|
#define IA_ERROR_NON_FATAL_IDX 0x0
|
||||||
#define IA_ERROR_FATAL_IDX 0x1
|
#define IA_ERROR_FATAL_IDX 0x1
|
||||||
|
|
||||||
#define IA_ERROR_CLASS_0 0x0
|
#define IA_ERROR_CLASS_0 0x0
|
||||||
#define IA_ERROR_CLASS_1 0x1
|
#define IA_ERROR_CLASS_1 0x1
|
||||||
#define IA_ERROR_CLASS_2 0x2
|
#define IA_ERROR_CLASS_2 0x2
|
||||||
#define IA_ERROR_CLASS_3 0x3
|
#define IA_ERROR_CLASS_3 0x3
|
||||||
#define IA_ERROR_CLASS_4 0x4
|
#define IA_ERROR_CLASS_4 0x4
|
||||||
#define IA_ERROR_CLASS_5 0x5
|
#define IA_ERROR_CLASS_5 0x5
|
||||||
#define IA_ERROR_CLASS_6 0x6
|
#define IA_ERROR_CLASS_6 0x6
|
||||||
#define IA_ERROR_CLASS_7 0x7
|
#define IA_ERROR_CLASS_7 0x7
|
||||||
#define IA_ERROR_CLASS_8 0x8
|
#define IA_ERROR_CLASS_8 0x8
|
||||||
#define IA_ERROR_CLASS_9 0x9
|
#define IA_ERROR_CLASS_9 0x9
|
||||||
#define IA_ERROR_CLASS_A 0xA
|
#define IA_ERROR_CLASS_A 0xA
|
||||||
#define IA_ERROR_CLASS_B 0xB
|
#define IA_ERROR_CLASS_B 0xB
|
||||||
#define IA_ERROR_CLASS_C 0xC
|
#define IA_ERROR_CLASS_C 0xC
|
||||||
#define IA_ERROR_CLASS_D 0xD
|
#define IA_ERROR_CLASS_D 0xD
|
||||||
#define IA_ERROR_CLASS_E 0xE
|
#define IA_ERROR_CLASS_E 0xE
|
||||||
#define IA_ERROR_CLASS_F 0xF
|
#define IA_ERROR_CLASS_F 0xF
|
||||||
|
|
||||||
/* each module, hence, needs to copy the following structure */
|
/* each module, hence, needs to copy the following structure */
|
||||||
/* the first index is for FATAL/NONFATAL */
|
/* the first index is for FATAL/NONFATAL */
|
||||||
|
|
@ -65,9 +65,9 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
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];
|
||||||
} ia_error_info_struct;
|
} ia_error_info_struct;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
@ -76,7 +76,7 @@ typedef struct
|
||||||
/* this error handler maps the code generated by a module to a error string */
|
/* this error handler maps the code generated by a module to a error string */
|
||||||
/* pb_context is a string to specify where the module broke */
|
/* pb_context is a string to specify where the module broke */
|
||||||
IA_ERRORCODE ia_error_handler(ia_error_info_struct *p_mod_err_info,
|
IA_ERRORCODE ia_error_handler(ia_error_info_struct *p_mod_err_info,
|
||||||
WORD8 *pb_context, IA_ERRORCODE code);
|
WORD8 *pb_context, IA_ERRORCODE code);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Macro functions */
|
/* Macro functions */
|
||||||
|
|
@ -84,11 +84,11 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ typedef WORD32 IA_ERRORCODE;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Constant hash defines */
|
/* Constant hash defines */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
#define IA_NO_ERROR 0x00000000
|
#define IA_NO_ERROR 0x00000000
|
||||||
/* error handling 'AND' definition */
|
/* error handling 'AND' definition */
|
||||||
#define IA_FATAL_ERROR 0x80000000
|
#define IA_FATAL_ERROR 0x80000000
|
||||||
|
|
||||||
#endif /* __IMPD_ERROR_STANDARDS_H__ */
|
#endif /* __IMPD_ERROR_STANDARDS_H__ */
|
||||||
|
|
|
||||||
|
|
@ -27,83 +27,83 @@
|
||||||
/* 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 */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* when you don't need alignment, pass this to memory library */
|
/* when you don't need alignment, pass this to memory library */
|
||||||
#define IA_MEM_NO_ALIGN 0x01
|
#define IA_MEM_NO_ALIGN 0x01
|
||||||
|
|
||||||
/* ittiam standard memory types */
|
/* ittiam standard memory types */
|
||||||
/* to be used inter frames */
|
/* to be used inter frames */
|
||||||
#define IA_MEMTYPE_PERSIST 0x00
|
#define IA_MEMTYPE_PERSIST 0x00
|
||||||
/* read write, to be used intra frames */
|
/* read write, to be used intra frames */
|
||||||
#define IA_MEMTYPE_SCRATCH 0x01
|
#define IA_MEMTYPE_SCRATCH 0x01
|
||||||
/* read only memory, intra frame */
|
/* read only memory, intra frame */
|
||||||
#define IA_MEMTYPE_INPUT 0x02
|
#define IA_MEMTYPE_INPUT 0x02
|
||||||
/* read-write memory, for usable output, intra frame */
|
/* read-write memory, for usable output, intra frame */
|
||||||
#define IA_MEMTYPE_OUTPUT 0x03
|
#define IA_MEMTYPE_OUTPUT 0x03
|
||||||
/* readonly memory, inter frame */
|
/* readonly memory, inter frame */
|
||||||
#define IA_MEMTYPE_TABLE 0x04
|
#define IA_MEMTYPE_TABLE 0x04
|
||||||
/* input buffer before mem tabs allocation */
|
/* input buffer before mem tabs allocation */
|
||||||
#define IA_MEMTYPE_PRE_FRAME_INPUT 0x05
|
#define IA_MEMTYPE_PRE_FRAME_INPUT 0x05
|
||||||
/* input buffer before mem tabs allocation */
|
/* input buffer before mem tabs allocation */
|
||||||
#define IA_MEMTYPE_PRE_FRAME_SCRATCH 0x06
|
#define IA_MEMTYPE_PRE_FRAME_SCRATCH 0x06
|
||||||
/* for local variables */
|
/* for local variables */
|
||||||
#define IA_MEMTYPE_AUTO_VAR 0x80
|
#define IA_MEMTYPE_AUTO_VAR 0x80
|
||||||
|
|
||||||
/* ittiam standard memory priorities */
|
/* ittiam standard memory priorities */
|
||||||
#define IA_MEMPRIORITY_ANYWHERE 0x00
|
#define IA_MEMPRIORITY_ANYWHERE 0x00
|
||||||
#define IA_MEMPRIORITY_LOWEST 0x01
|
#define IA_MEMPRIORITY_LOWEST 0x01
|
||||||
#define IA_MEMPRIORITY_LOW 0x02
|
#define IA_MEMPRIORITY_LOW 0x02
|
||||||
#define IA_MEMPRIORITY_NORM 0x03
|
#define IA_MEMPRIORITY_NORM 0x03
|
||||||
#define IA_MEMPRIORITY_ABOVE_NORM 0x04
|
#define IA_MEMPRIORITY_ABOVE_NORM 0x04
|
||||||
#define IA_MEMPRIORITY_HIGH 0x05
|
#define IA_MEMPRIORITY_HIGH 0x05
|
||||||
#define IA_MEMPRIORITY_HIGHER 0x06
|
#define IA_MEMPRIORITY_HIGHER 0x06
|
||||||
#define IA_MEMPRIORITY_CRITICAL 0x07
|
#define IA_MEMPRIORITY_CRITICAL 0x07
|
||||||
|
|
||||||
/* ittiam standard memory placements */
|
/* ittiam standard memory placements */
|
||||||
/* placement is defined by 64 bits */
|
/* placement is defined by 64 bits */
|
||||||
|
|
||||||
#define IA_MEMPLACE_FAST_RAM_0 0x000001
|
#define IA_MEMPLACE_FAST_RAM_0 0x000001
|
||||||
#define IA_MEMPLACE_FAST_RAM_1 0x000002
|
#define IA_MEMPLACE_FAST_RAM_1 0x000002
|
||||||
#define IA_MEMPLACE_FAST_RAM_2 0x000004
|
#define IA_MEMPLACE_FAST_RAM_2 0x000004
|
||||||
#define IA_MEMPLACE_FAST_RAM_3 0x000008
|
#define IA_MEMPLACE_FAST_RAM_3 0x000008
|
||||||
#define IA_MEMPLACE_FAST_RAM_4 0x000010
|
#define IA_MEMPLACE_FAST_RAM_4 0x000010
|
||||||
#define IA_MEMPLACE_FAST_RAM_5 0x000020
|
#define IA_MEMPLACE_FAST_RAM_5 0x000020
|
||||||
#define IA_MEMPLACE_FAST_RAM_6 0x000040
|
#define IA_MEMPLACE_FAST_RAM_6 0x000040
|
||||||
#define IA_MEMPLACE_FAST_RAM_7 0x000080
|
#define IA_MEMPLACE_FAST_RAM_7 0x000080
|
||||||
|
|
||||||
#define IA_MEMPLACE_INT_RAM_0 0x000100
|
#define IA_MEMPLACE_INT_RAM_0 0x000100
|
||||||
#define IA_MEMPLACE_INT_RAM_1 0x000200
|
#define IA_MEMPLACE_INT_RAM_1 0x000200
|
||||||
#define IA_MEMPLACE_INT_RAM_2 0x000400
|
#define IA_MEMPLACE_INT_RAM_2 0x000400
|
||||||
#define IA_MEMPLACE_INT_RAM_3 0x000800
|
#define IA_MEMPLACE_INT_RAM_3 0x000800
|
||||||
#define IA_MEMPLACE_INT_RAM_4 0x001000
|
#define IA_MEMPLACE_INT_RAM_4 0x001000
|
||||||
#define IA_MEMPLACE_INT_RAM_5 0x002000
|
#define IA_MEMPLACE_INT_RAM_5 0x002000
|
||||||
#define IA_MEMPLACE_INT_RAM_6 0x004000
|
#define IA_MEMPLACE_INT_RAM_6 0x004000
|
||||||
#define IA_MEMPLACE_INT_RAM_7 0x008000
|
#define IA_MEMPLACE_INT_RAM_7 0x008000
|
||||||
|
|
||||||
#define IA_MEMPLACE_EXT_RAM_0 0x010000
|
#define IA_MEMPLACE_EXT_RAM_0 0x010000
|
||||||
#define IA_MEMPLACE_EXT_RAM_1 0x020000
|
#define IA_MEMPLACE_EXT_RAM_1 0x020000
|
||||||
#define IA_MEMPLACE_EXT_RAM_2 0x040000
|
#define IA_MEMPLACE_EXT_RAM_2 0x040000
|
||||||
#define IA_MEMPLACE_EXT_RAM_3 0x080000
|
#define IA_MEMPLACE_EXT_RAM_3 0x080000
|
||||||
#define IA_MEMPLACE_EXT_RAM_4 0x100000
|
#define IA_MEMPLACE_EXT_RAM_4 0x100000
|
||||||
#define IA_MEMPLACE_EXT_RAM_5 0x200000
|
#define IA_MEMPLACE_EXT_RAM_5 0x200000
|
||||||
#define IA_MEMPLACE_EXT_RAM_6 0x400000
|
#define IA_MEMPLACE_EXT_RAM_6 0x400000
|
||||||
#define IA_MEMPLACE_EXT_RAM_7 0x800000
|
#define IA_MEMPLACE_EXT_RAM_7 0x800000
|
||||||
|
|
||||||
#define IA_MEMPLACE_DONTCARE_H 0xFFFFFFFF
|
#define IA_MEMPLACE_DONTCARE_H 0xFFFFFFFF
|
||||||
#define IA_MEMPLACE_DONTCARE_L 0xFFFFFFFF
|
#define IA_MEMPLACE_DONTCARE_L 0xFFFFFFFF
|
||||||
|
|
||||||
/* the simple common PC RAM */
|
/* the simple common PC RAM */
|
||||||
#define IA_PC_RAM_H 0x00000000
|
#define IA_PC_RAM_H 0x00000000
|
||||||
#define IA_PC_RAM_L IA_MEMPLACE_EXT_RAM_0
|
#define IA_PC_RAM_L IA_MEMPLACE_EXT_RAM_0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ WORD32 impd_init_parametric_drc( WORD32 drc_frame_size,
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#define IMPD_TYPE_DEF_H
|
#define IMPD_TYPE_DEF_H
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* 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 */
|
||||||
|
|
@ -30,78 +30,78 @@ 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 FLOAT32 ;/* f FLOAT32 f_count 4 */
|
||||||
typedef float * pFLOAT32;/* pf pFLOAT32 pf_count 4 */
|
typedef float * pFLOAT32;/* pf pFLOAT32 pf_count 4 */
|
||||||
typedef double FLOAT64 ;/* d UFLOAT64 d_count 8 */
|
typedef double FLOAT64 ;/* d UFLOAT64 d_count 8 */
|
||||||
typedef double * pFlOAT64;/* pd pFLOAT64 pd_count 8 */
|
typedef double * pFlOAT64;/* pd pFLOAT64 pd_count 8 */
|
||||||
|
|
||||||
typedef void VOID ;/* v VOID v_flag 4 */
|
typedef void VOID ;/* v VOID v_flag 4 */
|
||||||
typedef void * pVOID ;/* pv pVOID pv_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 */
|
||||||
|
|
|
||||||
|
|
@ -26,35 +26,39 @@
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK 0x0003
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK 0x0003
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE 0x0004
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE 0x0004
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE 0x0005
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE 0x0005
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE 0x0006
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS 0x0007
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_LOUD_NORM 0x0008
|
||||||
|
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX 0x0006
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX 0x0009
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_OUT08KHZ 0x0007
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_OUT08KHZ 0x000A
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_OUT16KHZ 0x0008
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_OUT16KHZ 0x000B
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO 0x0009
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO 0x000C
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE 0x000A
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE 0x000D
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMEOK 0x000B
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMEOK 0x000E
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 0x000C
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 0x000F
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL 0x000D
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL 0x0010
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL 0x000E
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL 0x0011
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO 0x000F
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO 0x0012
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DISABLE_SYNC 0x0010
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DISABLE_SYNC 0x0013
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE 0x0011
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE 0x0014
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISLOAS 0x0012
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISLOAS 0x0015
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_ENABLE 0x0013
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_ENABLE 0x0016
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT 0x0014
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT 0x0017
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST 0x0015
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST 0x0018
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL 0x0016
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL 0x0019
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP 0x0017
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP 0x001A
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE 0x0018
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE 0x001B
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT 0x0019
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT 0x001C
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING 0x001D
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
#define IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR 0x001E
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR 0x001A
|
#define IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_BUF_SIZES 0x001F
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_BUF_SIZES 0x001B
|
#define IA_ENHAACPLUS_DEC_CONFIG_NUM_ELE 0x0020
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NUM_ELE 0x001C
|
#define IA_ENHAACPLUS_DEC_CONFIG_NUM_CONFIG_EXT 0x0021
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NUM_CONFIG_EXT 0x001D
|
#define IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_LEN 0x0022
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_LEN 0x001E
|
#define IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_BUF 0x0023
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_BUF 0x001F
|
#define IA_ENHAACPLUS_DEC_DRC_EFFECT_TYPE 0x0024
|
||||||
#endif
|
#define IA_ENHAACPLUS_DEC_DRC_TARGET_LOUDNESS 0x0025
|
||||||
|
|
||||||
#endif /* IXHEAACD_AAC_CONFIG_H */
|
#endif /* IXHEAACD_AAC_CONFIG_H */
|
||||||
|
|
|
||||||
|
|
@ -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 += (1 << (b - 1));
|
a = ixheaacd_add32_sat(a,(1 << (b - 1)));
|
||||||
out_val = (WORD32)a >> b;
|
out_val = (WORD32)a >> b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -786,327 +786,6 @@ VOID ixheaacd_post_twid_overlap_add_dec(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_post_twid_overlap_add_armv8(
|
|
||||||
WORD16 pcm_out[], WORD32 spec_data[],
|
|
||||||
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints,
|
|
||||||
WORD32 *ptr_overlap_buf, WORD16 q_shift, const WORD16 *window,
|
|
||||||
WORD16 ch_fac) {
|
|
||||||
WORD i;
|
|
||||||
WORD16 cos, cos1, sin, sin1;
|
|
||||||
WORD32 size = npoints / 2;
|
|
||||||
WORD16 *pcmout1 = pcm_out + (ch_fac * size);
|
|
||||||
const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_2048_256p;
|
|
||||||
|
|
||||||
pcm_out = pcmout1 - ch_fac;
|
|
||||||
spec_data += size;
|
|
||||||
|
|
||||||
if (q_shift > 0) {
|
|
||||||
WORD32 tempr, tempi, outr, outi, win1, accu, temp1, temp2;
|
|
||||||
WORD16 adjust, adjust1;
|
|
||||||
WORD32 overlap_data;
|
|
||||||
|
|
||||||
tempr = *(spec_data - size);
|
|
||||||
tempi = *(spec_data - size + 1);
|
|
||||||
adjust = 50;
|
|
||||||
adjust1 = -50;
|
|
||||||
cos = *cos_sin_ptr++;
|
|
||||||
sin = *cos_sin_ptr++;
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin));
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin));
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust1);
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outr, 16 - q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + size - 1);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(ixheaacd_mult32x16lin32(outi, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outi), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1)));
|
|
||||||
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
|
|
||||||
for (i = size - 2; i != 0;) {
|
|
||||||
sin = *cos_sin_ptr++;
|
|
||||||
cos = *cos_sin_ptr++;
|
|
||||||
|
|
||||||
tempr = *(spec_data + i);
|
|
||||||
tempi = *(spec_data + i + 1);
|
|
||||||
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin));
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin));
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = -1 * temp1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outi, 16 - q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(ixheaacd_mult32x16lin32(outr, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outr), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)win1));
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
|
|
||||||
tempr = *(spec_data - i);
|
|
||||||
tempi = *(spec_data - i + 1);
|
|
||||||
|
|
||||||
i -= 2;
|
|
||||||
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, sin),
|
|
||||||
ixheaacd_mult32x16in32(tempr, cos));
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, sin),
|
|
||||||
ixheaacd_mult32x16in32(tempi, cos));
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = temp1 * -1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outr, 16 - q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i + 1);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(ixheaacd_mult32x16lin32(outi, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outi), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1)));
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
}
|
|
||||||
cos1 = *cos_sin_ptr++;
|
|
||||||
sin1 = *cos_sin_ptr;
|
|
||||||
|
|
||||||
tempr = *(spec_data + i);
|
|
||||||
tempi = *(spec_data + i + 1);
|
|
||||||
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos1),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin1));
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos1),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin1));
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = -1 * temp1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outi, 16 - q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(ixheaacd_mult32x16lin32(outr, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shl32_sat(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outr), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)win1));
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
} else {
|
|
||||||
q_shift = -q_shift;
|
|
||||||
{
|
|
||||||
WORD32 tempr, tempi, temp1, temp2, outr, outi, win1, accu;
|
|
||||||
WORD16 adjust, adjust1;
|
|
||||||
WORD16 overlap_data;
|
|
||||||
tempr = *(spec_data - size);
|
|
||||||
tempi = *(spec_data - size + 1);
|
|
||||||
|
|
||||||
adjust = 50;
|
|
||||||
adjust1 = -50;
|
|
||||||
cos = *cos_sin_ptr++;
|
|
||||||
sin = *cos_sin_ptr++;
|
|
||||||
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin));
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin));
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust1);
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outr, 16 + q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + size - 1);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(ixheaacd_mult32x16lin32(outi, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outi), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1)));
|
|
||||||
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
|
|
||||||
for (i = size - 2; i != 0;) {
|
|
||||||
sin = *cos_sin_ptr++;
|
|
||||||
cos = *cos_sin_ptr++;
|
|
||||||
|
|
||||||
tempr = *(spec_data + i);
|
|
||||||
tempi = *(spec_data + i + 1);
|
|
||||||
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin));
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin));
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = -1 * temp1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outi, 16 + q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(ixheaacd_mult32x16lin32(outr, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outr), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)win1));
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
|
|
||||||
tempr = *(spec_data - i);
|
|
||||||
tempi = *(spec_data - i + 1);
|
|
||||||
i -= 2;
|
|
||||||
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, sin),
|
|
||||||
ixheaacd_mult32x16in32(tempr, cos));
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, sin),
|
|
||||||
ixheaacd_mult32x16in32(tempi, cos));
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = -1 * temp1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outr, 16 + q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i + 1);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(ixheaacd_mult32x16lin32(outi, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outi), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1)));
|
|
||||||
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
}
|
|
||||||
cos1 = *cos_sin_ptr++;
|
|
||||||
sin1 = *cos_sin_ptr++;
|
|
||||||
|
|
||||||
tempr = *(spec_data + i);
|
|
||||||
tempi = *(spec_data + i + 1);
|
|
||||||
|
|
||||||
outr = -1 * ixheaacd_add32(ixheaacd_mult32x16in32(tempr, cos1),
|
|
||||||
ixheaacd_mult32x16in32(tempi, sin1));
|
|
||||||
outi = ixheaacd_sub32(ixheaacd_mult32x16in32(tempi, cos1),
|
|
||||||
ixheaacd_mult32x16in32(tempr, sin1));
|
|
||||||
|
|
||||||
overlap_data = *ptr_overlap_buf;
|
|
||||||
|
|
||||||
temp1 = ixheaacd_mult32x16in32(outi, adjust);
|
|
||||||
temp1 = -1 * temp1;
|
|
||||||
temp2 = ixheaacd_mult32x16in32(outr, adjust);
|
|
||||||
|
|
||||||
outr = outr + temp1;
|
|
||||||
outi = outi + temp2;
|
|
||||||
|
|
||||||
*ptr_overlap_buf++ = ixheaacd_shr32_drc(outi, 16 + q_shift);
|
|
||||||
|
|
||||||
win1 = *((WORD32 *)window + i);
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(ixheaacd_mult32x16lin32(outr, win1), q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)(win1 >> 16)));
|
|
||||||
|
|
||||||
*pcm_out = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcm_out -= ch_fac;
|
|
||||||
accu = ixheaacd_sub32_sat(
|
|
||||||
ixheaacd_shr32(
|
|
||||||
ixheaacd_mult32x16hin32_drc(ixheaacd_negate32(outr), win1),
|
|
||||||
q_shift),
|
|
||||||
ixheaacd_mult32x16lin32_drc(overlap_data, (WORD16)win1));
|
|
||||||
*pcmout1 = ixheaacd_round16(ixheaacd_shl32_sat(accu, 2));
|
|
||||||
pcmout1 += ch_fac;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ixheaacd_imdct_using_fft_dec(
|
VOID ixheaacd_imdct_using_fft_dec(
|
||||||
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 npoints,
|
ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 npoints,
|
||||||
WORD32 *ptr_x, WORD32 *ptr_y)
|
WORD32 *ptr_x, WORD32 *ptr_y)
|
||||||
|
|
@ -2025,13 +1704,17 @@ VOID ixheaacd_fft_480_ld(WORD32 *inp, WORD32 *op,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLATFORM_INLINE VOID ixheaacd_pre_twiddle_compute_ld(
|
VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
|
||||||
WORD32 *in_ptr1, WORD32 *in_ptr2, WORD32 *xptr, WORD32 *cos_sin_ptr,
|
WORD32 *cos_sin_ptr, WORD32 neg_expo) {
|
||||||
WORD npoints_4, WORD32 neg_expo) {
|
WORD npoints_4, i;
|
||||||
WORD32 i;
|
|
||||||
WORD32 tempr, tempi, temp;
|
WORD32 tempr, tempi, temp;
|
||||||
|
|
||||||
WORD32 c, c1, s, s1;
|
WORD32 c, c1, s, s1;
|
||||||
|
WORD32 *in_ptr1, *in_ptr2;
|
||||||
|
|
||||||
|
npoints_4 = n >> 2;
|
||||||
|
|
||||||
|
in_ptr1 = data;
|
||||||
|
in_ptr2 = data + n - 1;
|
||||||
|
|
||||||
if (neg_expo >= 0) {
|
if (neg_expo >= 0) {
|
||||||
for (i = npoints_4 - 1; i >= 0; i--) {
|
for (i = npoints_4 - 1; i >= 0; i--) {
|
||||||
|
|
@ -2108,20 +1791,6 @@ static PLATFORM_INLINE VOID ixheaacd_pre_twiddle_compute_ld(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
|
|
||||||
WORD32 *cos_array_ptr, WORD32 neg_expo) {
|
|
||||||
WORD npoints_4;
|
|
||||||
WORD32 *in_ptr1, *in_ptr2;
|
|
||||||
|
|
||||||
npoints_4 = n >> 2;
|
|
||||||
|
|
||||||
in_ptr1 = data;
|
|
||||||
in_ptr2 = data + n - 1;
|
|
||||||
|
|
||||||
ixheaacd_pre_twiddle_compute_ld(in_ptr1, in_ptr2, xptr, cos_array_ptr,
|
|
||||||
npoints_4, neg_expo);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ixheaacd_post_twiddle_ld(WORD32 out[], WORD32 x[],
|
VOID ixheaacd_post_twiddle_ld(WORD32 out[], WORD32 x[],
|
||||||
const WORD32 *cos_sin_ptr, WORD m) {
|
const WORD32 *cos_sin_ptr, WORD m) {
|
||||||
WORD i;
|
WORD i;
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ VOID ixheaacd_tns_ar_filter_fixed_dec(WORD32 *spectrum, WORD32 size, WORD32 inc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_tns_ar_filter_fixed_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 order,
|
||||||
WORD32 shift_value, WORD scale_spec) {
|
WORD32 shift_value, WORD scale_spec) {
|
||||||
WORD32 i, j;
|
WORD32 i, j;
|
||||||
|
|
|
||||||
|
|
@ -647,10 +647,10 @@ 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,7 +706,8 @@ 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) || (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;
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ IA_ERRORCODE ixheaacd_dec_mem_api(
|
||||||
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 = p_temp + sizeof(ia_dec_data_struct)
|
||||||
+ sizeof(ia_audio_specific_config_struct);
|
+ sizeof(ia_audio_specific_config_struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -315,10 +315,9 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
WORD32 i_idx, pVOID pv_value) {
|
WORD32 i_idx, pVOID pv_value) {
|
||||||
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec = p_ia_enhaacplus_dec_obj;
|
ia_exhaacplus_dec_api_struct *p_obj_exhaacplus_dec = p_ia_enhaacplus_dec_obj;
|
||||||
pUWORD32 pui_value = pv_value;
|
pUWORD32 pui_value = pv_value;
|
||||||
|
pWORD32 pui_value_signed = pv_value;
|
||||||
pWORD8 pb_value = pv_value;
|
pWORD8 pb_value = pv_value;
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
pVOID *pp_value = (pVOID *)pv_value;
|
pVOID *pp_value = (pVOID *)pv_value;
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((i_cmd != IA_API_CMD_GET_API_SIZE) &&
|
if ((i_cmd != IA_API_CMD_GET_API_SIZE) &&
|
||||||
(i_cmd != IA_API_CMD_GET_LIB_ID_STRINGS)) {
|
(i_cmd != IA_API_CMD_GET_LIB_ID_STRINGS)) {
|
||||||
|
|
@ -393,9 +392,12 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_samp_freq = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_samp_freq = 0;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_channel_mode = 3;
|
p_obj_exhaacplus_dec->aac_config.ui_channel_mode = 3;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_sbr_mode = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_sbr_mode = 0;
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_effect_type = 0;
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = -24;
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_loud_norm_flag = 0;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_pce_found_in_hdr = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_pce_found_in_hdr = 0;
|
||||||
p_obj_exhaacplus_dec->aac_config.loas_present = 0;
|
p_obj_exhaacplus_dec->aac_config.loas_present = 0;
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ld_decoder = 0;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_drc_enable = 1;
|
p_obj_exhaacplus_dec->aac_config.ui_drc_enable = 1;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_drc_boost = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_drc_boost = 0;
|
||||||
p_obj_exhaacplus_dec->aac_config.ui_drc_cut = 0;
|
p_obj_exhaacplus_dec->aac_config.ui_drc_cut = 0;
|
||||||
|
|
@ -623,6 +625,17 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING: {
|
||||||
|
if (*pui_value == 1) {
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ld_decoder = 1;
|
||||||
|
} else if (*pui_value == 0) {
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ld_decoder = 0;
|
||||||
|
} else {
|
||||||
|
return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT: {
|
case IA_ENHAACPLUS_DEC_CONFIG_PARAM_ELD_SBR_PRESENT: {
|
||||||
if (*pui_value == 1) {
|
if (*pui_value == 1) {
|
||||||
p_obj_exhaacplus_dec->aac_config.eld_sbr_present = 1;
|
p_obj_exhaacplus_dec->aac_config.eld_sbr_present = 1;
|
||||||
|
|
@ -651,22 +664,40 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case IA_ENHAACPLUS_DEC_DRC_EFFECT_TYPE: {
|
||||||
|
if (((*pui_value_signed) > 8) || ((*pui_value_signed) < -1) ) {
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_effect_type = -1;
|
||||||
|
return (IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE);
|
||||||
|
}
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_effect_type = *pui_value_signed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case IA_ENHAACPLUS_DEC_DRC_TARGET_LOUDNESS: {
|
||||||
|
if(*pui_value_signed>=0)
|
||||||
|
{
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_loud_norm_flag=1;
|
||||||
|
}
|
||||||
|
*pui_value_signed = -(*pui_value_signed >> 2);
|
||||||
|
if (((*pui_value_signed) > 0) ||((*pui_value_signed) < -63)) {
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = 0;
|
||||||
|
return (IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS);
|
||||||
|
}
|
||||||
|
p_obj_exhaacplus_dec->aac_config.ui_target_loudness = *pui_value_signed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: { return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM; }
|
default: { return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM; }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA_API_CMD_GET_CONFIG_PARAM: {
|
case IA_API_CMD_GET_CONFIG_PARAM: {
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
UWORD32 i;
|
UWORD32 i;
|
||||||
#endif
|
|
||||||
WORD32 *pvalue =
|
WORD32 *pvalue =
|
||||||
(WORD32 *)(&p_obj_exhaacplus_dec->aac_config.ui_pcm_wdsz);
|
(WORD32 *)(&p_obj_exhaacplus_dec->aac_config.ui_pcm_wdsz);
|
||||||
|
|
||||||
if (i_idx >= 0 && i_idx <= 5) {
|
if (i_idx >= 0 && i_idx <= 8) {
|
||||||
*pui_value = pvalue[i_idx];
|
*pui_value = pvalue[i_idx];
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
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 *)
|
||||||
|
|
@ -737,7 +768,6 @@ IA_ERRORCODE ixheaacd_dec_api(pVOID p_ia_enhaacplus_dec_obj, WORD32 i_cmd,
|
||||||
*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;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else {
|
else {
|
||||||
return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM;
|
return IA_ENHAACPLUS_DEC_API_FATAL_INVALID_CONFIG_PARAM;
|
||||||
}
|
}
|
||||||
|
|
@ -890,7 +920,7 @@ IA_ERRORCODE ixheaacd_decoder_flush_api(
|
||||||
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 = p_temp + sizeof(ia_dec_data_struct)
|
||||||
+ sizeof(ia_audio_specific_config_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));
|
||||||
|
|
@ -1065,7 +1095,7 @@ IA_ERRORCODE ixheaacd_fill_aac_mem_tables(
|
||||||
|
|
||||||
p_mem_info_aac->ui_size += sizeof(ia_dec_data_struct);
|
p_mem_info_aac->ui_size += sizeof(ia_dec_data_struct);
|
||||||
p_mem_info_aac->ui_size += sizeof(ia_audio_specific_config_struct);
|
p_mem_info_aac->ui_size += sizeof(ia_audio_specific_config_struct);
|
||||||
p_mem_info_aac->ui_size += 8300;
|
p_mem_info_aac->ui_size += 8300;
|
||||||
|
|
||||||
p_mem_info_aac->ui_alignment = 8;
|
p_mem_info_aac->ui_alignment = 8;
|
||||||
p_mem_info_aac->ui_type = IA_MEMTYPE_PERSIST;
|
p_mem_info_aac->ui_type = IA_MEMTYPE_PERSIST;
|
||||||
|
|
@ -1466,12 +1496,14 @@ 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_obj_exhaacplus_dec->aac_config.ld_decoder == 1)
|
||||||
|
p_state_enhaacplus_dec->audio_object_type = 23;
|
||||||
|
}
|
||||||
|
|
||||||
if ((p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD) ||
|
if ((p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD) ||
|
||||||
(p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_LD))
|
(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) {
|
||||||
if (p_obj_exhaacplus_dec->aac_config.ld_decoder == 1)
|
|
||||||
p_state_enhaacplus_dec->audio_object_type = 23;
|
|
||||||
|
|
||||||
if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD) {
|
if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD) {
|
||||||
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_samp_rate = 1;
|
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_samp_rate = 1;
|
||||||
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_crc_flag = 0;
|
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_crc_flag = 0;
|
||||||
|
|
@ -1790,6 +1822,7 @@ IA_ERRORCODE ixheaacd_dec_init(
|
||||||
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
|
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
|
||||||
p_state_enhaacplus_dec->audio_object_type) != SBRDEC_OK) {
|
p_state_enhaacplus_dec->audio_object_type) != SBRDEC_OK) {
|
||||||
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
|
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if (!p_obj_exhaacplus_dec->aac_config.down_sample_flag) {
|
if (!p_obj_exhaacplus_dec->aac_config.down_sample_flag) {
|
||||||
sample_rate_1 *= 2;
|
sample_rate_1 *= 2;
|
||||||
|
|
@ -2306,6 +2339,11 @@ 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->s_adts_hdr_present)
|
||||||
|
p_state_enhaacplus_dec->frame_size = adts.aac_frame_length;
|
||||||
|
}
|
||||||
|
|
||||||
if (p_state_enhaacplus_dec->pstr_drc_dec) {
|
if (p_state_enhaacplus_dec->pstr_drc_dec) {
|
||||||
p_state_enhaacplus_dec->pstr_drc_dec->num_drc_elements = 0;
|
p_state_enhaacplus_dec->pstr_drc_dec->num_drc_elements = 0;
|
||||||
|
|
||||||
|
|
@ -2502,6 +2540,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
|
||||||
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
|
p_state_enhaacplus_dec->eld_specific_config.ld_sbr_flag_present,
|
||||||
p_state_enhaacplus_dec->audio_object_type) != SBRDEC_OK) {
|
p_state_enhaacplus_dec->audio_object_type) != SBRDEC_OK) {
|
||||||
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
|
p_state_enhaacplus_dec->str_sbr_dec_info[ch_idx] = 0;
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if (!p_obj_exhaacplus_dec->aac_config.down_sample_flag) {
|
if (!p_obj_exhaacplus_dec->aac_config.down_sample_flag) {
|
||||||
frame_size = (WORD16)(frame_size * 2);
|
frame_size = (WORD16)(frame_size * 2);
|
||||||
|
|
|
||||||
|
|
@ -1815,6 +1815,10 @@ 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)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (m < ARITH_ESCAPE) {
|
if (m < ARITH_ESCAPE) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -1826,6 +1830,9 @@ WORD32 ixheaacd_arth_decoding_level2(ia_bit_buf_struct *it_bit_buff,
|
||||||
if (esc_nb > 7) {
|
if (esc_nb > 7) {
|
||||||
esc_nb = 7;
|
esc_nb = 7;
|
||||||
}
|
}
|
||||||
|
if (esc_nb < 0) {
|
||||||
|
esc_nb = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m == 0) {
|
if (m == 0) {
|
||||||
|
|
@ -1842,10 +1849,17 @@ 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)
|
||||||
|
{
|
||||||
|
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)))
|
||||||
|
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;
|
||||||
|
|
@ -1882,6 +1896,10 @@ 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)))
|
||||||
|
return -1;
|
||||||
|
if((temp0 < (-8183)) || (temp1 < (-8183)))
|
||||||
|
return -1;
|
||||||
*quant++ = temp0;
|
*quant++ = temp0;
|
||||||
*quant++ = temp1;
|
*quant++ = temp1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -319,11 +319,15 @@ 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;
|
||||||
|
|
||||||
neg_val = -a;
|
|
||||||
if (a == MIN_32) {
|
if (a == MIN_32)
|
||||||
|
{
|
||||||
neg_val = MAX_32;
|
neg_val = MAX_32;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
neg_val = -a;
|
||||||
|
}
|
||||||
return neg_val;
|
return neg_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,16 @@ static PLATFORM_INLINE WORD64 ixheaacd_mult64(WORD32 a, WORD32 b) {
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PLATFORM_INLINE WORD64 ixheaacd_add64_sat(WORD64 a, WORD64 b) {
|
||||||
|
WORD64 result , comp;
|
||||||
|
result = (a < 0) ? MIN_64 : MAX_64;
|
||||||
|
comp = result - a;
|
||||||
|
if ((a < 0) == (b > comp))
|
||||||
|
result = a + b;
|
||||||
|
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
static PLATFORM_INLINE WORD64 ixheaacd_add64(WORD64 a, WORD64 b) {
|
static PLATFORM_INLINE WORD64 ixheaacd_add64(WORD64 a, WORD64 b) {
|
||||||
WORD64 result;
|
WORD64 result;
|
||||||
result = a + b;
|
result = a + b;
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ static WORD16 ixheaacd_read_block_data(
|
||||||
return error_code;
|
return error_code;
|
||||||
}
|
}
|
||||||
if (aac_sf_data_resil_flag && ((object_type == AOT_ER_AAC_ELD)
|
if (aac_sf_data_resil_flag && ((object_type == AOT_ER_AAC_ELD)
|
||||||
|| (object_type == AOT_ER_AAC_LD)))
|
|| (object_type == AOT_ER_AAC_LD)))
|
||||||
ixheaacd_rvlc_read(it_bit_buff, ptr_aac_dec_channel_info);
|
ixheaacd_rvlc_read(it_bit_buff, ptr_aac_dec_channel_info);
|
||||||
else
|
else
|
||||||
ixheaacd_read_scale_factor_data(it_bit_buff, ptr_aac_dec_channel_info,
|
ixheaacd_read_scale_factor_data(it_bit_buff, ptr_aac_dec_channel_info,
|
||||||
|
|
@ -297,7 +297,7 @@ static WORD16 ixheaacd_read_block_data(
|
||||||
|
|
||||||
WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
|
WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
|
||||||
ia_ics_info_struct *ptr_ics_info,
|
ia_ics_info_struct *ptr_ics_info,
|
||||||
WORD32 object_type,
|
WORD32 object_type,
|
||||||
WORD32 frame_size, WORD32 ch) {
|
WORD32 frame_size, WORD32 ch) {
|
||||||
WORD32 retval = AAC_DEC_OK;
|
WORD32 retval = AAC_DEC_OK;
|
||||||
|
|
||||||
|
|
@ -514,10 +514,10 @@ WORD16 ixheaacd_individual_ch_stream(
|
||||||
it_bit_buff, ptr_ics_info, object_type,
|
it_bit_buff, ptr_ics_info, object_type,
|
||||||
aac_dec_handle->samples_per_frame, 1);
|
aac_dec_handle->samples_per_frame, 1);
|
||||||
|
|
||||||
if(temp!=0)
|
if(temp!=0)
|
||||||
{
|
{
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
aac_dec_handle->pstr_aac_dec_ch_info[ch + 1]->str_ics_info.ltp.lag =
|
aac_dec_handle->pstr_aac_dec_ch_info[ch + 1]->str_ics_info.ltp.lag =
|
||||||
ptr_ics_info->ltp2.lag;
|
ptr_ics_info->ltp2.lag;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ WORD16 ixheaacd_ics_read(ia_bit_buf_struct *it_bit_buff,
|
||||||
|
|
||||||
WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
|
WORD16 ixheaacd_ltp_decode(ia_bit_buf_struct *it_bit_buff,
|
||||||
ia_ics_info_struct *ptr_ics_info,
|
ia_ics_info_struct *ptr_ics_info,
|
||||||
WORD32 object_type,
|
WORD32 object_type,
|
||||||
WORD32 frame_size, WORD32 ch);
|
WORD32 frame_size, WORD32 ch);
|
||||||
|
|
||||||
#endif /* #ifndef IXHEAACD_CHANNELINFO_H */
|
#endif /* #ifndef IXHEAACD_CHANNELINFO_H */
|
||||||
|
|
|
||||||
|
|
@ -197,22 +197,22 @@ const ixheaacd_misc_tables ixheaacd_str_fft_n_transcendent_tables = {
|
||||||
|
|
||||||
/*WORD32 down_mix_martix[4][2][8] = */
|
/*WORD32 down_mix_martix[4][2][8] = */
|
||||||
{
|
{
|
||||||
{/* Q30 */ /* 5.0 Channel to Stereo */
|
{/* Q30 */ /* 5.0 Channel to Stereo */
|
||||||
{405185594, 0, 315041546, 315041546, 0, 0, 0, 0},
|
{405185594, 0, 315041546, 315041546, 0, 0, 0, 0},
|
||||||
{0, 405185594, 315041546, 0, 315041546, 0, 0, 0}},
|
{0, 405185594, 315041546, 0, 315041546, 0, 0, 0}},
|
||||||
{/* Q30 */ /* 5.1 Channel to Stereo */
|
{/* Q30 */ /* 5.1 Channel to Stereo */
|
||||||
{405185594, 0, 286509481, 95503160, 286509481, 0, 0, 0},
|
{405185594, 0, 286509481, 95503160, 286509481, 0, 0, 0},
|
||||||
{0, 405185594, 286509481, 95503160, 0, 286509481, 0, 0}},
|
{0, 405185594, 286509481, 95503160, 0, 286509481, 0, 0}},
|
||||||
{/* Q30 */ /* 7.0 Channel to Stereo */
|
{/* Q30 */ /* 7.0 Channel to Stereo */
|
||||||
{405185594, 0, 244131873, 244131873, 0, 244131873, 0, 0},
|
{405185594, 0, 244131873, 244131873, 0, 244131873, 0, 0},
|
||||||
{0, 405185594, 244131873, 0, 244131873, 0, 244131873, 0}},
|
{0, 405185594, 244131873, 0, 244131873, 0, 244131873, 0}},
|
||||||
{/* Q30 */ /* 7.1 Channel to Stereo */
|
{/* Q30 */ /* 7.1 Channel to Stereo */
|
||||||
{405185594, 0, 226641828, 75547276, 226641828, 0, 226641828, 0},
|
{405185594, 0, 226641828, 75547276, 226641828, 0, 226641828, 0},
|
||||||
{0, 405185594, 75547276, 226641828, 0, 226641828, 0, 226641828}},
|
{0, 405185594, 75547276, 226641828, 0, 226641828, 0, 226641828}},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Q29 */
|
/* Q29 */
|
||||||
/*const WORD32 cc_gain_scale[4] = */,
|
/*const WORD32 cc_gain_scale[4] = */,
|
||||||
{585461881, 638450708, 759250125, 1073741824},
|
{585461881, 638450708, 759250125, 1073741824},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,15 +43,11 @@
|
||||||
#define ID_EXT_ELE_FILL 0
|
#define ID_EXT_ELE_FILL 0
|
||||||
#define ID_EXT_ELE_MPEGS 1
|
#define ID_EXT_ELE_MPEGS 1
|
||||||
#define ID_EXT_ELE_SAOC 2
|
#define ID_EXT_ELE_SAOC 2
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
#define ID_EXT_ELE_AUDIOPREROLL 3
|
#define ID_EXT_ELE_AUDIOPREROLL 3
|
||||||
#define ID_EXT_ELE_UNI_DRC 4
|
#define ID_EXT_ELE_UNI_DRC 4
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ID_CONFIG_EXT_FILL 0
|
#define ID_CONFIG_EXT_FILL 0
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
#define ID_CONFIG_EXT_LOUDNESS_INFO (2)
|
#define ID_CONFIG_EXT_LOUDNESS_INFO (2)
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef UWORD8 UINT8;
|
typedef UWORD8 UINT8;
|
||||||
typedef UWORD32 UINT32;
|
typedef UWORD32 UINT32;
|
||||||
|
|
@ -125,7 +121,6 @@ typedef struct {
|
||||||
|
|
||||||
#define BS_MAX_NUM_OUT_CHANNELS (255)
|
#define BS_MAX_NUM_OUT_CHANNELS (255)
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
#define EXT_COUNT_MAX (2)
|
#define EXT_COUNT_MAX (2)
|
||||||
#define MAX_CHANNEL_COUNT (128)
|
#define MAX_CHANNEL_COUNT (128)
|
||||||
#define SEQUENCE_COUNT_MAX (24)
|
#define SEQUENCE_COUNT_MAX (24)
|
||||||
|
|
@ -164,7 +159,6 @@ typedef struct {
|
||||||
#define DRC_BAND_COUNT_MAX BAND_COUNT_MAX
|
#define DRC_BAND_COUNT_MAX BAND_COUNT_MAX
|
||||||
#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)
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 tw_mdct;
|
UINT32 tw_mdct;
|
||||||
|
|
@ -181,13 +175,10 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UWORD32 num_elements;
|
UWORD32 num_elements;
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
UWORD32 num_config_extensions;
|
UWORD32 num_config_extensions;
|
||||||
#endif
|
|
||||||
UWORD32 usac_element_type[USAC_MAX_ELEMENTS];
|
UWORD32 usac_element_type[USAC_MAX_ELEMENTS];
|
||||||
ia_usac_dec_element_config_struct str_usac_element_config[USAC_MAX_ELEMENTS];
|
ia_usac_dec_element_config_struct str_usac_element_config[USAC_MAX_ELEMENTS];
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
WORD32 usac_cfg_ext_info_present[USAC_MAX_CONFIG_EXTENSIONS];
|
WORD32 usac_cfg_ext_info_present[USAC_MAX_CONFIG_EXTENSIONS];
|
||||||
WORD32 usac_ext_ele_payload_present[USAC_MAX_ELEMENTS];
|
WORD32 usac_ext_ele_payload_present[USAC_MAX_ELEMENTS];
|
||||||
WORD32 usac_cfg_ext_info_len[USAC_MAX_CONFIG_EXTENSIONS];
|
WORD32 usac_cfg_ext_info_len[USAC_MAX_CONFIG_EXTENSIONS];
|
||||||
|
|
@ -196,7 +187,8 @@ typedef struct {
|
||||||
UWORD8 usac_cfg_ext_info_buf[USAC_MAX_CONFIG_EXTENSIONS][768];
|
UWORD8 usac_cfg_ext_info_buf[USAC_MAX_CONFIG_EXTENSIONS][768];
|
||||||
UWORD8 usac_ext_ele_payload_buf[USAC_MAX_ELEMENTS][768];
|
UWORD8 usac_ext_ele_payload_buf[USAC_MAX_ELEMENTS][768];
|
||||||
UWORD8 usac_ext_gain_payload_buf[768];
|
UWORD8 usac_ext_gain_payload_buf[768];
|
||||||
#endif
|
|
||||||
|
WORD32 preroll_flag;
|
||||||
|
|
||||||
} ia_usac_decoder_config_struct;
|
} ia_usac_decoder_config_struct;
|
||||||
|
|
||||||
|
|
@ -212,8 +204,6 @@ typedef struct {
|
||||||
|
|
||||||
} ia_usac_config_struct;
|
} ia_usac_config_struct;
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 parametric_lim_threshold_present;
|
WORD32 parametric_lim_threshold_present;
|
||||||
FLOAT32 parametric_lim_threshold;
|
FLOAT32 parametric_lim_threshold;
|
||||||
|
|
@ -257,9 +247,7 @@ typedef struct {
|
||||||
WORD32 len_bit_size;
|
WORD32 len_bit_size;
|
||||||
ia_parametric_drc_type_feed_forward_struct
|
ia_parametric_drc_type_feed_forward_struct
|
||||||
str_parametric_drc_type_feed_forward;
|
str_parametric_drc_type_feed_forward;
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
ia_parametric_drc_lim_struct parametric_drc_lim;
|
ia_parametric_drc_lim_struct parametric_drc_lim;
|
||||||
#endif
|
|
||||||
|
|
||||||
WORD32 drc_characteristic;
|
WORD32 drc_characteristic;
|
||||||
WORD32 disable_paramteric_drc;
|
WORD32 disable_paramteric_drc;
|
||||||
|
|
@ -311,7 +299,6 @@ typedef struct {
|
||||||
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;
|
||||||
|
|
||||||
#endif
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 filt_ele_idx;
|
WORD32 filt_ele_idx;
|
||||||
WORD32 filt_ele_gain_flag;
|
WORD32 filt_ele_gain_flag;
|
||||||
|
|
@ -407,14 +394,11 @@ 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];
|
||||||
|
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
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
|
ia_parametric_drc_instructions_struct
|
||||||
str_parametric_drc_instructions[PARAM_DRC_INSTRUCTIONS_COUNT_MAX];
|
str_parametric_drc_instructions[PARAM_DRC_INSTRUCTIONS_COUNT_MAX];
|
||||||
#endif
|
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
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;
|
||||||
|
|
@ -424,7 +408,6 @@ typedef struct {
|
||||||
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];
|
||||||
#endif
|
|
||||||
} ia_drc_config_ext;
|
} ia_drc_config_ext;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -449,12 +432,10 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 gain_seq_idx;
|
WORD32 gain_seq_idx;
|
||||||
WORD32 drc_characteristic;
|
WORD32 drc_characteristic;
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
WORD32 drc_characteristic_present;
|
WORD32 drc_characteristic_present;
|
||||||
WORD32 drc_characteristic_format_is_cicp;
|
WORD32 drc_characteristic_format_is_cicp;
|
||||||
WORD32 drc_characteristic_left_index;
|
WORD32 drc_characteristic_left_index;
|
||||||
WORD32 drc_characteristic_right_index;
|
WORD32 drc_characteristic_right_index;
|
||||||
#endif
|
|
||||||
WORD32 crossover_freq_idx;
|
WORD32 crossover_freq_idx;
|
||||||
WORD32 start_subband_index;
|
WORD32 start_subband_index;
|
||||||
} ia_gain_params_struct;
|
} ia_gain_params_struct;
|
||||||
|
|
@ -517,7 +498,6 @@ typedef struct {
|
||||||
WORD32 drc_frame_size;
|
WORD32 drc_frame_size;
|
||||||
WORD32 gain_set_count;
|
WORD32 gain_set_count;
|
||||||
ia_gain_set_params_struct gain_set_params[GAIN_SET_COUNT_MAX];
|
ia_gain_set_params_struct gain_set_params[GAIN_SET_COUNT_MAX];
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
WORD32 drc_characteristic_left_present;
|
WORD32 drc_characteristic_left_present;
|
||||||
WORD32 characteristic_left_count;
|
WORD32 characteristic_left_count;
|
||||||
ia_split_drc_characteristic_struct
|
ia_split_drc_characteristic_struct
|
||||||
|
|
@ -532,22 +512,17 @@ typedef struct {
|
||||||
str_shape_filter_block_params[SHAPE_FILTER_COUNT_MAX + 1];
|
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];
|
||||||
#endif
|
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
WORD32 gain_set_count_plus;
|
WORD32 gain_set_count_plus;
|
||||||
|
|
||||||
#endif
|
|
||||||
} ia_uni_drc_coeffs_struct;
|
} ia_uni_drc_coeffs_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
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;
|
||||||
#endif
|
|
||||||
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];
|
||||||
|
|
@ -563,10 +538,8 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WORD32 drc_set_id;
|
WORD32 drc_set_id;
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
WORD32 drc_set_complexity_level;
|
WORD32 drc_set_complexity_level;
|
||||||
WORD32 requires_eq;
|
WORD32 requires_eq;
|
||||||
#endif
|
|
||||||
WORD32 drc_apply_to_dwnmix;
|
WORD32 drc_apply_to_dwnmix;
|
||||||
WORD32 drc_location;
|
WORD32 drc_location;
|
||||||
WORD32 dwnmix_id_count;
|
WORD32 dwnmix_id_count;
|
||||||
|
|
@ -600,12 +573,10 @@ typedef struct {
|
||||||
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;
|
||||||
WORD32 multiband_audio_sig_count;
|
WORD32 multiband_audio_sig_count;
|
||||||
#ifdef AMMENDMENT1
|
|
||||||
WORD32 ch_group_parametric_drc_flag[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 ch_group_parametric_drc_flag[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 gain_set_idx_of_ch_group_parametric_drc[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 gain_set_idx_of_ch_group_parametric_drc[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 parametric_drc_look_ahead_samples[CHANNEL_GROUP_COUNT_MAX];
|
WORD32 parametric_drc_look_ahead_samples[CHANNEL_GROUP_COUNT_MAX];
|
||||||
WORD32 parametric_drc_look_ahead_samples_max;
|
WORD32 parametric_drc_look_ahead_samples_max;
|
||||||
#endif
|
|
||||||
} ia_drc_instructions_struct;
|
} ia_drc_instructions_struct;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -646,7 +617,6 @@ typedef struct ia_drc_config {
|
||||||
ia_downmix_instructions_struct
|
ia_downmix_instructions_struct
|
||||||
dwnmix_instructions[DOWNMIX_INSTRUCTION_COUNT_MAX];
|
dwnmix_instructions[DOWNMIX_INSTRUCTION_COUNT_MAX];
|
||||||
} ia_drc_config;
|
} ia_drc_config;
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID ixheaacd_conf_default(ia_usac_config_struct *pstr_usac_conf);
|
VOID ixheaacd_conf_default(ia_usac_config_struct *pstr_usac_conf);
|
||||||
|
|
||||||
|
|
@ -654,7 +624,7 @@ UWORD32 ixheaacd_sbr_ratio(UWORD32 core_sbr_frame_len_idx);
|
||||||
|
|
||||||
UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_frame_len_idx,
|
UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_frame_len_idx,
|
||||||
WORD32 *output_frame_length, WORD32 *block_size,
|
WORD32 *output_frame_length, WORD32 *block_size,
|
||||||
WORD32 *output_samples);
|
WORD32 *output_samples,WORD32 *sampling_freq, UWORD32* sample_freq_indx);
|
||||||
|
|
||||||
WORD32 ixheaacd_config(ia_bit_buf_struct *bit_buff,
|
WORD32 ixheaacd_config(ia_bit_buf_struct *bit_buff,
|
||||||
ia_usac_config_struct *pstr_usac_conf);
|
ia_usac_config_struct *pstr_usac_conf);
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,8 @@ WORD32 ixheaacd_decode_init(
|
||||||
&aac_dec_handle->pstr_aac_tables->pstr_block_tables
|
&aac_dec_handle->pstr_aac_tables->pstr_block_tables
|
||||||
->tns_max_bands_tbl_usac;
|
->tns_max_bands_tbl_usac;
|
||||||
|
|
||||||
for (i = 0; i < (1 << LEN_SAMP_IDX); i++) {
|
|
||||||
|
for (i = 0; i < 11 ; i++) {
|
||||||
if (ixheaacd_sampling_boundaries[i] <= sample_rate) break;
|
if (ixheaacd_sampling_boundaries[i] <= sample_rate) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,14 +320,8 @@ WORD32 ixheaacd_decode_init(
|
||||||
.str_usac_element_config[ele_id]
|
.str_usac_element_config[ele_id]
|
||||||
.str_usac_mps212_config);
|
.str_usac_mps212_config);
|
||||||
|
|
||||||
if (aac_dec_handle->mps_dec_handle[ele_id]) {
|
ixheaacd_mps_create(&aac_dec_handle->mps_dec_handle,
|
||||||
aac_dec_handle->mps_dec_handle[ele_id] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
aac_dec_handle->mps_dec_handle[ele_id] = ixheaacd_mps_create(
|
|
||||||
bs_frame_length, bs_residual_coding, ptr_usac_mps212_config);
|
bs_frame_length, bs_residual_coding, ptr_usac_mps212_config);
|
||||||
|
|
||||||
if (aac_dec_handle->mps_dec_handle[ele_id] == 0) return -1;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -369,7 +364,12 @@ WORD32 ixheaacd_dec_data_init(VOID *handle,
|
||||||
|
|
||||||
sbr_ratio_idx = ixheaacd_sbr_params(
|
sbr_ratio_idx = ixheaacd_sbr_params(
|
||||||
ptr_usac_config->core_sbr_framelength_index, &out_frame_len,
|
ptr_usac_config->core_sbr_framelength_index, &out_frame_len,
|
||||||
&usac_data->ccfl, &usac_data->output_samples);
|
&usac_data->ccfl, &usac_data->output_samples,
|
||||||
|
&pstr_frame_data->str_layer.sample_rate_layer,
|
||||||
|
&layer_config->samp_frequency_index);
|
||||||
|
|
||||||
|
pstr_stream_config->sampling_frequency = pstr_frame_data->str_layer.sample_rate_layer;
|
||||||
|
pstr_stream_config->samp_frequency_index = layer_config->samp_frequency_index;
|
||||||
|
|
||||||
num_elements = ptr_usac_config->str_usac_dec_config.num_elements;
|
num_elements = ptr_usac_config->str_usac_dec_config.num_elements;
|
||||||
|
|
||||||
|
|
@ -397,14 +397,9 @@ WORD32 ixheaacd_dec_data_init(VOID *handle,
|
||||||
|
|
||||||
num_out_chan = ptr_usac_config->num_out_channels;
|
num_out_chan = ptr_usac_config->num_out_channels;
|
||||||
|
|
||||||
if (layer_config->samp_frequency_index != 0xf)
|
|
||||||
pstr_frame_data->str_layer.sample_rate_layer =
|
|
||||||
ixheaacd_sampl_freq_idx_table[layer_config->samp_frequency_index];
|
|
||||||
else
|
|
||||||
pstr_frame_data->str_layer.sample_rate_layer =
|
|
||||||
layer_config->sampling_frequency;
|
|
||||||
|
|
||||||
if (out_frame_len == 768)
|
|
||||||
|
if (usac_data->ccfl == 768)
|
||||||
pstr_frame_data->str_layer.sample_rate_layer =
|
pstr_frame_data->str_layer.sample_rate_layer =
|
||||||
4 * pstr_frame_data->str_layer.sample_rate_layer / 3;
|
4 * pstr_frame_data->str_layer.sample_rate_layer / 3;
|
||||||
|
|
||||||
|
|
@ -483,11 +478,10 @@ WORD32 ixheaacd_frm_data_init(ia_audio_specific_config_struct *pstr_audio_conf,
|
||||||
WORD32 max_layer = -1;
|
WORD32 max_layer = -1;
|
||||||
|
|
||||||
memset(pstr_dec_data, 0, sizeof(ia_dec_data_struct));
|
memset(pstr_dec_data, 0, sizeof(ia_dec_data_struct));
|
||||||
pstr_dec_data->pstr_frame_data = &pstr_dec_data->str_frame_data;
|
memset(&(pstr_dec_data->str_frame_data), 0,
|
||||||
memset(pstr_dec_data->pstr_frame_data, 1,
|
|
||||||
sizeof(pstr_dec_data->str_frame_data));
|
sizeof(pstr_dec_data->str_frame_data));
|
||||||
|
|
||||||
pstr_frame_data = pstr_dec_data->pstr_frame_data;
|
pstr_frame_data = &(pstr_dec_data->str_frame_data);
|
||||||
|
|
||||||
if (max_layer < 0) max_layer = stream_count - 1;
|
if (max_layer < 0) max_layer = stream_count - 1;
|
||||||
|
|
||||||
|
|
@ -528,7 +522,7 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
ia_frame_data_struct *pstr_frame_data;
|
ia_frame_data_struct *pstr_frame_data;
|
||||||
WORD32 stream_count;
|
WORD32 stream_count;
|
||||||
ia_aac_dec_state_struct *aac_dec_handle = handle->p_state_aac;
|
ia_aac_dec_state_struct *aac_dec_handle = handle->p_state_aac;
|
||||||
pstr_frame_data = pstr_dec_data->pstr_frame_data;
|
pstr_frame_data = &(pstr_dec_data->str_frame_data);
|
||||||
stream_count = pstr_frame_data->stream_count;
|
stream_count = pstr_frame_data->stream_count;
|
||||||
pstr_frame_data->stream_count = tracks_for_decoder;
|
pstr_frame_data->stream_count = tracks_for_decoder;
|
||||||
|
|
||||||
|
|
@ -537,12 +531,11 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
|
|
||||||
switch (aot) {
|
switch (aot) {
|
||||||
case AOT_USAC:
|
case AOT_USAC:
|
||||||
if (pstr_dec_data->pstr_usac_data == NULL) {
|
|
||||||
pstr_dec_data->pstr_usac_data = &pstr_dec_data->str_usac_data;
|
|
||||||
err = ixheaacd_dec_data_init(handle, pstr_frame_data,
|
|
||||||
pstr_dec_data->pstr_usac_data);
|
|
||||||
|
|
||||||
switch (pstr_dec_data->pstr_usac_data->sbr_ratio_idx) {
|
err = ixheaacd_dec_data_init(handle, pstr_frame_data,
|
||||||
|
&(pstr_dec_data->str_usac_data));
|
||||||
|
|
||||||
|
switch (pstr_dec_data->str_usac_data.sbr_ratio_idx) {
|
||||||
case 0:
|
case 0:
|
||||||
handle->aac_config.ui_sbr_mode = 0;
|
handle->aac_config.ui_sbr_mode = 0;
|
||||||
break;
|
break;
|
||||||
|
|
@ -561,7 +554,7 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err == -1) return -1;
|
if (err == -1) return -1;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -577,7 +570,8 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
pstr_frame_data->scal_out_sampling_frequency =
|
pstr_frame_data->scal_out_sampling_frequency =
|
||||||
pstr_frame_data->str_audio_specific_config.sampling_frequency;
|
pstr_frame_data->str_audio_specific_config.sampling_frequency;
|
||||||
|
|
||||||
if (pstr_dec_data->pstr_usac_data != NULL) {
|
if (&(pstr_dec_data->str_usac_data) != NULL) {
|
||||||
|
ia_sbr_header_data_struct usac_def_header;
|
||||||
ia_audio_specific_config_struct *pstr_aud_spec_config =
|
ia_audio_specific_config_struct *pstr_aud_spec_config =
|
||||||
&pstr_frame_data->str_audio_specific_config;
|
&pstr_frame_data->str_audio_specific_config;
|
||||||
ia_usac_config_struct *ptr_usac_config =
|
ia_usac_config_struct *ptr_usac_config =
|
||||||
|
|
@ -586,13 +580,24 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
WORD32 inter_tes[MAX_NUM_ELEMENTS] = {0};
|
WORD32 inter_tes[MAX_NUM_ELEMENTS] = {0};
|
||||||
WORD32 bs_pvc[MAX_NUM_ELEMENTS] = {0};
|
WORD32 bs_pvc[MAX_NUM_ELEMENTS] = {0};
|
||||||
WORD32 harmonic_sbr[MAX_NUM_ELEMENTS] = {0};
|
WORD32 harmonic_sbr[MAX_NUM_ELEMENTS] = {0};
|
||||||
|
WORD32 inter_test_flag = 0;
|
||||||
|
WORD32 bs_pvc_flag = 0;
|
||||||
|
WORD32 harmonic_Sbr_flag = 0;
|
||||||
|
|
||||||
ia_usac_decoder_config_struct *ptr_usac_dec_config =
|
ia_usac_decoder_config_struct *ptr_usac_dec_config =
|
||||||
&ptr_usac_config->str_usac_dec_config;
|
&ptr_usac_config->str_usac_dec_config;
|
||||||
WORD32 const num_ele = ptr_usac_dec_config->num_elements;
|
WORD32 const num_ele = ptr_usac_dec_config->num_elements;
|
||||||
WORD32 elem_idx = 0;
|
WORD32 elem_idx = 0;
|
||||||
|
|
||||||
|
memset(&usac_def_header, 0, sizeof(ia_sbr_header_data_struct));
|
||||||
|
|
||||||
for (elem_idx = 0; elem_idx < num_ele; elem_idx++) {
|
for (elem_idx = 0; elem_idx < num_ele; elem_idx++) {
|
||||||
|
|
||||||
|
UWORD32 usac_ele_type =
|
||||||
|
ptr_usac_config->str_usac_dec_config.usac_element_type[elem_idx];
|
||||||
|
ia_usac_dec_element_config_struct *ptr_usac_ele_config =
|
||||||
|
&ptr_usac_config->str_usac_dec_config.str_usac_element_config[elem_idx];
|
||||||
|
|
||||||
ia_usac_dec_sbr_config_struct *ptr_usac_sbr_config =
|
ia_usac_dec_sbr_config_struct *ptr_usac_sbr_config =
|
||||||
&(ptr_usac_dec_config->str_usac_element_config[elem_idx]
|
&(ptr_usac_dec_config->str_usac_element_config[elem_idx]
|
||||||
.str_usac_sbr_config);
|
.str_usac_sbr_config);
|
||||||
|
|
@ -602,39 +607,21 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
(ptr_usac_sbr_config != NULL) ? ptr_usac_sbr_config->bs_pvc : 0;
|
(ptr_usac_sbr_config != NULL) ? ptr_usac_sbr_config->bs_pvc : 0;
|
||||||
harmonic_sbr[elem_idx] =
|
harmonic_sbr[elem_idx] =
|
||||||
(ptr_usac_sbr_config != NULL) ? ptr_usac_sbr_config->harmonic_sbr : 0;
|
(ptr_usac_sbr_config != NULL) ? ptr_usac_sbr_config->harmonic_sbr : 0;
|
||||||
}
|
|
||||||
|
|
||||||
pstr_dec_data->pstr_usac_data->down_samp_sbr = 0;
|
if (ptr_usac_sbr_config->bs_inter_tes)
|
||||||
|
inter_test_flag = 1;
|
||||||
|
if (ptr_usac_sbr_config->bs_pvc)
|
||||||
|
bs_pvc_flag = 1;
|
||||||
|
if (ptr_usac_sbr_config->harmonic_sbr)
|
||||||
|
harmonic_Sbr_flag = 1;
|
||||||
|
|
||||||
|
|
||||||
if (pstr_dec_data->pstr_usac_data->sbr_ratio_idx > 0) {
|
|
||||||
if (pstr_aud_spec_config->ext_sampling_frequency ==
|
|
||||||
pstr_aud_spec_config->sampling_frequency) {
|
|
||||||
pstr_dec_data->pstr_usac_data->down_samp_sbr = 1;
|
|
||||||
}
|
|
||||||
if (pstr_dec_data->pstr_usac_data->down_samp_sbr == 0) {
|
|
||||||
if (pstr_dec_data->pstr_usac_data->sbr_ratio_idx == 3) {
|
|
||||||
pstr_frame_data->scal_out_sampling_frequency =
|
|
||||||
4 * pstr_frame_data->scal_out_sampling_frequency;
|
|
||||||
} else {
|
|
||||||
pstr_frame_data->scal_out_sampling_frequency =
|
|
||||||
2 * pstr_frame_data->scal_out_sampling_frequency;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
UWORD32 usac_ele_type =
|
|
||||||
ptr_usac_config->str_usac_dec_config.usac_element_type[0];
|
|
||||||
ia_usac_dec_element_config_struct *ptr_usac_ele_config =
|
|
||||||
&ptr_usac_config->str_usac_dec_config.str_usac_element_config[0];
|
|
||||||
ia_sbr_header_data_struct usac_def_header;
|
|
||||||
void *sbr_persistent_mem_v = aac_dec_handle->sbr_persistent_mem_u;
|
|
||||||
|
|
||||||
if ((usac_ele_type != ID_USAC_LFE) && (usac_ele_type != ID_USAC_EXT)) {
|
if ((usac_ele_type != ID_USAC_LFE) && (usac_ele_type != ID_USAC_EXT)) {
|
||||||
ia_usac_dec_sbr_config_struct *ptr_usac_sbr_config =
|
ia_usac_dec_sbr_config_struct *ptr_usac_sbr_config =
|
||||||
&(ptr_usac_ele_config->str_usac_sbr_config);
|
&(ptr_usac_ele_config->str_usac_sbr_config);
|
||||||
|
|
||||||
memset(&usac_def_header, 0, sizeof(ia_sbr_header_data_struct));
|
|
||||||
|
|
||||||
usac_def_header.start_freq = ptr_usac_sbr_config->dflt_start_freq;
|
usac_def_header.start_freq = ptr_usac_sbr_config->dflt_start_freq;
|
||||||
usac_def_header.stop_freq = ptr_usac_sbr_config->dflt_stop_freq;
|
usac_def_header.stop_freq = ptr_usac_sbr_config->dflt_stop_freq;
|
||||||
usac_def_header.header_extra_1 =
|
usac_def_header.header_extra_1 =
|
||||||
|
|
@ -653,23 +640,47 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
usac_def_header.smoothing_mode =
|
usac_def_header.smoothing_mode =
|
||||||
ptr_usac_sbr_config->dflt_smoothing_mode;
|
ptr_usac_sbr_config->dflt_smoothing_mode;
|
||||||
}
|
}
|
||||||
pstr_dec_data->pstr_usac_data->pstr_esbr_dec = ixheaacd_init_sbr(
|
|
||||||
pstr_frame_data->str_layer.sample_rate_layer,
|
}
|
||||||
pstr_dec_data->pstr_usac_data->ccfl,
|
|
||||||
&pstr_dec_data->pstr_usac_data->down_samp_sbr, sbr_persistent_mem_v,
|
pstr_dec_data->str_usac_data.down_samp_sbr = 0;
|
||||||
NULL, pstr_frame_data->scal_out_num_channels, 0,
|
|
||||||
pstr_dec_data->pstr_usac_data->sbr_ratio_idx,
|
if (pstr_dec_data->str_usac_data.sbr_ratio_idx > 0) {
|
||||||
pstr_dec_data->pstr_usac_data->output_samples, harmonic_sbr,
|
if (pstr_aud_spec_config->ext_sampling_frequency ==
|
||||||
(void *)&usac_def_header, aac_dec_handle->str_sbr_config,
|
pstr_aud_spec_config->sampling_frequency) {
|
||||||
pstr_dec_data->pstr_usac_data->audio_object_type);
|
pstr_dec_data->str_usac_data.down_samp_sbr = 1;
|
||||||
pstr_dec_data->pstr_usac_data->sbr_scratch_mem_base =
|
}
|
||||||
aac_dec_handle->sbr_scratch_mem_u;
|
if (pstr_dec_data->str_usac_data.down_samp_sbr == 0) {
|
||||||
if (num_ele)
|
if (pstr_dec_data->str_usac_data.sbr_ratio_idx == 3) {
|
||||||
ixheaacd_setesbr_flags(sbr_persistent_mem_v, bs_pvc[0],
|
pstr_frame_data->scal_out_sampling_frequency =
|
||||||
harmonic_sbr[0], inter_tes[0]);
|
4 * pstr_frame_data->scal_out_sampling_frequency;
|
||||||
|
} else {
|
||||||
|
pstr_frame_data->scal_out_sampling_frequency =
|
||||||
|
2 * pstr_frame_data->scal_out_sampling_frequency;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pstr_dec_data->pstr_usac_data->pstr_esbr_dec == NULL) {
|
{
|
||||||
|
|
||||||
|
void *sbr_persistent_mem_v = aac_dec_handle->sbr_persistent_mem_u;
|
||||||
|
|
||||||
|
pstr_dec_data->str_usac_data.pstr_esbr_dec = ixheaacd_init_sbr(
|
||||||
|
pstr_frame_data->str_layer.sample_rate_layer,
|
||||||
|
pstr_dec_data->str_usac_data.ccfl,
|
||||||
|
&pstr_dec_data->str_usac_data.down_samp_sbr, sbr_persistent_mem_v,
|
||||||
|
NULL, pstr_frame_data->scal_out_num_channels, 0,
|
||||||
|
pstr_dec_data->str_usac_data.sbr_ratio_idx,
|
||||||
|
pstr_dec_data->str_usac_data.output_samples, &harmonic_Sbr_flag,
|
||||||
|
(void *)&usac_def_header, aac_dec_handle->str_sbr_config,
|
||||||
|
pstr_dec_data->str_usac_data.audio_object_type);
|
||||||
|
pstr_dec_data->str_usac_data.sbr_scratch_mem_base =
|
||||||
|
aac_dec_handle->sbr_scratch_mem_u;
|
||||||
|
if (num_ele)
|
||||||
|
ixheaacd_setesbr_flags(sbr_persistent_mem_v, bs_pvc_flag,
|
||||||
|
harmonic_Sbr_flag, inter_test_flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pstr_dec_data->str_usac_data.pstr_esbr_dec == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -677,21 +688,3 @@ WORD32 ixheaacd_decode_create(ia_exhaacplus_dec_api_struct *handle,
|
||||||
|
|
||||||
return (num_delay_samp);
|
return (num_delay_samp);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 ixheaacd_decode_free(VOID *codec_handle) {
|
|
||||||
UWORD32 i;
|
|
||||||
ia_exhaacplus_dec_api_struct *handle =
|
|
||||||
(ia_exhaacplus_dec_api_struct *)codec_handle;
|
|
||||||
ia_aac_dec_state_struct *p_state_aac_dec = handle->p_state_aac;
|
|
||||||
ia_dec_data_struct *pstr_dec_data =
|
|
||||||
(ia_dec_data_struct *)(p_state_aac_dec->pstr_dec_data);
|
|
||||||
if (pstr_dec_data->pstr_usac_data) {
|
|
||||||
for (i = 0; i < MAX_NUM_ELEMENTS; i++) {
|
|
||||||
if (p_state_aac_dec->mps_dec_handle[i]) {
|
|
||||||
p_state_aac_dec->mps_dec_handle[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@
|
||||||
#define IXHEAACD_CREATE_H
|
#define IXHEAACD_CREATE_H
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ia_frame_data_struct *pstr_frame_data;
|
|
||||||
ia_usac_data_struct *pstr_usac_data;
|
|
||||||
struct ia_bit_buf_struct dec_bit_buf;
|
struct ia_bit_buf_struct dec_bit_buf;
|
||||||
ia_frame_data_struct str_frame_data;
|
ia_frame_data_struct str_frame_data;
|
||||||
ia_usac_data_struct str_usac_data;
|
ia_usac_data_struct str_usac_data;
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,99 @@ VOID ixheaacd_samples_sat(WORD8 *outbuffer, WORD32 num_samples_out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* audio pre roll frame parsing*/
|
||||||
|
static WORD32 ixheaacd_audio_preroll_parsing(ia_dec_data_struct *pstr_dec_data, UWORD8 *conf_buf,WORD32 *preroll_units, WORD32 *preroll_frame_offset)
|
||||||
|
{
|
||||||
|
ia_bit_buf_struct *temp_buff = (ia_bit_buf_struct *)&(pstr_dec_data->dec_bit_buf);
|
||||||
|
WORD32 independency_flag = 0;
|
||||||
|
WORD32 ext_ele_present = 0;
|
||||||
|
WORD32 ext_ele_use_dflt_len = 0;
|
||||||
|
WORD32 ext_ele_payload_len = 0;
|
||||||
|
|
||||||
|
WORD32 apply_crossfade = 0;
|
||||||
|
WORD32 un_used_val = 0;
|
||||||
|
WORD32 num_pre_roll_frames = 0;
|
||||||
|
|
||||||
|
WORD32 frame_idx = 0;
|
||||||
|
WORD32 frame_len[18] = { 0 }; // max of escapedValue(2, 4, 0) i.e. 2^2 -1 + 2^4 -1;
|
||||||
|
WORD32 temp = 0;
|
||||||
|
|
||||||
|
WORD32 config_len = 0;
|
||||||
|
WORD32 loop;
|
||||||
|
|
||||||
|
if (pstr_dec_data->str_frame_data.str_audio_specific_config.str_usac_config.str_usac_dec_config.usac_element_type[0] == ID_USAC_EXT)
|
||||||
|
{
|
||||||
|
temp = ixheaacd_show_bits_buf(temp_buff, 3);
|
||||||
|
independency_flag = (temp >> 2) & 0x1;
|
||||||
|
ext_ele_present = (temp >> 1) & 0x1;
|
||||||
|
|
||||||
|
if (ext_ele_present)
|
||||||
|
{
|
||||||
|
ext_ele_use_dflt_len = temp & 0x1; // ixheaacd_read_bit(&temp_buff, 1);
|
||||||
|
if (ext_ele_use_dflt_len != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
un_used_val = ixheaacd_read_bits_buf(temp_buff, 3);
|
||||||
|
|
||||||
|
ext_ele_payload_len = ixheaacd_read_bits_buf(temp_buff, 8);
|
||||||
|
|
||||||
|
if (ext_ele_payload_len == 255) {
|
||||||
|
WORD32 val_add = 0;
|
||||||
|
val_add = ixheaacd_read_bits_buf(temp_buff, 16);
|
||||||
|
ext_ele_payload_len = (UWORD32)((WORD32)ext_ele_payload_len + val_add - 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
//escapedValue(4, 4, 8);
|
||||||
|
config_len = ixheaacd_read_bits_buf(temp_buff, 4);
|
||||||
|
if (config_len == 15)
|
||||||
|
{
|
||||||
|
WORD32 val_add = 0;
|
||||||
|
val_add = ixheaacd_read_bits_buf(temp_buff, 4);
|
||||||
|
config_len += val_add;
|
||||||
|
if (val_add == 15)
|
||||||
|
{
|
||||||
|
WORD32 val_add1 = 0;
|
||||||
|
val_add1 = ixheaacd_read_bits_buf(temp_buff, 8);
|
||||||
|
config_len += val_add1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(loop=0; loop < config_len; loop++)
|
||||||
|
conf_buf[loop] = ixheaacd_read_bits_buf(temp_buff, 8);
|
||||||
|
|
||||||
|
|
||||||
|
apply_crossfade = ixheaacd_read_bits_buf(temp_buff, 1);
|
||||||
|
un_used_val = ixheaacd_read_bits_buf(temp_buff, 1); // reserverd
|
||||||
|
|
||||||
|
//escapedValue(2, 4, 0);
|
||||||
|
num_pre_roll_frames = ixheaacd_read_bits_buf(temp_buff, 2);
|
||||||
|
if (num_pre_roll_frames == 3)
|
||||||
|
{
|
||||||
|
WORD32 val_add = 0;
|
||||||
|
val_add = ixheaacd_read_bits_buf(temp_buff, 4);
|
||||||
|
num_pre_roll_frames += val_add;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (frame_idx = 0; frame_idx < num_pre_roll_frames; frame_idx++)
|
||||||
|
{
|
||||||
|
WORD32 au_len = 0; //escapedValued(16,16,0)
|
||||||
|
au_len = ixheaacd_read_bits_buf(temp_buff, 16);
|
||||||
|
if (au_len == 65535)
|
||||||
|
{
|
||||||
|
WORD32 val_add = ixheaacd_read_bits_buf(temp_buff, 16);
|
||||||
|
au_len += val_add;
|
||||||
|
}
|
||||||
|
preroll_frame_offset[frame_idx]=temp_buff->size-temp_buff->cnt_bits;
|
||||||
|
frame_len[frame_idx] = (8 * au_len) + (temp_buff->size - temp_buff->cnt_bits);
|
||||||
|
temp_buff->ptr_read_next += au_len;
|
||||||
|
temp_buff->cnt_bits -= au_len * 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*preroll_units=num_pre_roll_frames;
|
||||||
|
return config_len;
|
||||||
|
}
|
||||||
|
|
||||||
WORD32 ixheaacd_dec_main(VOID *temp_handle, WORD8 *inbuffer, WORD8 *outbuffer,
|
WORD32 ixheaacd_dec_main(VOID *temp_handle, WORD8 *inbuffer, WORD8 *outbuffer,
|
||||||
WORD32 *out_bytes, WORD32 frames_done, WORD32 pcmsize,
|
WORD32 *out_bytes, WORD32 frames_done, WORD32 pcmsize,
|
||||||
WORD32 *num_channel_out) {
|
WORD32 *num_channel_out) {
|
||||||
|
|
@ -139,6 +232,13 @@ WORD32 ixheaacd_dec_main(VOID *temp_handle, WORD8 *inbuffer, WORD8 *outbuffer,
|
||||||
WORD32 suitable_tracks = 1;
|
WORD32 suitable_tracks = 1;
|
||||||
WORD32 num_samples_out;
|
WORD32 num_samples_out;
|
||||||
ia_dec_data_struct *pstr_dec_data;
|
ia_dec_data_struct *pstr_dec_data;
|
||||||
|
UWORD8 config[285]; //max of escapedValue(4, 4, 8) i.e. 2^4 -1 + 2^4 -1 + 2^8 -1;
|
||||||
|
WORD32 config_len;
|
||||||
|
WORD32 delay;
|
||||||
|
WORD preroll_frame_offset[4]={0};
|
||||||
|
WORD preroll_units=-1;
|
||||||
|
WORD32 access_units=0;
|
||||||
|
|
||||||
|
|
||||||
if (frames_done == 0) {
|
if (frames_done == 0) {
|
||||||
if ((pstr_audio_specific_config->channel_configuration > 2) ||
|
if ((pstr_audio_specific_config->channel_configuration > 2) ||
|
||||||
|
|
@ -167,9 +267,9 @@ WORD32 ixheaacd_dec_main(VOID *temp_handle, WORD8 *inbuffer, WORD8 *outbuffer,
|
||||||
WORD32 delay;
|
WORD32 delay;
|
||||||
delay = ixheaacd_decode_create(
|
delay = ixheaacd_decode_create(
|
||||||
handle, pstr_dec_data,
|
handle, pstr_dec_data,
|
||||||
pstr_dec_data->pstr_frame_data->scal_out_select + 1);
|
pstr_dec_data->str_frame_data.scal_out_select + 1);
|
||||||
if (delay == -1) return -1;
|
if (delay == -1) return -1;
|
||||||
*num_channel_out = pstr_dec_data->pstr_frame_data->scal_out_num_channels;
|
*num_channel_out = pstr_dec_data->str_frame_data.scal_out_num_channels;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,30 +281,121 @@ WORD32 ixheaacd_dec_main(VOID *temp_handle, WORD8 *inbuffer, WORD8 *outbuffer,
|
||||||
pstr_dec_data->dec_bit_buf.bit_pos = 7;
|
pstr_dec_data->dec_bit_buf.bit_pos = 7;
|
||||||
pstr_dec_data->dec_bit_buf.cnt_bits = pstr_dec_data->dec_bit_buf.size;
|
pstr_dec_data->dec_bit_buf.cnt_bits = pstr_dec_data->dec_bit_buf.size;
|
||||||
|
|
||||||
pstr_dec_data->pstr_usac_data->usac_flag = aac_dec_handle->usac_flag;
|
pstr_dec_data->str_usac_data.usac_flag = aac_dec_handle->usac_flag;
|
||||||
|
|
||||||
|
/* audio pre roll frame parsing*/
|
||||||
|
|
||||||
|
do{
|
||||||
|
|
||||||
|
config_len=0;
|
||||||
|
if(access_units==0&&pstr_audio_specific_config->str_usac_config.str_usac_dec_config.preroll_flag)
|
||||||
|
{
|
||||||
|
config_len = ixheaacd_audio_preroll_parsing(pstr_dec_data,&config[0],&preroll_units,&preroll_frame_offset[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_len != 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/* updating the config parameters*/
|
||||||
|
ia_bit_buf_struct *config_bit_buf = (ia_bit_buf_struct *)malloc(sizeof(ia_bit_buf_struct));
|
||||||
|
|
||||||
|
config_bit_buf->ptr_bit_buf_base = config;
|
||||||
|
config_bit_buf->size = config_len << 3;
|
||||||
|
config_bit_buf->ptr_read_next = config_bit_buf->ptr_bit_buf_base;
|
||||||
|
config_bit_buf->ptr_bit_buf_end =(UWORD8 *)config + config_len;
|
||||||
|
config_bit_buf->bit_pos = 7;
|
||||||
|
config_bit_buf->cnt_bits = config_bit_buf->size;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
suitable_tracks =
|
||||||
|
ixheaacd_frm_data_init(pstr_audio_specific_config, pstr_dec_data);
|
||||||
|
|
||||||
|
if (suitable_tracks <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* call codec re-configure*/
|
||||||
|
err = ixheaacd_config(config_bit_buf, &(pstr_dec_data->str_frame_data.str_audio_specific_config.str_usac_config)/*&pstr_audio_specific_config->str_usac_config*/);
|
||||||
|
free(config_bit_buf);
|
||||||
|
if (err != 0) return -1;
|
||||||
|
|
||||||
|
|
||||||
|
delay = ixheaacd_decode_create(
|
||||||
|
handle, pstr_dec_data,
|
||||||
|
pstr_dec_data->str_frame_data.scal_out_select + 1);
|
||||||
|
if (delay == -1) return -1;
|
||||||
|
*num_channel_out = pstr_dec_data->str_frame_data.scal_out_num_channels;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pstr_dec_data->dec_bit_buf.ptr_bit_buf_base = (UWORD8 *)inbuffer;
|
||||||
|
pstr_dec_data->dec_bit_buf.size = aac_dec_handle->ui_in_bytes << 3;
|
||||||
|
pstr_dec_data->dec_bit_buf.ptr_bit_buf_end =
|
||||||
|
(UWORD8 *)inbuffer + aac_dec_handle->ui_in_bytes;
|
||||||
|
pstr_dec_data->dec_bit_buf.ptr_read_next = (UWORD8 *)inbuffer;
|
||||||
|
pstr_dec_data->dec_bit_buf.bit_pos = 7;
|
||||||
|
pstr_dec_data->dec_bit_buf.cnt_bits = pstr_dec_data->dec_bit_buf.size;
|
||||||
|
|
||||||
|
pstr_dec_data->str_usac_data.usac_flag = aac_dec_handle->usac_flag;
|
||||||
|
|
||||||
|
|
||||||
|
if(preroll_frame_offset[access_units])
|
||||||
|
{
|
||||||
|
pstr_dec_data->dec_bit_buf.cnt_bits=pstr_dec_data->dec_bit_buf.size - preroll_frame_offset[access_units];
|
||||||
|
pstr_dec_data->dec_bit_buf.bit_pos=7-preroll_frame_offset[access_units]%8;
|
||||||
|
pstr_dec_data->dec_bit_buf.ptr_read_next=pstr_dec_data->dec_bit_buf.ptr_read_next+(preroll_frame_offset[access_units]/8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//temp_read=ixheaacd_show_bits_buf(pstr_dec_data->dec_bit_buf,preroll_frame_offset[access_unit]);
|
||||||
|
|
||||||
err = ixheaacd_usac_process(pstr_dec_data, num_channel_out, aac_dec_handle);
|
err = ixheaacd_usac_process(pstr_dec_data, num_channel_out, aac_dec_handle);
|
||||||
|
|
||||||
|
switch (pstr_dec_data->str_usac_data.sbr_ratio_idx) {
|
||||||
|
case 0:
|
||||||
|
handle->aac_config.ui_sbr_mode = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handle->aac_config.ui_sbr_mode = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handle->aac_config.ui_sbr_mode = 1;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handle->aac_config.ui_sbr_mode = 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
handle->aac_config.ui_sbr_mode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (err == -1) return err;
|
if (err == -1) return err;
|
||||||
|
|
||||||
num_samples_out = pstr_dec_data->pstr_usac_data->output_samples;
|
num_samples_out = pstr_dec_data->str_usac_data.output_samples;
|
||||||
|
|
||||||
ixheaacd_samples_sat(outbuffer, num_samples_out, pcmsize,
|
ixheaacd_samples_sat(outbuffer, num_samples_out, pcmsize,
|
||||||
pstr_dec_data->pstr_usac_data->time_sample_vector,
|
pstr_dec_data->str_usac_data.time_sample_vector,
|
||||||
out_bytes, *num_channel_out);
|
out_bytes, *num_channel_out);
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
pstr_audio_specific_config->str_usac_config.str_usac_dec_config
|
pstr_audio_specific_config->str_usac_config.str_usac_dec_config
|
||||||
.usac_ext_gain_payload_len =
|
.usac_ext_gain_payload_len =
|
||||||
pstr_dec_data->pstr_frame_data->str_audio_specific_config
|
pstr_dec_data->str_frame_data.str_audio_specific_config
|
||||||
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_len;
|
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_len;
|
||||||
memcpy(
|
memcpy(
|
||||||
pstr_audio_specific_config->str_usac_config.str_usac_dec_config
|
pstr_audio_specific_config->str_usac_config.str_usac_dec_config
|
||||||
.usac_ext_gain_payload_buf,
|
.usac_ext_gain_payload_buf,
|
||||||
pstr_dec_data->pstr_frame_data->str_audio_specific_config
|
pstr_dec_data->str_frame_data.str_audio_specific_config
|
||||||
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_buf,
|
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_buf,
|
||||||
pstr_dec_data->pstr_frame_data->str_audio_specific_config
|
pstr_dec_data->str_frame_data.str_audio_specific_config
|
||||||
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_len *
|
.str_usac_config.str_usac_dec_config.usac_ext_gain_payload_len *
|
||||||
sizeof(WORD8));
|
sizeof(WORD8));
|
||||||
#endif
|
|
||||||
|
access_units++;
|
||||||
|
preroll_units--;
|
||||||
|
}while(preroll_units>=0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -1008,21 +1008,21 @@ VOID ixheaacd_drc_apply(ia_drc_dec_struct *pstr_drc_dec,
|
||||||
(num_qmf_sub_sample - alpha_val) *
|
(num_qmf_sub_sample - alpha_val) *
|
||||||
(WORD64)prev_frame_drc_sbr_factors[i];
|
(WORD64)prev_frame_drc_sbr_factors[i];
|
||||||
|
|
||||||
if (frame_size == 512)
|
if (frame_size == 512)
|
||||||
{
|
{
|
||||||
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
||||||
(WORD32)(temp_drc >> 4);
|
(WORD32)(temp_drc >> 4);
|
||||||
}
|
}
|
||||||
else if (frame_size == 480)
|
else if (frame_size == 480)
|
||||||
{
|
{
|
||||||
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
||||||
ixheaacd_div_by_15(temp_drc);
|
ixheaacd_div_by_15(temp_drc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
||||||
(WORD32)(temp_drc >> 5);
|
(WORD32)(temp_drc >> 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (960 == frame_size) {
|
if (960 == frame_size) {
|
||||||
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
drc_sbr_factors[num_qmf_sub_sample + j][i] =
|
||||||
|
|
|
||||||
|
|
@ -923,7 +923,7 @@ WORD8 ixheaacd_sbr_read_cpe(ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ixheaacd_sbr_env_dtdf_data(ptr_frame_data[1], it_bit_buff,
|
ixheaacd_sbr_env_dtdf_data(ptr_frame_data[1], it_bit_buff,
|
||||||
ptr_header_data->usac_flag);
|
ptr_header_data->usac_flag);
|
||||||
|
|
||||||
for (i = 0; i < ptr_header_data->noise_bands; i++) {
|
for (i = 0; i < ptr_header_data->pstr_freq_band_data->num_if_bands; i++) {
|
||||||
ptr_frame_data[0]->sbr_invf_mode_prev[i] =
|
ptr_frame_data[0]->sbr_invf_mode_prev[i] =
|
||||||
ptr_frame_data[0]->sbr_invf_mode[i];
|
ptr_frame_data[0]->sbr_invf_mode[i];
|
||||||
ptr_frame_data[1]->sbr_invf_mode_prev[i] =
|
ptr_frame_data[1]->sbr_invf_mode_prev[i] =
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,15 @@
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x00000811
|
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_DRC_TARGET 0x00000811
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000812
|
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_FRAMSZ 0x00000812
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_ELDSBR 0x00000813
|
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_ELDSBR 0x00000813
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000804
|
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_LD_CONFIG 0x00000814
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000805
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DELAY_MODE 0x00000815
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000806
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_DECODE_TYPE 0x00000816
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000807
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_PEAK_LIM_FLAG 0x00000817
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000808
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CTRL_PARAM_IDX 0x00000818
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CONST_DELAY_MODE 0x00000809
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_GAIN_DELAY 0x00000819
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_CONST_DELAY_MODE 0x0000081A
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_NON_FATAL_INVALID_EFFECT_TYPE 0x0000081B
|
||||||
|
#define IA_ENHAACPLUS_DEC_CONFIG_NONFATAL_INVALID_TARGET_LOUDNESS 0x0000081C
|
||||||
|
|
||||||
// Fatal Errors
|
// Fatal Errors
|
||||||
#define IA_ENHAACPLUS_DEC_CONFIG_FATAL_INVALID_SAMPLE_RATE 0xFFFF8800
|
#define IA_ENHAACPLUS_DEC_CONFIG_FATAL_INVALID_SAMPLE_RATE 0xFFFF8800
|
||||||
|
|
|
||||||
|
|
@ -323,8 +323,8 @@ VOID ixheaacd_ms_stereo(ia_usac_data_struct *usac_data, WORD32 *r_spec,
|
||||||
for (k = 0; k < ptr_sfb_info->sfb_width[sfb]; k++) {
|
for (k = 0; k < ptr_sfb_info->sfb_width[sfb]; k++) {
|
||||||
temp_r = *r_spec;
|
temp_r = *r_spec;
|
||||||
temp_l = *l_spec;
|
temp_l = *l_spec;
|
||||||
*l_spec = temp_r + temp_l;
|
*l_spec = ixheaacd_add32_sat(temp_r , temp_l);
|
||||||
*r_spec = temp_l - temp_r;
|
*r_spec = ixheaacd_sub32_sat(temp_l , temp_r);
|
||||||
r_spec++;
|
r_spec++;
|
||||||
l_spec++;
|
l_spec++;
|
||||||
}
|
}
|
||||||
|
|
@ -491,7 +491,7 @@ static WORD32 ixheaacd_cplx_pred_upmixing(
|
||||||
|
|
||||||
else {
|
else {
|
||||||
for (k = 0; k < pstr_sfb_info->sfb_width[sfb]; k++, i++) {
|
for (k = 0; k < pstr_sfb_info->sfb_width[sfb]; k++, i++) {
|
||||||
dmx_re[i] = (l_spec[i] + (factor * r_spec[i])) >> 1;
|
dmx_re[i] = (WORD32)(((WORD64)l_spec[i] + ((WORD64)factor * (WORD64)r_spec[i])) >> 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -541,12 +541,12 @@ static WORD32 ixheaacd_cplx_pred_upmixing(
|
||||||
if (cplx_pred_used[grp][sfb]) {
|
if (cplx_pred_used[grp][sfb]) {
|
||||||
for (k = 0; k < pstr_sfb_info->sfb_width[sfb]; k++, i++) {
|
for (k = 0; k < pstr_sfb_info->sfb_width[sfb]; k++, i++) {
|
||||||
WORD32 mid_side =
|
WORD32 mid_side =
|
||||||
r_spec[i] - (WORD32)((WORD64)ixheaacd_mult32x32in64(
|
ixheaacd_sub32_sat(r_spec[i] , (WORD32)((WORD64)ixheaacd_mult32x32in64(
|
||||||
alpha_q_re_temp, l_spec[i]) >>
|
alpha_q_re_temp, l_spec[i]) >>
|
||||||
24);
|
24));
|
||||||
|
|
||||||
r_spec[i] = (factor) * (l_spec[i] - mid_side);
|
r_spec[i] = (factor) * (ixheaacd_sub32_sat(l_spec[i] , mid_side));
|
||||||
l_spec[i] = l_spec[i] + mid_side;
|
l_spec[i] = ixheaacd_add32_sat(l_spec[i] , mid_side);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1154,14 +1154,14 @@ VOID ixheaacd_complex_fft_p2_dec(WORD32 *xr, WORD32 *xi, WORD32 nlength,
|
||||||
x3r = x1r - (x3r << 1);
|
x3r = x1r - (x3r << 1);
|
||||||
x3i = x1i - (x3i << 1);
|
x3i = x1i - (x3i << 1);
|
||||||
|
|
||||||
x0r = x0r + x1r;
|
x0r = ixheaacd_add32_sat(x0r , x1r);
|
||||||
x0i = x0i + x1i;
|
x0i = ixheaacd_add32_sat(x0i , x1i);
|
||||||
x1r = x0r - (x1r << 1);
|
x1r = ixheaacd_sub32_sat(x0r , (x1r << 1));
|
||||||
x1i = x0i - (x1i << 1);
|
x1i = ixheaacd_sub32_sat(x0i , (x1i << 1));
|
||||||
x2r = x2r - x3i;
|
x2r = ixheaacd_sub32_sat(x2r , x3i);
|
||||||
x2i = x2i + x3r;
|
x2i = ixheaacd_add32_sat(x2i , x3r);
|
||||||
x3i = x2r + (x3i << 1);
|
x3i = ixheaacd_add32_sat(x2r , (x3i << 1));
|
||||||
x3r = x2i - (x3r << 1);
|
x3r = ixheaacd_sub32_sat(x2i , (x3r << 1));
|
||||||
|
|
||||||
*data = x0r;
|
*data = x0r;
|
||||||
*(data + 1) = x0i;
|
*(data + 1) = x0i;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include "ixheaacd_sbr_common.h"
|
#include "ixheaacd_sbr_common.h"
|
||||||
#include <ixheaacd_type_def.h>
|
#include <ixheaacd_type_def.h>
|
||||||
|
|
||||||
|
|
@ -52,101 +56,301 @@ WORD32 ixheaacd_samp_rate_table[12] = {92017, 75132, 55426, 46009,
|
||||||
WORD32 ixheaacd_v_offset_40[16] = {3 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1,
|
WORD32 ixheaacd_v_offset_40[16] = {3 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1,
|
||||||
2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1,
|
2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1, 2 + 1,
|
||||||
2 + 1, 2 + 1, 1 + 1, 0};
|
2 + 1, 2 + 1, 1 + 1, 0};
|
||||||
static WORD32 ixheaacd_get_sr_idx_2(WORD32 samplerate) {
|
|
||||||
WORD32 i;
|
static WORD32 ixheaacd_int_div(WORD32 num, WORD32 den) {
|
||||||
for (i = 0; i < 12; i++) {
|
if (den != 0) {
|
||||||
if (ixheaacd_samp_rate_table[i] <= samplerate) break;
|
WORD32 result = 0;
|
||||||
|
WORD32 temp = 0;
|
||||||
|
while (den <= num) {
|
||||||
|
temp = 0;
|
||||||
|
while (num >= (den << (temp + 1))) {
|
||||||
|
temp++;
|
||||||
|
}
|
||||||
|
result = result + (1 << temp);
|
||||||
|
num = num - (den * (1 << temp));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD32 ixheaacd_get_sr_idx_4(WORD32 fs) {
|
|
||||||
if (92017 <= fs) return 0;
|
VOID ixheaacd_aac_shellsort(WORD16 *in, WORD32 n) {
|
||||||
if (75132 <= fs) return 1;
|
WORD32 i, j;
|
||||||
if (55426 <= fs) return 2;
|
WORD32 inc;
|
||||||
if (46009 <= fs) return 3;
|
WORD32 v, w;
|
||||||
if (42000 <= fs) return 4;
|
|
||||||
if (35777 <= fs) return 5;
|
inc = 1;
|
||||||
if (27713 <= fs) return 6;
|
|
||||||
if (23004 <= fs) return 7;
|
do {
|
||||||
if (18783 <= fs) return 8;
|
inc = (((inc << 1) + inc) + 1);
|
||||||
if (00000 <= fs) return 9;
|
} while (inc <= n);
|
||||||
return 0;
|
|
||||||
|
do {
|
||||||
|
inc = (ixheaacd_int_div(inc, 3));
|
||||||
|
for (i = inc; i < n; i++) {
|
||||||
|
v = in[i];
|
||||||
|
j = i;
|
||||||
|
|
||||||
|
while ((w = in[(j - inc)]) > v) {
|
||||||
|
in[j] = w;
|
||||||
|
j = (j - inc);
|
||||||
|
|
||||||
|
if (j < inc) break;
|
||||||
|
}
|
||||||
|
in[j] = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while (inc > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLATFORM_INLINE WORD16 ixheaacd_get_k0(
|
|
||||||
WORD32 sr_idx, WORD16 start_freq, ia_sbr_tables_struct *ptr_sbr_tables) {
|
|
||||||
WORD32 start_min = ptr_sbr_tables->env_extr_tables_ptr->start_min[sr_idx];
|
|
||||||
WORD32 ixheaacd_drc_offset =
|
WORD32
|
||||||
ptr_sbr_tables->env_extr_tables_ptr->offset_idx[sr_idx];
|
ixheaacd_calc_start_band(WORD32 fs, const WORD32 start_freq, FLOAT32 upsamp_fac)
|
||||||
return start_min +
|
{
|
||||||
ptr_sbr_tables->env_extr_tables_ptr
|
WORD32 k0_min;
|
||||||
->ixheaacd_drc_offset[ixheaacd_drc_offset][start_freq];
|
WORD32 fs_mapped = 0;
|
||||||
|
|
||||||
|
if (upsamp_fac == 4) {
|
||||||
|
fs = fs / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fs >= 0 && fs < 18783) {
|
||||||
|
fs_mapped = 16000;
|
||||||
|
}
|
||||||
|
else if (fs >= 18783 && fs < 23004) {
|
||||||
|
fs_mapped = 22050;
|
||||||
|
}
|
||||||
|
else if (fs >= 23004 && fs < 27713) {
|
||||||
|
fs_mapped = 24000;
|
||||||
|
}
|
||||||
|
else if (fs >= 27713 && fs < 35777) {
|
||||||
|
fs_mapped = 32000;
|
||||||
|
}
|
||||||
|
else if (fs >= 35777 && fs < 42000) {
|
||||||
|
fs_mapped = 40000;
|
||||||
|
}
|
||||||
|
else if (fs >= 42000 && fs < 46009) {
|
||||||
|
fs_mapped = 44100;
|
||||||
|
}
|
||||||
|
else if (fs >= 46009 && fs < 55426) {
|
||||||
|
fs_mapped = 48000;
|
||||||
|
}
|
||||||
|
else if (fs >= 55426 && fs < 75132) {
|
||||||
|
fs_mapped = 64000;
|
||||||
|
}
|
||||||
|
else if (fs >= 75132 && fs < 92017) {
|
||||||
|
fs_mapped = 88200;
|
||||||
|
}
|
||||||
|
else if (fs >= 92017) {
|
||||||
|
fs_mapped = 96000;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (upsamp_fac == 4) {
|
||||||
|
if (fs_mapped < 32000) {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(3000 * 2 * 32) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs_mapped < 64000) {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(4000 * 2 * 32) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(5000 * 2 * 32) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs_mapped < 32000) {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(3000 * 2 * 64) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs_mapped < 64000) {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(4000 * 2 * 64) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
k0_min = (WORD32)(((FLOAT32)(5000 * 2 * 64) / fs_mapped) + 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (fs_mapped) {
|
||||||
|
case 16000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 22050:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 24000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 32000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 40000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 44100:
|
||||||
|
case 48000:
|
||||||
|
case 64000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 88200:
|
||||||
|
case 96000:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
WORD32 v_offset[] = { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 };
|
||||||
|
return (k0_min + v_offset[start_freq]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WORD32
|
||||||
|
ixheaacd_calc_stop_band(WORD32 fs, const WORD32 stop_freq, FLOAT32 upsamp_fac)
|
||||||
|
{
|
||||||
|
WORD32 result, i;
|
||||||
|
WORD16 arr_stop_freq[14];
|
||||||
|
WORD32 k1_min;
|
||||||
|
WORD16 arr_diff_stop_freq[13];
|
||||||
|
|
||||||
|
if (upsamp_fac == 4) {
|
||||||
|
fs = fs / 2;
|
||||||
|
if (fs < 32000) {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(6000 * 2 * 32) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs < 64000) {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(8000 * 2 * 32) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(10000 * 2 * 32) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs < 32000) {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(6000 * 2 * 64) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fs < 64000) {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(8000 * 2 * 64) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
k1_min = (WORD32)(((FLOAT32)(10000 * 2 * 64) / fs) + 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Calculate stop frequency vector*/
|
||||||
|
for (i = 0; i <= 13; i++) {
|
||||||
|
arr_stop_freq[i] = (WORD32)(k1_min * pow(64.0 / k1_min, i / 13.0) + 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*Ensure increasing bandwidth */
|
||||||
|
for (i = 0; i <= 12; i++) {
|
||||||
|
arr_diff_stop_freq[i] = arr_stop_freq[i + 1] - arr_stop_freq[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
ixheaacd_aac_shellsort(&arr_diff_stop_freq[0], 13); /*Sort bandwidth changes */
|
||||||
|
|
||||||
|
result = k1_min;
|
||||||
|
for (i = 0; i<stop_freq; i++) {
|
||||||
|
result = result + arr_diff_stop_freq[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
void
|
||||||
|
ixheaacd_calc_k0_k2_bands(const WORD32 samp_freq,
|
||||||
|
const WORD32 start_freq,
|
||||||
|
const WORD32 stop_freq,
|
||||||
|
FLOAT32 upsamp_fac,
|
||||||
|
WORD16 *ptr_k0,
|
||||||
|
WORD16 *ptr_k2)
|
||||||
|
{
|
||||||
|
/* Update start_freq struct */
|
||||||
|
*ptr_k0 = ixheaacd_calc_start_band(samp_freq, start_freq, upsamp_fac);
|
||||||
|
|
||||||
|
|
||||||
|
/*Update stop_freq struct */
|
||||||
|
if (stop_freq < 14) {
|
||||||
|
*ptr_k2 = ixheaacd_calc_stop_band(samp_freq, stop_freq, upsamp_fac);
|
||||||
|
}
|
||||||
|
else if (stop_freq == 14) {
|
||||||
|
*ptr_k2 = 2 * (*ptr_k0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*ptr_k2 = 3 * (*ptr_k0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* limit to Nyqvist */
|
||||||
|
if (*ptr_k2 > 64) {
|
||||||
|
*ptr_k2 = 64;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD16 ixheaacd_calc_master_frq_bnd_tbl(
|
WORD16 ixheaacd_calc_master_frq_bnd_tbl(
|
||||||
ia_freq_band_data_struct *pstr_freq_band_data,
|
ia_freq_band_data_struct *pstr_freq_band_data,
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ia_sbr_tables_struct *ptr_sbr_tables,
|
|
||||||
ixheaacd_misc_tables *pstr_common_tables) {
|
ixheaacd_misc_tables *pstr_common_tables) {
|
||||||
WORD32 k;
|
WORD32 k;
|
||||||
WORD32 fs = ptr_header_data->out_sampling_freq;
|
WORD32 fs = ptr_header_data->out_sampling_freq;
|
||||||
WORD16 bands;
|
WORD16 bands;
|
||||||
WORD16 k0, k2, k1;
|
WORD16 k0 = 0, k2 = 0, k1;
|
||||||
WORD32 k2_achived;
|
WORD32 k2_achived;
|
||||||
WORD32 k2_diff;
|
WORD32 k2_diff;
|
||||||
WORD32 incr;
|
WORD32 incr;
|
||||||
WORD32 dk, sr_idx;
|
WORD32 dk;
|
||||||
WORD16 vec_dk[MAX_OCTAVE + MAX_SECOND_REGION];
|
WORD16 vec_dk[MAX_OCTAVE + MAX_SECOND_REGION];
|
||||||
WORD16 *vec_dk0 = &vec_dk[0];
|
WORD16 *vec_dk0 = &vec_dk[0];
|
||||||
WORD16 *vec_dk1 = &vec_dk[MAX_OCTAVE];
|
WORD16 *vec_dk1 = &vec_dk[MAX_OCTAVE];
|
||||||
WORD16 upsamp_fac = ptr_header_data->upsamp_fac;
|
WORD16 upsamp_fac = ptr_header_data->upsamp_fac;
|
||||||
WORD16 *f_master_tbl = pstr_freq_band_data->f_master_tbl;
|
WORD16 *f_master_tbl = pstr_freq_band_data->f_master_tbl;
|
||||||
WORD16 num_mf_bands;
|
WORD16 num_mf_bands;
|
||||||
WORD32 usac_flag = ptr_header_data->usac_flag;
|
|
||||||
|
|
||||||
k1 = 0;
|
k1 = 0;
|
||||||
incr = 0;
|
incr = 0;
|
||||||
dk = 0;
|
dk = 0;
|
||||||
|
|
||||||
if (upsamp_fac == 4) {
|
|
||||||
fs = fs / 2;
|
|
||||||
sr_idx = ixheaacd_get_sr_idx_4(fs);
|
|
||||||
k0 = pstr_common_tables->start_band[sr_idx][ptr_header_data->start_freq];
|
|
||||||
} else {
|
|
||||||
sr_idx = ixheaacd_get_sr_idx_2(fs);
|
|
||||||
k0 = ixheaacd_get_k0(sr_idx, ptr_header_data->start_freq, ptr_sbr_tables);
|
|
||||||
if (usac_flag && fs == 40000) {
|
|
||||||
k0 = k0 + ixheaacd_v_offset_40[ptr_header_data->start_freq];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ptr_header_data->stop_freq < 14) {
|
ixheaacd_calc_k0_k2_bands(fs,
|
||||||
if (upsamp_fac == 4) {
|
ptr_header_data->start_freq,
|
||||||
k2 = pstr_common_tables->stop_band[sr_idx][ptr_header_data->stop_freq];
|
ptr_header_data->stop_freq,
|
||||||
k2 = (WORD16)ixheaacd_min32(64, k2);
|
upsamp_fac,
|
||||||
if (fs == 20000) {
|
&k0, &k2);
|
||||||
k2 = pstr_common_tables
|
|
||||||
->stop_freq_table_fs40k_4[ptr_header_data->stop_freq];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
WORD32 stop_minv = ptr_sbr_tables->env_extr_tables_ptr->stop_min[sr_idx];
|
|
||||||
k2 = (WORD16)ixheaacd_min32(
|
|
||||||
64, stop_minv +
|
|
||||||
ptr_sbr_tables->env_extr_tables_ptr
|
|
||||||
->stop_off[sr_idx][ptr_header_data->stop_freq]);
|
|
||||||
if (usac_flag && fs == 40000) {
|
|
||||||
k2 = pstr_common_tables
|
|
||||||
->stop_freq_table_fs40k_2[ptr_header_data->stop_freq];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (ptr_header_data->stop_freq == 14)
|
|
||||||
k2 = ixheaacd_shl16(k0, 1);
|
|
||||||
else
|
|
||||||
k2 = add_d(ixheaacd_shl16(k0, 1), k0);
|
|
||||||
}
|
|
||||||
if (k2 > NO_SYNTHESIS_CHANNELS) {
|
if (k2 > NO_SYNTHESIS_CHANNELS) {
|
||||||
k2 = NO_SYNTHESIS_CHANNELS;
|
k2 = NO_SYNTHESIS_CHANNELS;
|
||||||
}
|
}
|
||||||
|
|
@ -440,53 +644,6 @@ static VOID ixheaacd_derive_hi_lo_freq_bnd_tbls(
|
||||||
pstr_freq_band_data->num_sf_bands[HIGH] = num_hf_bands;
|
pstr_freq_band_data->num_sf_bands[HIGH] = num_hf_bands;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD32 ixheaacd_int_div(WORD32 num, WORD32 den) {
|
|
||||||
if (den != 0) {
|
|
||||||
WORD32 result = 0;
|
|
||||||
WORD32 temp = 0;
|
|
||||||
while (den <= num) {
|
|
||||||
temp = 0;
|
|
||||||
while (num >= (den << (temp + 1))) {
|
|
||||||
temp++;
|
|
||||||
}
|
|
||||||
result = result + (1 << temp);
|
|
||||||
num = num - (den * (1 << temp));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ixheaacd_aac_shellsort(WORD16 *in, WORD32 n) {
|
|
||||||
WORD32 i, j;
|
|
||||||
WORD32 inc;
|
|
||||||
WORD32 v, w;
|
|
||||||
|
|
||||||
inc = 1;
|
|
||||||
|
|
||||||
do {
|
|
||||||
inc = (((inc << 1) + inc) + 1);
|
|
||||||
} while (inc <= n);
|
|
||||||
|
|
||||||
do {
|
|
||||||
inc = (ixheaacd_int_div(inc, 3));
|
|
||||||
for (i = inc; i < n; i++) {
|
|
||||||
v = in[i];
|
|
||||||
j = i;
|
|
||||||
|
|
||||||
while ((w = in[(j - inc)]) > v) {
|
|
||||||
in[j] = w;
|
|
||||||
j = (j - inc);
|
|
||||||
|
|
||||||
if (j < inc) break;
|
|
||||||
}
|
|
||||||
in[j] = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while (inc > 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
WORD32 ixheaacd_derive_noise_freq_bnd_tbl(
|
WORD32 ixheaacd_derive_noise_freq_bnd_tbl(
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ixheaacd_misc_tables *pstr_common_tables,
|
ixheaacd_misc_tables *pstr_common_tables,
|
||||||
|
|
@ -544,15 +701,14 @@ WORD32 ixheaacd_derive_noise_freq_bnd_tbl(
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 ixheaacd_calc_frq_bnd_tbls(ia_sbr_header_data_struct *ptr_header_data,
|
WORD32 ixheaacd_calc_frq_bnd_tbls(ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ia_sbr_tables_struct *ptr_sbr_tables,
|
ixheaacd_misc_tables *pstr_common_tables) {
|
||||||
ixheaacd_misc_tables *pstr_common_tables) {
|
|
||||||
WORD32 err;
|
WORD32 err;
|
||||||
WORD16 num_lf_bands, num_hf_bands, lsb, usb;
|
WORD16 num_lf_bands, num_hf_bands, lsb, usb;
|
||||||
ia_freq_band_data_struct *pstr_freq_band_data =
|
ia_freq_band_data_struct *pstr_freq_band_data =
|
||||||
ptr_header_data->pstr_freq_band_data;
|
ptr_header_data->pstr_freq_band_data;
|
||||||
|
|
||||||
err = ixheaacd_calc_master_frq_bnd_tbl(pstr_freq_band_data, ptr_header_data,
|
err = ixheaacd_calc_master_frq_bnd_tbl(pstr_freq_band_data, ptr_header_data,
|
||||||
ptr_sbr_tables, pstr_common_tables);
|
pstr_common_tables);
|
||||||
|
|
||||||
if (err ||
|
if (err ||
|
||||||
(ptr_header_data->xover_band > pstr_freq_band_data->num_mf_bands)) {
|
(ptr_header_data->xover_band > pstr_freq_band_data->num_mf_bands)) {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
VOID ixheaacd_aac_shellsort(WORD16 *in, WORD32 n);
|
VOID ixheaacd_aac_shellsort(WORD16 *in, WORD32 n);
|
||||||
|
|
||||||
WORD32 ixheaacd_calc_frq_bnd_tbls(ia_sbr_header_data_struct *ptr_header_data,
|
WORD32 ixheaacd_calc_frq_bnd_tbls(ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ia_sbr_tables_struct *ptr_sbr_tables,
|
|
||||||
ixheaacd_misc_tables *pstr_common_tables);
|
ixheaacd_misc_tables *pstr_common_tables);
|
||||||
|
|
||||||
VOID ixheaacd_calc_bands(WORD16 *diff, WORD16 start, WORD16 stop,
|
VOID ixheaacd_calc_bands(WORD16 *diff, WORD16 start, WORD16 stop,
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,10 @@ static VOID ixheaacd_synthesis_tool(WORD32 a[], WORD32 x[], WORD32 l,
|
||||||
for (i = 0; i < l; i++) {
|
for (i = 0; i < l; i++) {
|
||||||
s = x[i];
|
s = x[i];
|
||||||
for (j = 1; j <= ORDER; j += 4) {
|
for (j = 1; j <= ORDER; j += 4) {
|
||||||
s -= ixheaacd_mul32_sh(a[j], x[i - j], (WORD8)(qshift));
|
s = ixheaacd_sub32_sat(s,ixheaacd_mul32_sh(a[j], x[i - j], (WORD8)(qshift)));
|
||||||
s -= ixheaacd_mul32_sh(a[j + 1], x[i - (j + 1)], (WORD8)(qshift));
|
s = ixheaacd_sub32_sat(s,ixheaacd_mul32_sh(a[j + 1], x[i - (j + 1)], (WORD8)(qshift)));
|
||||||
s -= ixheaacd_mul32_sh(a[j + 2], x[i - (j + 2)], (WORD8)(qshift));
|
s = ixheaacd_sub32_sat(s,ixheaacd_mul32_sh(a[j + 2], x[i - (j + 2)], (WORD8)(qshift)));
|
||||||
s -= ixheaacd_mul32_sh(a[j + 3], x[i - (j + 3)], (WORD8)(qshift));
|
s = ixheaacd_sub32_sat(s,ixheaacd_mul32_sh(a[j + 3], x[i - (j + 3)], (WORD8)(qshift)));
|
||||||
}
|
}
|
||||||
x[i] = s;
|
x[i] = s;
|
||||||
}
|
}
|
||||||
|
|
@ -125,8 +125,8 @@ WORD32 ixheaacd_fwd_alias_cancel_tool(
|
||||||
fac_signal[i] = (WORD32)(ptr_fac_signal_flt[i] * (1 << (16 - qshift)));
|
fac_signal[i] = (WORD32)(ptr_fac_signal_flt[i] * (1 << (16 - qshift)));
|
||||||
|
|
||||||
for (i = 0; i < fac_length; i++)
|
for (i = 0; i < fac_length; i++)
|
||||||
ptr_overlap_buf[i] +=
|
ptr_overlap_buf[i] =
|
||||||
(WORD32)ixheaacd_mul32_sh(fac_signal[i], gain, (WORD8)(16 - qshift));
|
ixheaacd_add32_sat(ptr_overlap_buf[i],(WORD32)ixheaacd_mul32_sh(fac_signal[i], gain, (WORD8)(16 - qshift)));
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
@ -155,6 +155,19 @@ WORD32 ixheaacd_fr_alias_cnx_fix(WORD32 *x_in, WORD32 len, WORD32 fac_length,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( FAC_LENGTH < fac_length )
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if((1 + (len /2)) < (fac_length + 1))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if( (len/2 + 1) > (2 * LEN_FRAME - fac_length - 1))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (lp_filt_coeff != NULL && fac_data_out != NULL) {
|
if (lp_filt_coeff != NULL && fac_data_out != NULL) {
|
||||||
memset(fac_data_out - 16, 0, ORDER * sizeof(WORD32));
|
memset(fac_data_out - 16, 0, ORDER * sizeof(WORD32));
|
||||||
err = ixheaacd_acelp_mdct(x_in, fac_data_out, preshift, fac_length,
|
err = ixheaacd_acelp_mdct(x_in, fac_data_out, preshift, fac_length,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ixheaacd_type_def.h>
|
#include <ixheaacd_type_def.h>
|
||||||
|
#include "ixheaacd_constants.h"
|
||||||
|
#include <ixheaacd_basic_ops32.h>
|
||||||
|
#include <ixheaacd_basic_ops16.h>
|
||||||
|
#include <ixheaacd_basic_ops40.h>
|
||||||
#include "ixheaacd_sbr_common.h"
|
#include "ixheaacd_sbr_common.h"
|
||||||
|
|
||||||
#include "ixheaacd_bitbuffer.h"
|
#include "ixheaacd_bitbuffer.h"
|
||||||
|
|
@ -610,17 +614,7 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
|
||||||
pstr_audio_specific_config->sampling_frequency;
|
pstr_audio_specific_config->sampling_frequency;
|
||||||
pstr_audio_specific_config->ext_samp_frequency_index =
|
pstr_audio_specific_config->ext_samp_frequency_index =
|
||||||
pstr_audio_specific_config->samp_frequency_index;
|
pstr_audio_specific_config->samp_frequency_index;
|
||||||
if (pstr_audio_specific_config->str_usac_config
|
|
||||||
.core_sbr_framelength_index == 4) {
|
|
||||||
pstr_audio_specific_config->sampling_frequency =
|
|
||||||
pstr_audio_specific_config->ext_sampling_frequency / 4;
|
|
||||||
} else if ((pstr_audio_specific_config->str_usac_config
|
|
||||||
.core_sbr_framelength_index == 2) ||
|
|
||||||
(pstr_audio_specific_config->str_usac_config
|
|
||||||
.core_sbr_framelength_index == 3)) {
|
|
||||||
pstr_audio_specific_config->sampling_frequency =
|
|
||||||
pstr_audio_specific_config->ext_sampling_frequency / 2;
|
|
||||||
}
|
|
||||||
for (i = 0; i < sizeof(ixheaacd_sampl_freq_idx_table) /
|
for (i = 0; i < sizeof(ixheaacd_sampl_freq_idx_table) /
|
||||||
sizeof(ixheaacd_sampl_freq_idx_table[0]);
|
sizeof(ixheaacd_sampl_freq_idx_table[0]);
|
||||||
i++) {
|
i++) {
|
||||||
|
|
@ -804,10 +798,10 @@ WORD32 ixheaacd_check_if_adts(ia_adts_header_struct *adts,
|
||||||
|
|
||||||
result = ixheaacd_adtsframe(adts, it_bit_buff);
|
result = ixheaacd_adtsframe(adts, it_bit_buff);
|
||||||
|
|
||||||
max_frm_len_per_ch = 768 * (adts->no_raw_data_blocks + 1);
|
max_frm_len_per_ch = ixheaacd_mult32(768 , (adts->no_raw_data_blocks + 1));
|
||||||
|
|
||||||
if (adts->channel_configuration != 0)
|
if (adts->channel_configuration != 0)
|
||||||
max_frm_len_per_ch = max_frm_len_per_ch * adts->channel_configuration;
|
max_frm_len_per_ch = ixheaacd_mult32(max_frm_len_per_ch, adts->channel_configuration);
|
||||||
else
|
else
|
||||||
max_frm_len_per_ch = max_frm_len_per_ch * usr_max_ch;
|
max_frm_len_per_ch = max_frm_len_per_ch * usr_max_ch;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@ extern const FLOAT64 ixheaacd_power_10_table[28];
|
||||||
static WORD32 ixheaacd_calc_max_spectralline(WORD32 *p_in_ibuffer, WORD32 n) {
|
static WORD32 ixheaacd_calc_max_spectralline(WORD32 *p_in_ibuffer, WORD32 n) {
|
||||||
WORD32 k, shiftp, itemp = 0;
|
WORD32 k, shiftp, itemp = 0;
|
||||||
for (k = 0; k < n; k++) {
|
for (k = 0; k < n; k++) {
|
||||||
if (ABS(p_in_ibuffer[k]) > itemp) itemp = ABS(p_in_ibuffer[k]);
|
|
||||||
|
if (ixheaacd_abs32_sat(p_in_ibuffer[k]) > itemp) itemp = ixheaacd_abs32_sat(p_in_ibuffer[k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
shiftp = ixheaacd_norm32(itemp);
|
shiftp = ixheaacd_norm32(itemp);
|
||||||
|
|
@ -106,7 +107,7 @@ void ixheaacd_calc_pre_twid_dec(WORD32 *ptr_x, WORD32 *r_ptr, WORD32 *i_ptr,
|
||||||
ptr_y = &ptr_x[2 * nlength - 1];
|
ptr_y = &ptr_x[2 * nlength - 1];
|
||||||
|
|
||||||
for (i = 0; i < nlength; i++) {
|
for (i = 0; i < nlength; i++) {
|
||||||
*r_ptr++ = ((ixheaacd_mult32(-(*ptr_x), (*cos_ptr)) -
|
*r_ptr++ = ((ixheaacd_mult32(ixheaacd_negate32_sat(*ptr_x), (*cos_ptr)) -
|
||||||
ixheaacd_mult32((*ptr_y), (*sin_ptr))));
|
ixheaacd_mult32((*ptr_y), (*sin_ptr))));
|
||||||
*i_ptr++ = ((ixheaacd_mult32((*ptr_y), (*cos_ptr++)) -
|
*i_ptr++ = ((ixheaacd_mult32((*ptr_y), (*cos_ptr++)) -
|
||||||
ixheaacd_mult32((*ptr_x), (*sin_ptr++))));
|
ixheaacd_mult32((*ptr_x), (*sin_ptr++))));
|
||||||
|
|
@ -398,7 +399,9 @@ static WORD32 ixheaacd_fd_imdct_short(ia_usac_data_struct *usac_data,
|
||||||
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
||||||
p_out_buffer[k] = ((FLOAT32)p_out_ibuffer[k]) * qfac;
|
p_out_buffer[k] = ((FLOAT32)p_out_ibuffer[k]) * qfac;
|
||||||
}
|
}
|
||||||
ixheaacd_lpd_bpf_fix(usac_data, 1, p_out_buffer, st);
|
err_code = ixheaacd_lpd_bpf_fix(usac_data, 1, p_out_buffer, st);
|
||||||
|
if(err_code != 0)
|
||||||
|
return err_code;
|
||||||
|
|
||||||
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
||||||
p_out_ibuffer[k] = (WORD32)(p_out_buffer[k] * (1 << 15));
|
p_out_ibuffer[k] = (WORD32)(p_out_buffer[k] * (1 << 15));
|
||||||
|
|
@ -494,7 +497,9 @@ static WORD32 ixheaacd_fd_imdct_long(ia_usac_data_struct *usac_data,
|
||||||
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
||||||
p_out_buffer[k] = ((FLOAT32)p_out_ibuffer[k]) * qfac;
|
p_out_buffer[k] = ((FLOAT32)p_out_ibuffer[k]) * qfac;
|
||||||
}
|
}
|
||||||
ixheaacd_lpd_bpf_fix(usac_data, 0, p_out_buffer, st);
|
err_code = ixheaacd_lpd_bpf_fix(usac_data, 0, p_out_buffer, st);
|
||||||
|
if(err_code != 0)
|
||||||
|
return err_code;
|
||||||
|
|
||||||
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
for (k = 0; k < ixheaacd_drc_offset->n_long; k++) {
|
||||||
p_out_ibuffer[k] = (WORD32)(p_out_buffer[k] * (1 << 15));
|
p_out_ibuffer[k] = (WORD32)(p_out_buffer[k] * (1 << 15));
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,30 @@ UWORD32 ixheaacd_sbr_ratio(UWORD32 core_sbr_framelength_idx) {
|
||||||
return sbr_ratio_index;
|
return sbr_ratio_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WORD32 ixheaacd_get_sample_freq_indx(WORD32 sampling_freq)
|
||||||
|
{
|
||||||
|
WORD32 sampling_rate_tbl[] = {
|
||||||
|
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025,
|
||||||
|
8000, 7350, 0, 0, 0};
|
||||||
|
|
||||||
|
WORD32 index;
|
||||||
|
WORD32 tbl_size = sizeof(sampling_rate_tbl)/sizeof(WORD32) - 1;
|
||||||
|
|
||||||
|
for (index = 0; index < tbl_size; index++) {
|
||||||
|
if (sampling_rate_tbl[index] == sampling_freq) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index > tbl_size) {
|
||||||
|
return tbl_size - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_framelength_idx,
|
UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_framelength_idx,
|
||||||
WORD32 *output_framelength, WORD32 *block_size,
|
WORD32 *output_framelength, WORD32 *block_size,
|
||||||
WORD32 *output_samples) {
|
WORD32 *output_samples,
|
||||||
|
WORD32 * sample_rate_layer,
|
||||||
|
UWORD32 * sample_freq_indx) {
|
||||||
UWORD32 sbr_ratio_index = 0x0FF;
|
UWORD32 sbr_ratio_index = 0x0FF;
|
||||||
|
|
||||||
*output_framelength = -1;
|
*output_framelength = -1;
|
||||||
|
|
@ -110,21 +131,27 @@ UWORD32 ixheaacd_sbr_params(UWORD32 core_sbr_framelength_idx,
|
||||||
*output_framelength = USAC_OUT_FRAMELENGTH_2048;
|
*output_framelength = USAC_OUT_FRAMELENGTH_2048;
|
||||||
*block_size = 768;
|
*block_size = 768;
|
||||||
*output_samples = (*block_size * 8) / 3;
|
*output_samples = (*block_size * 8) / 3;
|
||||||
|
*sample_rate_layer = (*sample_rate_layer * 3) >> 3;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sbr_ratio_index = USAC_SBR_RATIO_INDEX_2_1;
|
sbr_ratio_index = USAC_SBR_RATIO_INDEX_2_1;
|
||||||
*output_framelength = USAC_OUT_FRAMELENGTH_2048;
|
*output_framelength = USAC_OUT_FRAMELENGTH_2048;
|
||||||
*block_size = 1024;
|
*block_size = 1024;
|
||||||
*output_samples = *block_size * 2;
|
*output_samples = *block_size * 2;
|
||||||
|
*sample_rate_layer = *sample_rate_layer >> 1;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
sbr_ratio_index = USAC_SBR_RATIO_INDEX_4_1;
|
sbr_ratio_index = USAC_SBR_RATIO_INDEX_4_1;
|
||||||
*output_framelength = USAC_OUT_FRAMELENGTH_4096;
|
*output_framelength = USAC_OUT_FRAMELENGTH_4096;
|
||||||
*block_size = 1024;
|
*block_size = 1024;
|
||||||
*output_samples = *block_size * 4;
|
*output_samples = *block_size * 4;
|
||||||
|
*sample_rate_layer = *sample_rate_layer >> 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*sample_freq_indx = ixheaacd_get_sample_freq_indx(*sample_rate_layer);
|
||||||
|
|
||||||
|
|
||||||
return sbr_ratio_index;
|
return sbr_ratio_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,16 +237,13 @@ VOID ixheaacd_sbr_config(ia_bit_buf_struct *it_bit_buff,
|
||||||
WORD32 ixheaacd_ext_element_config(
|
WORD32 ixheaacd_ext_element_config(
|
||||||
ia_bit_buf_struct *it_bit_buff,
|
ia_bit_buf_struct *it_bit_buff,
|
||||||
ia_usac_dec_element_config_struct *pstr_usac_element_config
|
ia_usac_dec_element_config_struct *pstr_usac_element_config
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
,
|
||||||
UWORD8 *ptr_usac_ext_ele_payload, WORD32 *ptr_usac_ext_ele_payload_len
|
UWORD8 *ptr_usac_ext_ele_payload, WORD32 *ptr_usac_ext_ele_payload_len
|
||||||
#endif
|
,WORD32 *preroll_flag
|
||||||
) {
|
) {
|
||||||
UWORD32 usac_ext_element_type, usac_ext_element_config_length, flag;
|
UWORD32 usac_ext_element_type, usac_ext_element_config_length, flag;
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
UWORD32 i;
|
UWORD32 i;
|
||||||
#endif
|
|
||||||
|
|
||||||
ixheaacd_read_escape_value(it_bit_buff, &(usac_ext_element_type), 4, 8, 16);
|
ixheaacd_read_escape_value(it_bit_buff, &(usac_ext_element_type), 4, 8, 16);
|
||||||
|
|
||||||
|
|
@ -228,9 +252,7 @@ WORD32 ixheaacd_ext_element_config(
|
||||||
|
|
||||||
flag = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
flag = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
*ptr_usac_ext_ele_payload_len = 0;
|
*ptr_usac_ext_ele_payload_len = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
ixheaacd_read_escape_value(
|
ixheaacd_read_escape_value(
|
||||||
|
|
@ -249,8 +271,8 @@ WORD32 ixheaacd_ext_element_config(
|
||||||
switch (usac_ext_element_type) {
|
switch (usac_ext_element_type) {
|
||||||
case ID_EXT_ELE_FILL:
|
case ID_EXT_ELE_FILL:
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
case ID_EXT_ELE_AUDIOPREROLL:
|
case ID_EXT_ELE_AUDIOPREROLL:
|
||||||
|
*preroll_flag=1;
|
||||||
break;
|
break;
|
||||||
case ID_EXT_ELE_UNI_DRC:
|
case ID_EXT_ELE_UNI_DRC:
|
||||||
for (i = 0; i < usac_ext_element_config_length; i++) {
|
for (i = 0; i < usac_ext_element_config_length; i++) {
|
||||||
|
|
@ -258,7 +280,6 @@ WORD32 ixheaacd_ext_element_config(
|
||||||
}
|
}
|
||||||
*ptr_usac_ext_ele_payload_len = usac_ext_element_config_length;
|
*ptr_usac_ext_ele_payload_len = usac_ext_element_config_length;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((it_bit_buff->cnt_bits >> 3) < (WORD32)usac_ext_element_config_length)
|
if ((it_bit_buff->cnt_bits >> 3) < (WORD32)usac_ext_element_config_length)
|
||||||
|
|
@ -352,6 +373,7 @@ WORD32 ixheaacd_decoder_config(
|
||||||
ixheaacd_read_escape_value(
|
ixheaacd_read_escape_value(
|
||||||
it_bit_buff, &(pstr_usac_decoder_config->num_elements), 4, 8, 16);
|
it_bit_buff, &(pstr_usac_decoder_config->num_elements), 4, 8, 16);
|
||||||
pstr_usac_decoder_config->num_elements += 1;
|
pstr_usac_decoder_config->num_elements += 1;
|
||||||
|
pstr_usac_decoder_config->preroll_flag=0;
|
||||||
|
|
||||||
if (pstr_usac_decoder_config->num_elements > USAC_MAX_ELEMENTS) {
|
if (pstr_usac_decoder_config->num_elements > USAC_MAX_ELEMENTS) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -393,20 +415,17 @@ WORD32 ixheaacd_decoder_config(
|
||||||
case ID_USAC_EXT:
|
case ID_USAC_EXT:
|
||||||
err = ixheaacd_ext_element_config(
|
err = ixheaacd_ext_element_config(
|
||||||
it_bit_buff, pstr_usac_element_config
|
it_bit_buff, pstr_usac_element_config
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
,
|
||||||
&pstr_usac_decoder_config->usac_ext_ele_payload_buf[elem_idx][0],
|
&pstr_usac_decoder_config->usac_ext_ele_payload_buf[elem_idx][0],
|
||||||
&pstr_usac_decoder_config->usac_ext_ele_payload_len[elem_idx]
|
&pstr_usac_decoder_config->usac_ext_ele_payload_len[elem_idx]
|
||||||
#endif
|
,&(pstr_usac_decoder_config->preroll_flag)
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
if (pstr_usac_decoder_config->usac_ext_ele_payload_len[elem_idx] > 0) {
|
if (pstr_usac_decoder_config->usac_ext_ele_payload_len[elem_idx] > 0) {
|
||||||
pstr_usac_decoder_config->usac_ext_ele_payload_present[elem_idx] = 1;
|
pstr_usac_decoder_config->usac_ext_ele_payload_present[elem_idx] = 1;
|
||||||
} else {
|
} else {
|
||||||
pstr_usac_decoder_config->usac_ext_ele_payload_present[elem_idx] = 0;
|
pstr_usac_decoder_config->usac_ext_ele_payload_present[elem_idx] = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (err != 0) return -1;
|
if (err != 0) return -1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -418,11 +437,8 @@ WORD32 ixheaacd_decoder_config(
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD32 ixheaacd_config_extension(
|
WORD32 ixheaacd_config_extension(
|
||||||
ia_bit_buf_struct *it_bit_buff
|
ia_bit_buf_struct *it_bit_buff,
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
|
||||||
ia_usac_decoder_config_struct *pstr_usac_decoder_config
|
ia_usac_decoder_config_struct *pstr_usac_decoder_config
|
||||||
#endif
|
|
||||||
) {
|
) {
|
||||||
UWORD32 i, j;
|
UWORD32 i, j;
|
||||||
UWORD32 num_config_extensions;
|
UWORD32 num_config_extensions;
|
||||||
|
|
@ -434,13 +450,11 @@ WORD32 ixheaacd_config_extension(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
pstr_usac_decoder_config->num_config_extensions = num_config_extensions;
|
pstr_usac_decoder_config->num_config_extensions = num_config_extensions;
|
||||||
memset(pstr_usac_decoder_config->usac_cfg_ext_info_len, 0,
|
memset(pstr_usac_decoder_config->usac_cfg_ext_info_len, 0,
|
||||||
USAC_MAX_CONFIG_EXTENSIONS * sizeof(WORD32));
|
USAC_MAX_CONFIG_EXTENSIONS * sizeof(WORD32));
|
||||||
memset(pstr_usac_decoder_config->usac_cfg_ext_info_present, 0,
|
memset(pstr_usac_decoder_config->usac_cfg_ext_info_present, 0,
|
||||||
USAC_MAX_CONFIG_EXTENSIONS * sizeof(WORD32));
|
USAC_MAX_CONFIG_EXTENSIONS * sizeof(WORD32));
|
||||||
#endif
|
|
||||||
|
|
||||||
for (j = 0; j < num_config_extensions; j++) {
|
for (j = 0; j < num_config_extensions; j++) {
|
||||||
UWORD32 tmp;
|
UWORD32 tmp;
|
||||||
|
|
@ -460,7 +474,6 @@ WORD32 ixheaacd_config_extension(
|
||||||
if ((WORD32)usac_config_ext_len > (it_bit_buff->cnt_bits >> 3)) {
|
if ((WORD32)usac_config_ext_len > (it_bit_buff->cnt_bits >> 3)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
if (ID_CONFIG_EXT_LOUDNESS_INFO == usac_config_ext_type) {
|
if (ID_CONFIG_EXT_LOUDNESS_INFO == usac_config_ext_type) {
|
||||||
for (i = 0; i < usac_config_ext_len; i++) {
|
for (i = 0; i < usac_config_ext_len; i++) {
|
||||||
UWORD8 byte_val = ixheaacd_read_bits_buf(it_bit_buff, 8);
|
UWORD8 byte_val = ixheaacd_read_bits_buf(it_bit_buff, 8);
|
||||||
|
|
@ -470,12 +483,9 @@ WORD32 ixheaacd_config_extension(
|
||||||
usac_config_ext_len;
|
usac_config_ext_len;
|
||||||
pstr_usac_decoder_config->usac_cfg_ext_info_present[j] = 1;
|
pstr_usac_decoder_config->usac_cfg_ext_info_present[j] = 1;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
for (i = 0; i < usac_config_ext_len; i++)
|
for (i = 0; i < usac_config_ext_len; i++)
|
||||||
tmp = ixheaacd_read_bits_buf(it_bit_buff, 8);
|
tmp = ixheaacd_read_bits_buf(it_bit_buff, 8);
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -530,11 +540,8 @@ WORD32 ixheaacd_config(ia_bit_buf_struct *it_bit_buff,
|
||||||
tmp = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
tmp = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
||||||
|
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
err = ixheaacd_config_extension(it_bit_buff
|
err = ixheaacd_config_extension(it_bit_buff,
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
|
||||||
&pstr_usac_conf->str_usac_dec_config
|
&pstr_usac_conf->str_usac_dec_config
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
if (err != 0) return -1;
|
if (err != 0) return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ static VOID ixheaacd_lsf_2_lsp_conversion_float(FLOAT32 lsf[], FLOAT32 lsp[],
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID ixheaacd_bass_post_filter(FLOAT32 *synth_sig, WORD32 *pitch,
|
static WORD32 ixheaacd_bass_post_filter(FLOAT32 *synth_sig, WORD32 *pitch,
|
||||||
FLOAT32 *pitch_gain, FLOAT32 *synth_out,
|
FLOAT32 *pitch_gain, FLOAT32 *synth_out,
|
||||||
WORD32 len_fr, WORD32 len2,
|
WORD32 len_fr, WORD32 len2,
|
||||||
FLOAT32 bpf_prev[]) {
|
FLOAT32 bpf_prev[]) {
|
||||||
|
|
@ -223,7 +223,8 @@ static VOID ixheaacd_bass_post_filter(FLOAT32 *synth_sig, WORD32 *pitch,
|
||||||
for (num_subfr = 0; num_subfr < len_fr; num_subfr += LEN_SUBFR, sf++) {
|
for (num_subfr = 0; num_subfr < len_fr; num_subfr += LEN_SUBFR, sf++) {
|
||||||
pitch_lag = pitch[sf];
|
pitch_lag = pitch[sf];
|
||||||
gain = pitch_gain[sf];
|
gain = pitch_gain[sf];
|
||||||
|
if(((pitch_lag >> 1) + 96 - num_subfr) > MAX_PITCH)
|
||||||
|
return -1;
|
||||||
if (gain > 1.0f) gain = 1.0f;
|
if (gain > 1.0f) gain = 1.0f;
|
||||||
if (gain < 0.0f) gain = 0.0f;
|
if (gain < 0.0f) gain = 0.0f;
|
||||||
|
|
||||||
|
|
@ -290,7 +291,7 @@ static VOID ixheaacd_bass_post_filter(FLOAT32 *synth_sig, WORD32 *pitch,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ixheaacd_reorder_lsf(float *lsf, float min_dist, int n) {
|
void ixheaacd_reorder_lsf(float *lsf, float min_dist, int n) {
|
||||||
|
|
@ -600,10 +601,10 @@ WORD32 ixheaacd_lpd_dec(ia_usac_data_struct *usac_data,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod[3] == 0) {
|
if (mod[3] == 0) {
|
||||||
ixheaacd_bass_post_filter(synth, pitch, pitch_gain, fsynth, len_fr,
|
err = ixheaacd_bass_post_filter(synth, pitch, pitch_gain, fsynth, len_fr,
|
||||||
synth_delay, st->bpf_prev);
|
synth_delay, st->bpf_prev);
|
||||||
} else {
|
} else {
|
||||||
ixheaacd_bass_post_filter(synth, pitch, pitch_gain, fsynth, len_fr,
|
err = ixheaacd_bass_post_filter(synth, pitch, pitch_gain, fsynth, len_fr,
|
||||||
synth_delay - (len_subfrm / 2), st->bpf_prev);
|
synth_delay - (len_subfrm / 2), st->bpf_prev);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -653,7 +654,7 @@ WORD32 ixheaacd_lpd_dec_update(ia_usac_lpd_decoder_handle tddec,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short_flag,
|
WORD32 ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short_flag,
|
||||||
FLOAT32 out_buffer[], ia_usac_lpd_decoder_handle st) {
|
FLOAT32 out_buffer[], ia_usac_lpd_decoder_handle st) {
|
||||||
WORD32 i, tp, k;
|
WORD32 i, tp, k;
|
||||||
float synth_buf[MAX_PITCH + SYNTH_DELAY_LMAX + LEN_SUPERFRAME];
|
float synth_buf[MAX_PITCH + SYNTH_DELAY_LMAX + LEN_SUPERFRAME];
|
||||||
|
|
@ -662,6 +663,7 @@ void ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short_flag,
|
||||||
WORD32 pitch[NUM_SUBFR_SUPERFRAME_BY2 + 3];
|
WORD32 pitch[NUM_SUBFR_SUPERFRAME_BY2 + 3];
|
||||||
float pitch_gain[NUM_SUBFR_SUPERFRAME_BY2 + 3];
|
float pitch_gain[NUM_SUBFR_SUPERFRAME_BY2 + 3];
|
||||||
WORD32 len_fr, lpd_sbf_len, lpd_delay, num_subfr_by2, synth_delay, fac_length;
|
WORD32 len_fr, lpd_sbf_len, lpd_delay, num_subfr_by2, synth_delay, fac_length;
|
||||||
|
WORD32 err = 0;
|
||||||
|
|
||||||
len_fr = usac_data->ccfl;
|
len_fr = usac_data->ccfl;
|
||||||
lpd_sbf_len = (NUM_FRAMES * usac_data->num_subfrm) / 2;
|
lpd_sbf_len = (NUM_FRAMES * usac_data->num_subfrm) / 2;
|
||||||
|
|
@ -709,12 +711,14 @@ void ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short_flag,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ixheaacd_bass_post_filter(synth, pitch, pitch_gain, signal_out,
|
err = ixheaacd_bass_post_filter(synth, pitch, pitch_gain, signal_out,
|
||||||
(lpd_sbf_len + 2) * LEN_SUBFR + LEN_SUBFR,
|
(lpd_sbf_len + 2) * LEN_SUBFR + LEN_SUBFR,
|
||||||
len_fr - (lpd_sbf_len + 2) * LEN_SUBFR,
|
len_fr - (lpd_sbf_len + 2) * LEN_SUBFR,
|
||||||
st->bpf_prev);
|
st->bpf_prev);
|
||||||
|
if(err != 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
ixheaacd_mem_cpy(signal_out, out_buffer,
|
ixheaacd_mem_cpy(signal_out, out_buffer,
|
||||||
(lpd_sbf_len + 2) * LEN_SUBFR + LEN_SUBFR);
|
(lpd_sbf_len + 2) * LEN_SUBFR + LEN_SUBFR);
|
||||||
return;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD16 *out,
|
||||||
ixheaacd_mult32x16in32(coef[SIZE08 + i], window_long[2 * i]),
|
ixheaacd_mult32x16in32(coef[SIZE08 + i], window_long[2 * i]),
|
||||||
(q_shift + 1));
|
(q_shift + 1));
|
||||||
|
|
||||||
accu = temp1 + ((WORD32)prev[i] << 16);
|
accu = ixheaacd_add32_sat(temp1 , ((WORD32)prev[i] << 16));
|
||||||
out[ch_fac * i] = ixheaacd_round16(accu << 1);
|
out[ch_fac * i] = ixheaacd_round16(accu << 1);
|
||||||
|
|
||||||
accu = ixheaacd_shl32_dir_sat_limit(
|
accu = ixheaacd_shl32_dir_sat_limit(
|
||||||
|
|
@ -192,9 +192,9 @@ VOID ixheaacd_process_win_seq(WORD32 *coef, WORD32 *prev, WORD16 *out,
|
||||||
*out1 = ixheaacd_round16(accu << 2);
|
*out1 = ixheaacd_round16(accu << 2);
|
||||||
out1 += ch_fac;
|
out1 += ch_fac;
|
||||||
|
|
||||||
accu = (ixheaacd_shl32_dir_sat_limit(
|
accu = ixheaacd_sub32_sat(ixheaacd_shl32_dir_sat_limit(
|
||||||
ixheaacd_mult32x16in32(ixheaacd_negate32_sat(temp_coef), win2),
|
ixheaacd_mult32x16in32(ixheaacd_negate32_sat(temp_coef), win2),
|
||||||
q_shift) -
|
q_shift),
|
||||||
ixheaacd_mult32x16in32_drc(prev1, win4));
|
ixheaacd_mult32x16in32_drc(prev1, win4));
|
||||||
*out2 = ixheaacd_round16(accu << 2);
|
*out2 = ixheaacd_round16(accu << 2);
|
||||||
out2 -= ch_fac;
|
out2 -= ch_fac;
|
||||||
|
|
@ -414,10 +414,12 @@ VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
|
||||||
case LONG_STOP_SEQUENCE:
|
case LONG_STOP_SEQUENCE:
|
||||||
|
|
||||||
if (1024 == ptr_ics_info->frame_length) {
|
if (1024 == ptr_ics_info->frame_length) {
|
||||||
|
ia_ics_info_struct *tmp_ptr_ics_info = ptr_ics_info;
|
||||||
(*ixheaacd_post_twid_overlap_add)(
|
(*ixheaacd_post_twid_overlap_add)(
|
||||||
out_samples, ptr_spec_coeff,
|
out_samples, ptr_spec_coeff,
|
||||||
ptr_aac_tables->pstr_imdct_tables, 1024, ptr_overlap_buf,
|
ptr_aac_tables->pstr_imdct_tables, 1024, ptr_overlap_buf,
|
||||||
q_shift, ptr_long_window, ch_fac);
|
q_shift, ptr_long_window, ch_fac);
|
||||||
|
ptr_ics_info = tmp_ptr_ics_info;
|
||||||
}
|
}
|
||||||
if ((512 == ptr_ics_info->frame_length) ||
|
if ((512 == ptr_ics_info->frame_length) ||
|
||||||
(480 == ptr_ics_info->frame_length)) {
|
(480 == ptr_ics_info->frame_length)) {
|
||||||
|
|
|
||||||
|
|
@ -985,7 +985,7 @@ VOID ixheaacd_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
|
||||||
ixheaacd_mult32(cov_matrix.phi_02, cov_matrix.phi_11))) >>
|
ixheaacd_mult32(cov_matrix.phi_02, cov_matrix.phi_11))) >>
|
||||||
(LPC_SCALE_FACTOR - 1);
|
(LPC_SCALE_FACTOR - 1);
|
||||||
tmp_i = (ixheaacd_sub32_sat(
|
tmp_i = (ixheaacd_sub32_sat(
|
||||||
ixheaacd_add32(
|
ixheaacd_add32_sat(
|
||||||
ixheaacd_mult32(cov_matrix.phi_01_im, cov_matrix.phi_12),
|
ixheaacd_mult32(cov_matrix.phi_01_im, cov_matrix.phi_12),
|
||||||
ixheaacd_mult32(cov_matrix.phi_01, cov_matrix.phi_12_im)),
|
ixheaacd_mult32(cov_matrix.phi_01, cov_matrix.phi_12_im)),
|
||||||
ixheaacd_mult32(cov_matrix.phi_02_im, cov_matrix.phi_11))) >>
|
ixheaacd_mult32(cov_matrix.phi_02_im, cov_matrix.phi_11))) >>
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ WORD32 ixheaacd_fwd_alias_cancel_tool(
|
||||||
ia_usac_data_struct *usac_data, ia_td_frame_data_struct *pstr_td_frame_data,
|
ia_usac_data_struct *usac_data, ia_td_frame_data_struct *pstr_td_frame_data,
|
||||||
WORD32 fac_length, FLOAT32 *iaq, WORD32 gain);
|
WORD32 fac_length, FLOAT32 *iaq, WORD32 gain);
|
||||||
|
|
||||||
VOID ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short,
|
WORD32 ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short,
|
||||||
FLOAT32 out_buffer[], ia_usac_lpd_decoder_handle st);
|
FLOAT32 out_buffer[], ia_usac_lpd_decoder_handle st);
|
||||||
|
|
||||||
VOID ixheaacd_reset_acelp_data_fix(ia_usac_data_struct *usac_data,
|
VOID ixheaacd_reset_acelp_data_fix(ia_usac_data_struct *usac_data,
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,12 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* 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;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -79,21 +79,19 @@ extern ia_huff_cld_nodes_struct ixheaacd_huff_cld_nodes;
|
||||||
extern ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes;
|
extern ia_huff_icc_nodes_struct ixheaacd_huff_icc_nodes;
|
||||||
extern ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes;
|
extern ia_huff_res_nodes_struct ixheaacd_huff_reshape_nodes;
|
||||||
|
|
||||||
ia_mps_dec_state_struct* ixheaacd_mps_create(
|
VOID ixheaacd_mps_create(ia_mps_dec_state_struct* self,
|
||||||
WORD32 bs_frame_len, WORD32 residual_coding,
|
WORD32 bs_frame_len, WORD32 residual_coding,
|
||||||
ia_usac_dec_mps_config_struct* mps212_config) {
|
ia_usac_dec_mps_config_struct* mps212_config) {
|
||||||
WORD32 num_ch;
|
WORD32 num_ch;
|
||||||
WORD32 err_code = 0;
|
WORD32 err_code = 0;
|
||||||
|
|
||||||
ia_mps_dec_state_struct* self = NULL;
|
|
||||||
ia_mps_bs_frame bs_frame;
|
ia_mps_bs_frame bs_frame;
|
||||||
|
|
||||||
self = (ia_mps_dec_state_struct*)calloc(1, sizeof(ia_mps_dec_state_struct));
|
|
||||||
if (self == NULL) return 0;
|
|
||||||
|
|
||||||
self->num_parameter_sets = 1;
|
self->num_parameter_sets = 1;
|
||||||
self->qmf_band_count = 64;
|
self->qmf_band_count = 64;
|
||||||
|
|
||||||
|
self->res_ch_count = 0;
|
||||||
|
|
||||||
if (mps212_config) {
|
if (mps212_config) {
|
||||||
self->config = mps212_config;
|
self->config = mps212_config;
|
||||||
self->frame_length = bs_frame_len;
|
self->frame_length = bs_frame_len;
|
||||||
|
|
@ -111,11 +109,6 @@ ia_mps_dec_state_struct* ixheaacd_mps_create(
|
||||||
|
|
||||||
err_code = ixheaacd_mps_header_decode(self);
|
err_code = ixheaacd_mps_header_decode(self);
|
||||||
|
|
||||||
if (err_code == -1) {
|
|
||||||
free(self);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((self->residual_coding) && (self->res_bands > 0)) self->res_ch_count++;
|
if ((self->residual_coding) && (self->res_bands > 0)) self->res_ch_count++;
|
||||||
|
|
||||||
ixheaacd_mps_env_init(self);
|
ixheaacd_mps_env_init(self);
|
||||||
|
|
@ -154,7 +147,7 @@ ia_mps_dec_state_struct* ixheaacd_mps_create(
|
||||||
memset(self->opd_smooth.smooth_r_phase, 0,
|
memset(self->opd_smooth.smooth_r_phase, 0,
|
||||||
MAX_PARAMETER_BANDS * sizeof(WORD32));
|
MAX_PARAMETER_BANDS * sizeof(WORD32));
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FLOAT32 ixheaacd_tsd_mul_re[] = {
|
static FLOAT32 ixheaacd_tsd_mul_re[] = {
|
||||||
|
|
@ -278,12 +271,13 @@ VOID ixheaacd_mps_create_w(ia_mps_dec_state_struct* self) {
|
||||||
ixheaacd_mps_decor(self);
|
ixheaacd_mps_decor(self);
|
||||||
ixheaacd_mps_mix_res_decor(self);
|
ixheaacd_mps_mix_res_decor(self);
|
||||||
}
|
}
|
||||||
VOID ixheaacd_mps_apply(ia_mps_dec_state_struct* self,
|
WORD32 ixheaacd_mps_apply(ia_mps_dec_state_struct* self,
|
||||||
FLOAT32** input_buffer[4],
|
FLOAT32** input_buffer[4],
|
||||||
FLOAT32 (*output_buffer)[4096]) {
|
FLOAT32 (*output_buffer)[4096]) {
|
||||||
WORD32 ch, ts, qs;
|
WORD32 ch, ts, qs;
|
||||||
WORD32 time_slots = self->time_slots;
|
WORD32 time_slots = self->time_slots;
|
||||||
WORD32 in_ch_count = self->in_ch_count + self->res_ch_count;
|
WORD32 in_ch_count = self->in_ch_count + self->res_ch_count;
|
||||||
|
WORD32 err = 0;
|
||||||
|
|
||||||
self->output_buffer = output_buffer;
|
self->output_buffer = output_buffer;
|
||||||
|
|
||||||
|
|
@ -302,7 +296,7 @@ VOID ixheaacd_mps_apply(ia_mps_dec_state_struct* self,
|
||||||
|
|
||||||
self->present_time_slot += time_slots;
|
self->present_time_slot += time_slots;
|
||||||
|
|
||||||
if (self->present_time_slot < self->time_slots) return;
|
if (self->present_time_slot < self->time_slots) return 0;
|
||||||
|
|
||||||
self->present_time_slot = 0;
|
self->present_time_slot = 0;
|
||||||
|
|
||||||
|
|
@ -324,9 +318,12 @@ VOID ixheaacd_mps_apply(ia_mps_dec_state_struct* self,
|
||||||
ixheaacd_mps_time_env_shaping(self);
|
ixheaacd_mps_time_env_shaping(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
ixheaacd_mps_temp_process(self);
|
err = ixheaacd_mps_temp_process(self);
|
||||||
|
if(err)
|
||||||
|
return err;
|
||||||
|
|
||||||
self->parse_nxt_frame = 1;
|
self->parse_nxt_frame = 1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ VOID ixheaacd_mps_time_env_shaping(ia_mps_dec_state_struct *self);
|
||||||
VOID ixheaacd_mps_pre_matrix_mix_matrix_smoothing(
|
VOID ixheaacd_mps_pre_matrix_mix_matrix_smoothing(
|
||||||
ia_mps_dec_state_struct *self);
|
ia_mps_dec_state_struct *self);
|
||||||
VOID ixheaacd_mps_smoothing_opd(ia_mps_dec_state_struct *self);
|
VOID ixheaacd_mps_smoothing_opd(ia_mps_dec_state_struct *self);
|
||||||
VOID ixheaacd_mps_temp_process(ia_mps_dec_state_struct *self);
|
WORD32 ixheaacd_mps_temp_process(ia_mps_dec_state_struct *self);
|
||||||
|
|
||||||
VOID ixheaacd_mps_par2umx_ps(ia_mps_dec_state_struct *self,
|
VOID ixheaacd_mps_par2umx_ps(ia_mps_dec_state_struct *self,
|
||||||
ia_mps_bs_frame *curr_bit_stream, WORD32 *h_real,
|
ia_mps_bs_frame *curr_bit_stream, WORD32 *h_real,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef IXHEAACD_MPS_INTERFACE_H
|
#ifndef IXHEAACD_MPS_INTERFACE_H
|
||||||
#define IXHEAACD_MPS_INTERFACE_H
|
#define IXHEAACD_MPS_INTERFACE_H
|
||||||
|
|
||||||
ia_mps_dec_state_struct* ixheaacd_mps_create(
|
VOID ixheaacd_mps_create(ia_mps_dec_state_struct* self,
|
||||||
WORD32 bs_frame_len, WORD32 residual_coding,
|
WORD32 bs_frame_len, WORD32 residual_coding,
|
||||||
ia_usac_dec_mps_config_struct* usac_mps_config);
|
ia_usac_dec_mps_config_struct* usac_mps_config);
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ VOID ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct* self,
|
||||||
WORD32 independency_flag,
|
WORD32 independency_flag,
|
||||||
ia_handle_bit_buf_struct it_bit_buff);
|
ia_handle_bit_buf_struct it_bit_buff);
|
||||||
|
|
||||||
VOID ixheaacd_mps_apply(ia_mps_dec_state_struct* self, FLOAT32** pointers[4],
|
WORD32 ixheaacd_mps_apply(ia_mps_dec_state_struct* self, FLOAT32** pointers[4],
|
||||||
FLOAT32 (*out_samples)[4096]);
|
FLOAT32 (*out_samples)[4096]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -576,7 +576,7 @@ VOID ixheaacd_mps_frame_parsing(ia_mps_dec_state_struct *self,
|
||||||
|
|
||||||
for (h = 2; h <= p; h++) {
|
for (h = 2; h <= p; h++) {
|
||||||
b = k - p + h;
|
b = k - p + h;
|
||||||
c_64 *= b;
|
c_64 = c_64 * (b / h);
|
||||||
ixheaacd_longmult1(c, b, c, 5);
|
ixheaacd_longmult1(c, b, c, 5);
|
||||||
b = h;
|
b = h;
|
||||||
ixheaacd_longdiv(c, b, c, r, 5);
|
ixheaacd_longdiv(c, b, c, r, 5);
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,9 @@ static VOID ixheaacd_mps_subbandtp(ia_mps_dec_state_struct* self, WORD32 ts) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_mps_temp_process(ia_mps_dec_state_struct* self) {
|
WORD32 ixheaacd_mps_temp_process(ia_mps_dec_state_struct* self) {
|
||||||
WORD32 ch, ts, hyb;
|
WORD32 ch, ts, hyb;
|
||||||
|
WORD32 err = 0;
|
||||||
|
|
||||||
for (ch = 0; ch < self->out_ch_count; ch++) {
|
for (ch = 0; ch < self->out_ch_count; ch++) {
|
||||||
for (ts = 0; ts < self->time_slots; ts++) {
|
for (ts = 0; ts < self->time_slots; ts++) {
|
||||||
|
|
@ -232,10 +233,13 @@ VOID ixheaacd_mps_temp_process(ia_mps_dec_state_struct* self) {
|
||||||
ixheaacd_mps_qmf_hyb_synthesis(self);
|
ixheaacd_mps_qmf_hyb_synthesis(self);
|
||||||
|
|
||||||
for (ch = 0; ch < self->out_ch_count; ch++) {
|
for (ch = 0; ch < self->out_ch_count; ch++) {
|
||||||
ixheaacd_sbr_dec_from_mps(&self->qmf_out_dir[ch][0][0].re,
|
err = ixheaacd_sbr_dec_from_mps(&self->qmf_out_dir[ch][0][0].re,
|
||||||
self->p_sbr_dec[ch], self->p_sbr_frame[ch],
|
self->p_sbr_dec[ch], self->p_sbr_frame[ch],
|
||||||
self->p_sbr_header[ch]);
|
self->p_sbr_header[ch]);
|
||||||
|
if(err)
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ixheaacd_mps_synt_calc(self);
|
ixheaacd_mps_synt_calc(self);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ static VOID ixheaacd_sbr_ext_data_read(
|
||||||
cnt_bits_in = it_bit_buff->cnt_bits;
|
cnt_bits_in = it_bit_buff->cnt_bits;
|
||||||
count = (it_bit_buff->cnt_bits) >> 3;
|
count = (it_bit_buff->cnt_bits) >> 3;
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
if ((count < MAXSBRBYTES) &&
|
if (
|
||||||
(esbr_bit_str->no_elements < MAXNRSBRELEMENTS)) {
|
(esbr_bit_str->no_elements < MAXNRSBRELEMENTS)) {
|
||||||
esbr_bit_str->str_sbr_ele[esbr_bit_str->no_elements].extension_type =
|
esbr_bit_str->str_sbr_ele[esbr_bit_str->no_elements].extension_type =
|
||||||
EXT_SBR_DATA;
|
EXT_SBR_DATA;
|
||||||
|
|
@ -167,17 +167,13 @@ static VOID ixheaacd_sbr_ext_data_read(
|
||||||
static VOID ixheaacd_read_ext_element(
|
static VOID ixheaacd_read_ext_element(
|
||||||
UWORD32 usac_ext_element_default_length,
|
UWORD32 usac_ext_element_default_length,
|
||||||
UWORD32 usac_ext_element_payload_frag, ia_bit_buf_struct *it_bit_buff
|
UWORD32 usac_ext_element_payload_frag, ia_bit_buf_struct *it_bit_buff
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
,
|
||||||
ia_usac_decoder_config_struct *pstr_usac_dec_config, WORD32 elem_idx
|
ia_usac_decoder_config_struct *pstr_usac_dec_config, WORD32 elem_idx
|
||||||
#endif
|
|
||||||
) {
|
) {
|
||||||
UWORD32 usac_ext_element_present;
|
UWORD32 usac_ext_element_present;
|
||||||
UWORD32 usac_ext_element_use_dft_length;
|
UWORD32 usac_ext_element_use_dft_length;
|
||||||
UWORD32 pay_load_length, tmp;
|
UWORD32 pay_load_length, tmp;
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
UWORD32 i;
|
UWORD32 i;
|
||||||
#endif
|
|
||||||
usac_ext_element_present = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
usac_ext_element_present = ixheaacd_read_bits_buf(it_bit_buff, 1);
|
||||||
|
|
||||||
if (usac_ext_element_present) {
|
if (usac_ext_element_present) {
|
||||||
|
|
@ -199,7 +195,6 @@ static VOID ixheaacd_read_ext_element(
|
||||||
if (usac_ext_element_payload_frag)
|
if (usac_ext_element_payload_frag)
|
||||||
tmp = ixheaacd_read_bits_buf(it_bit_buff, 2);
|
tmp = ixheaacd_read_bits_buf(it_bit_buff, 2);
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
if (pstr_usac_dec_config->usac_ext_ele_payload_present[elem_idx]) {
|
if (pstr_usac_dec_config->usac_ext_ele_payload_present[elem_idx]) {
|
||||||
for (i = 0; i < pay_load_length; i++) {
|
for (i = 0; i < pay_load_length; i++) {
|
||||||
pstr_usac_dec_config->usac_ext_gain_payload_buf
|
pstr_usac_dec_config->usac_ext_gain_payload_buf
|
||||||
|
|
@ -208,16 +203,13 @@ static VOID ixheaacd_read_ext_element(
|
||||||
}
|
}
|
||||||
pstr_usac_dec_config->usac_ext_gain_payload_len += pay_load_length;
|
pstr_usac_dec_config->usac_ext_gain_payload_len += pay_load_length;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
|
|
||||||
it_bit_buff->ptr_read_next =
|
it_bit_buff->ptr_read_next =
|
||||||
it_bit_buff->ptr_read_next + pay_load_length;
|
it_bit_buff->ptr_read_next + pay_load_length;
|
||||||
it_bit_buff->cnt_bits =
|
it_bit_buff->cnt_bits =
|
||||||
it_bit_buff->cnt_bits - (WORD32)(pay_load_length * 8);
|
it_bit_buff->cnt_bits - (WORD32)(pay_load_length * 8);
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -280,10 +272,10 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
ia_aac_dec_state_struct *p_state_aac_dec =
|
ia_aac_dec_state_struct *p_state_aac_dec =
|
||||||
(ia_aac_dec_state_struct *)codec_handle;
|
(ia_aac_dec_state_struct *)codec_handle;
|
||||||
|
|
||||||
ia_usac_data_struct *pstr_usac_data = pstr_dec_data->pstr_usac_data;
|
ia_usac_data_struct *pstr_usac_data = &(pstr_dec_data->str_usac_data);
|
||||||
ia_bit_buf_struct *it_bit_buff = &pstr_dec_data->dec_bit_buf;
|
ia_bit_buf_struct *it_bit_buff = &pstr_dec_data->dec_bit_buf;
|
||||||
|
|
||||||
ia_frame_data_struct *fd = pstr_dec_data->pstr_frame_data;
|
ia_frame_data_struct *fd = &(pstr_dec_data->str_frame_data);
|
||||||
|
|
||||||
ia_usac_config_struct *pstr_usac_config =
|
ia_usac_config_struct *pstr_usac_config =
|
||||||
&(fd->str_audio_specific_config.str_usac_config);
|
&(fd->str_audio_specific_config.str_usac_config);
|
||||||
|
|
@ -297,9 +289,7 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
WORD32 elem_idx = 0;
|
WORD32 elem_idx = 0;
|
||||||
WORD32 num_elements = pstr_usac_dec_config->num_elements;
|
WORD32 num_elements = pstr_usac_dec_config->num_elements;
|
||||||
|
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
pstr_usac_dec_config->usac_ext_gain_payload_len = 0;
|
pstr_usac_dec_config->usac_ext_gain_payload_len = 0;
|
||||||
#endif
|
|
||||||
pstr_usac_data->usac_independency_flg =
|
pstr_usac_data->usac_independency_flg =
|
||||||
ixheaacd_read_bits_buf(it_bit_buff, 1);
|
ixheaacd_read_bits_buf(it_bit_buff, 1);
|
||||||
|
|
||||||
|
|
@ -346,7 +336,7 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
ixheaacd_esbr_process(
|
ixheaacd_esbr_process(
|
||||||
pstr_usac_data, it_bit_buff, stereo_config_index,
|
pstr_usac_data, it_bit_buff, stereo_config_index,
|
||||||
nr_core_coder_channels,
|
nr_core_coder_channels,
|
||||||
pstr_dec_data->pstr_usac_data->audio_object_type);
|
pstr_dec_data->str_usac_data.audio_object_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stereo_config_index > 0) {
|
if (stereo_config_index > 0) {
|
||||||
|
|
@ -354,9 +344,9 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
WORD32 ch;
|
WORD32 ch;
|
||||||
|
|
||||||
*num_out_channels =
|
*num_out_channels =
|
||||||
p_state_aac_dec->mps_dec_handle[elem_idx]->out_ch_count;
|
p_state_aac_dec->mps_dec_handle.out_ch_count;
|
||||||
|
|
||||||
ixheaacd_mps_frame_parsing(p_state_aac_dec->mps_dec_handle[elem_idx],
|
ixheaacd_mps_frame_parsing(&p_state_aac_dec->mps_dec_handle,
|
||||||
pstr_usac_data->usac_independency_flg,
|
pstr_usac_data->usac_independency_flg,
|
||||||
it_bit_buff);
|
it_bit_buff);
|
||||||
|
|
||||||
|
|
@ -367,26 +357,28 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
ptr_inp[2 * ch + 1] =
|
ptr_inp[2 * ch + 1] =
|
||||||
pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[ch]
|
pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[ch]
|
||||||
->str_sbr_dec.pp_qmf_buf_imag;
|
->str_sbr_dec.pp_qmf_buf_imag;
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_dec[ch] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_dec[ch] =
|
||||||
(VOID *)(&pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[ch]
|
(VOID *)(&pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[ch]
|
||||||
->str_sbr_dec);
|
->str_sbr_dec);
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_header[ch] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_header[ch] =
|
||||||
(VOID *)(pstr_usac_data->pstr_esbr_dec->pstr_sbr_header[ch]);
|
(VOID *)(pstr_usac_data->pstr_esbr_dec->pstr_sbr_header[ch]);
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_frame[ch] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_frame[ch] =
|
||||||
(VOID *)(pstr_usac_data->pstr_esbr_dec->frame_buffer[ch]);
|
(VOID *)(pstr_usac_data->pstr_esbr_dec->frame_buffer[ch]);
|
||||||
}
|
}
|
||||||
if (nr_core_coder_channels == 1) {
|
if (nr_core_coder_channels == 1) {
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_dec[1] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_dec[1] =
|
||||||
(VOID *)(&pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[1]
|
(VOID *)(&pstr_usac_data->pstr_esbr_dec->pstr_sbr_channel[1]
|
||||||
->str_sbr_dec);
|
->str_sbr_dec);
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_header[1] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_header[1] =
|
||||||
(VOID *)(pstr_usac_data->pstr_esbr_dec->pstr_sbr_header[1]);
|
(VOID *)(pstr_usac_data->pstr_esbr_dec->pstr_sbr_header[1]);
|
||||||
p_state_aac_dec->mps_dec_handle[0]->p_sbr_frame[1] =
|
p_state_aac_dec->mps_dec_handle.p_sbr_frame[1] =
|
||||||
(VOID *)(pstr_usac_data->pstr_esbr_dec->frame_buffer[1]);
|
(VOID *)(pstr_usac_data->pstr_esbr_dec->frame_buffer[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ixheaacd_mps_apply(p_state_aac_dec->mps_dec_handle[0], ptr_inp,
|
err = ixheaacd_mps_apply(&p_state_aac_dec->mps_dec_handle, ptr_inp,
|
||||||
pstr_usac_data->time_sample_vector);
|
pstr_usac_data->time_sample_vector);
|
||||||
|
if(err)
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ch_offset += nr_core_coder_channels;
|
ch_offset += nr_core_coder_channels;
|
||||||
|
|
@ -397,11 +389,8 @@ WORD32 ixheaacd_usac_process(ia_dec_data_struct *pstr_dec_data,
|
||||||
&pstr_usac_dec_config->str_usac_element_config[elem_idx];
|
&pstr_usac_dec_config->str_usac_element_config[elem_idx];
|
||||||
ixheaacd_read_ext_element(pusac_element_config->usac_ext_eleme_def_len,
|
ixheaacd_read_ext_element(pusac_element_config->usac_ext_eleme_def_len,
|
||||||
pusac_element_config->usac_ext_elem_pld_frag,
|
pusac_element_config->usac_ext_elem_pld_frag,
|
||||||
it_bit_buff
|
it_bit_buff,
|
||||||
#ifdef ENABLE_DRC
|
|
||||||
,
|
|
||||||
pstr_usac_dec_config, elem_idx
|
pstr_usac_dec_config, elem_idx
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ VOID ixheaacd_esbr_synthesis_filt_block(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ia_sbr_frame_info_data_struct *ptr_frame_data,
|
ia_sbr_frame_info_data_struct *ptr_frame_data,
|
||||||
ia_sbr_prev_frame_data_struct *ptr_frame_data_prev,
|
ia_sbr_prev_frame_data_struct *ptr_frame_data_prev,
|
||||||
|
|
@ -728,13 +728,16 @@ VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
ixheaacd_qmf_enrg_calc(ptr_sbr_dec, upsample_ratio_idx, low_pow_flag);
|
ixheaacd_qmf_enrg_calc(ptr_sbr_dec, upsample_ratio_idx, low_pow_flag);
|
||||||
|
|
||||||
if (!mps_sbr_flag && apply_processing) {
|
if (!mps_sbr_flag && apply_processing) {
|
||||||
ixheaacd_generate_hf(ptr_sbr_dec->qmf_buf_real + (SBR_HF_ADJ_OFFSET),
|
WORD32 err_code = 0;
|
||||||
|
err_code = ixheaacd_generate_hf(ptr_sbr_dec->qmf_buf_real + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->qmf_buf_imag + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->qmf_buf_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->ph_vocod_qmf_real + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->ph_vocod_qmf_real + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->ph_vocod_qmf_imag + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->ph_vocod_qmf_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->sbr_qmf_out_real + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->sbr_qmf_out_real + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->sbr_qmf_out_imag + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->sbr_qmf_out_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_frame_data, ptr_header_data);
|
ptr_frame_data, ptr_header_data);
|
||||||
|
if(err_code)
|
||||||
|
return err_code;
|
||||||
|
|
||||||
ptr_pvc_data->pvc_rate = ptr_header_data->upsamp_fac;
|
ptr_pvc_data->pvc_rate = ptr_header_data->upsamp_fac;
|
||||||
|
|
||||||
|
|
@ -754,7 +757,15 @@ VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
ptr_pvc_data->prev_pvc_rate = ptr_pvc_data->pvc_rate;
|
ptr_pvc_data->prev_pvc_rate = ptr_pvc_data->pvc_rate;
|
||||||
|
|
||||||
ptr_frame_data->pstr_sbr_header = ptr_header_data;
|
ptr_frame_data->pstr_sbr_header = ptr_header_data;
|
||||||
|
if(ptr_header_data->hbe_flag == 0)
|
||||||
|
ixheaacd_sbr_env_calc(ptr_frame_data,
|
||||||
|
ptr_sbr_dec->sbr_qmf_out_real + (SBR_HF_ADJ_OFFSET),
|
||||||
|
ptr_sbr_dec->sbr_qmf_out_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
|
ptr_sbr_dec->qmf_buf_real + (SBR_HF_ADJ_OFFSET),
|
||||||
|
ptr_sbr_dec->qmf_buf_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
|
NULL,
|
||||||
|
ptr_sbr_dec->scratch_buff, pvc_dec_out_buf);
|
||||||
|
else
|
||||||
ixheaacd_sbr_env_calc(ptr_frame_data,
|
ixheaacd_sbr_env_calc(ptr_frame_data,
|
||||||
ptr_sbr_dec->sbr_qmf_out_real + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->sbr_qmf_out_real + (SBR_HF_ADJ_OFFSET),
|
||||||
ptr_sbr_dec->sbr_qmf_out_imag + (SBR_HF_ADJ_OFFSET),
|
ptr_sbr_dec->sbr_qmf_out_imag + (SBR_HF_ADJ_OFFSET),
|
||||||
|
|
@ -777,7 +788,7 @@ VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
|
|
||||||
ptr_frame_data->prev_sbr_mode = sbr_mode;
|
ptr_frame_data->prev_sbr_mode = sbr_mode;
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ixheaacd_cplx_anal_qmffilt(
|
ixheaacd_cplx_anal_qmffilt(
|
||||||
|
|
@ -998,6 +1009,7 @@ VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_sbr_dec->str_sbr_scale_fact.ov_lb_scale = save_lb_scale;
|
ptr_sbr_dec->str_sbr_scale_fact.ov_lb_scale = save_lb_scale;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ixheaacd_esbr_dec(ia_sbr_dec_struct *ptr_sbr_dec,
|
void ixheaacd_esbr_dec(ia_sbr_dec_struct *ptr_sbr_dec,
|
||||||
|
|
@ -1122,7 +1134,7 @@ void ixheaacd_esbr_dec(ia_sbr_dec_struct *ptr_sbr_dec,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
WORD32 ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
VOID *p_sbr_frame, VOID *p_sbr_header) {
|
VOID *p_sbr_frame, VOID *p_sbr_header) {
|
||||||
WORD32 i, k;
|
WORD32 i, k;
|
||||||
ia_sbr_frame_info_data_struct *ptr_frame_data =
|
ia_sbr_frame_info_data_struct *ptr_frame_data =
|
||||||
|
|
@ -1136,6 +1148,7 @@ void ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
WORD32 op_delay = 6 + SBR_HF_ADJ_OFFSET;
|
WORD32 op_delay = 6 + SBR_HF_ADJ_OFFSET;
|
||||||
WORD32 num_anal_bands = 40;
|
WORD32 num_anal_bands = 40;
|
||||||
WORD32 mps_sbr_flag = ptr_frame_data->mps_sbr_flag;
|
WORD32 mps_sbr_flag = ptr_frame_data->mps_sbr_flag;
|
||||||
|
WORD32 err = 0;
|
||||||
|
|
||||||
if (ptr_header_data->is_usf_4) {
|
if (ptr_header_data->is_usf_4) {
|
||||||
op_delay += 6;
|
op_delay += 6;
|
||||||
|
|
@ -1144,7 +1157,7 @@ void ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
num_anal_bands = num_anal_bands - (upsample_ratio_idx << 3);
|
num_anal_bands = num_anal_bands - (upsample_ratio_idx << 3);
|
||||||
|
|
||||||
if (!mps_sbr_flag) {
|
if (!mps_sbr_flag) {
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
no_bins = ptr_header_data->output_framesize / 64;
|
no_bins = ptr_header_data->output_framesize / 64;
|
||||||
|
|
@ -1187,18 +1200,27 @@ void ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
ptr_header_data->pstr_freq_band_data->qmf_sb_prev =
|
ptr_header_data->pstr_freq_band_data->qmf_sb_prev =
|
||||||
ptr_header_data->pstr_freq_band_data->sub_band_start;
|
ptr_header_data->pstr_freq_band_data->sub_band_start;
|
||||||
|
|
||||||
ixheaacd_generate_hf(ptr_sbr_dec->mps_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
err = ixheaacd_generate_hf(ptr_sbr_dec->mps_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
ptr_sbr_dec->mps_qmf_buf_imag + SBR_HF_ADJ_OFFSET, NULL,
|
ptr_sbr_dec->mps_qmf_buf_imag + SBR_HF_ADJ_OFFSET, NULL,
|
||||||
NULL,
|
NULL,
|
||||||
ptr_sbr_dec->mps_sbr_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
ptr_sbr_dec->mps_sbr_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
ptr_sbr_dec->mps_sbr_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
ptr_sbr_dec->mps_sbr_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
||||||
ptr_frame_data, ptr_header_data);
|
ptr_frame_data, ptr_header_data);
|
||||||
|
if(err)
|
||||||
|
return err;
|
||||||
|
|
||||||
ptr_frame_data->pstr_sbr_header = ptr_header_data;
|
ptr_frame_data->pstr_sbr_header = ptr_header_data;
|
||||||
ptr_frame_data->sbr_mode = ORIG_SBR;
|
ptr_frame_data->sbr_mode = ORIG_SBR;
|
||||||
ptr_frame_data->prev_sbr_mode = ORIG_SBR;
|
ptr_frame_data->prev_sbr_mode = ORIG_SBR;
|
||||||
|
if(ptr_header_data->hbe_flag == 0)
|
||||||
ixheaacd_sbr_env_calc(
|
ixheaacd_sbr_env_calc(
|
||||||
|
ptr_frame_data, ptr_sbr_dec->mps_sbr_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
|
ptr_sbr_dec->mps_sbr_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
||||||
|
ptr_sbr_dec->mps_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
|
ptr_sbr_dec->mps_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
||||||
|
NULL, ptr_sbr_dec->scratch_buff, NULL);
|
||||||
|
else
|
||||||
|
ixheaacd_sbr_env_calc(
|
||||||
ptr_frame_data, ptr_sbr_dec->mps_sbr_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
ptr_frame_data, ptr_sbr_dec->mps_sbr_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
ptr_sbr_dec->mps_sbr_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
ptr_sbr_dec->mps_sbr_qmf_buf_imag + SBR_HF_ADJ_OFFSET,
|
||||||
ptr_sbr_dec->mps_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
ptr_sbr_dec->mps_qmf_buf_real + SBR_HF_ADJ_OFFSET,
|
||||||
|
|
@ -1240,4 +1262,5 @@ void ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_frame_data->reset_flag = 0;
|
ptr_frame_data->reset_flag = 0;
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ typedef struct ia_sbr_pers_struct {
|
||||||
|
|
||||||
} ia_sbr_pers_struct;
|
} ia_sbr_pers_struct;
|
||||||
|
|
||||||
VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
WORD32 ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
ia_sbr_frame_info_data_struct *ptr_frame_data,
|
ia_sbr_frame_info_data_struct *ptr_frame_data,
|
||||||
ia_sbr_prev_frame_data_struct *ptr_frame_data_prev,
|
ia_sbr_prev_frame_data_struct *ptr_frame_data_prev,
|
||||||
|
|
@ -161,7 +161,7 @@ VOID ixheaacd_sbr_dec(ia_sbr_dec_struct *ptr_sbr_dec, WORD16 *ptr_time_data,
|
||||||
ia_pvc_data_struct *ptr_pvc_data_str, FLAG drc_on,
|
ia_pvc_data_struct *ptr_pvc_data_str, FLAG drc_on,
|
||||||
WORD32 drc_sbr_factors[][64], WORD32 audio_object_type);
|
WORD32 drc_sbr_factors[][64], WORD32 audio_object_type);
|
||||||
|
|
||||||
WORD16 ixheaacd_create_sbrdec(ia_sbr_tables_struct *pstr_sbr_tables,
|
WORD16 ixheaacd_create_sbrdec(
|
||||||
ixheaacd_misc_tables *pstr_common_table,
|
ixheaacd_misc_tables *pstr_common_table,
|
||||||
ia_sbr_channel_struct *ptr_sbr_channel,
|
ia_sbr_channel_struct *ptr_sbr_channel,
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
|
|
@ -171,7 +171,7 @@ WORD16 ixheaacd_create_sbrdec(ia_sbr_tables_struct *pstr_sbr_tables,
|
||||||
|
|
||||||
#define MAX_NUM_QMF_BANDS_ESBR 128
|
#define MAX_NUM_QMF_BANDS_ESBR 128
|
||||||
|
|
||||||
VOID ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
WORD32 ixheaacd_sbr_dec_from_mps(FLOAT32 *p_mps_qmf_output, VOID *p_sbr_dec,
|
||||||
VOID *p_sbr_frame, VOID *p_sbr_header);
|
VOID *p_sbr_frame, VOID *p_sbr_header);
|
||||||
|
|
||||||
VOID ixheaacd_qmf_hbe_apply(ia_esbr_hbe_txposer_struct *h_hbe_txposer,
|
VOID ixheaacd_qmf_hbe_apply(ia_esbr_hbe_txposer_struct *h_hbe_txposer,
|
||||||
|
|
@ -187,7 +187,7 @@ VOID ixheaacd_sbr_env_calc(ia_sbr_frame_info_data_struct *frame_data,
|
||||||
WORD32 x_over_qmf[MAX_NUM_PATCHES],
|
WORD32 x_over_qmf[MAX_NUM_PATCHES],
|
||||||
FLOAT32 *scratch_buff, FLOAT32 *env_out);
|
FLOAT32 *scratch_buff, FLOAT32 *env_out);
|
||||||
|
|
||||||
VOID ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
WORD32 ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
||||||
FLOAT32 ptr_src_buf_imag[][64],
|
FLOAT32 ptr_src_buf_imag[][64],
|
||||||
FLOAT32 ptr_ph_vocod_buf_real[][64],
|
FLOAT32 ptr_ph_vocod_buf_real[][64],
|
||||||
FLOAT32 ptr_ph_vocod_buf_imag[][64],
|
FLOAT32 ptr_ph_vocod_buf_imag[][64],
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,7 @@ ia_handle_sbr_dec_inst_struct ixheaacd_init_sbr(
|
||||||
audio_object_type);
|
audio_object_type);
|
||||||
|
|
||||||
err = ixheaacd_create_sbrdec(
|
err = ixheaacd_create_sbrdec(
|
||||||
sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_tables,
|
|
||||||
sbr_persistent_mem->str_sbr_dec_inst.pstr_common_tables,
|
sbr_persistent_mem->str_sbr_dec_inst.pstr_common_tables,
|
||||||
sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_channel[i],
|
sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_channel[i],
|
||||||
ptr_header_data[i], i, *down_sample_flag, sbr_persistent_mem, ps_enable,
|
ptr_header_data[i], i, *down_sample_flag, sbr_persistent_mem, ps_enable,
|
||||||
|
|
@ -602,9 +602,6 @@ ia_handle_sbr_dec_inst_struct ixheaacd_init_sbr(
|
||||||
sbr_ratio_idx == SBR_UPSAMPLE_IDX_4_1 ? 1 : 0,
|
sbr_ratio_idx == SBR_UPSAMPLE_IDX_4_1 ? 1 : 0,
|
||||||
output_frame_size, hbe_txposer_buffers);
|
output_frame_size, hbe_txposer_buffers);
|
||||||
|
|
||||||
} else {
|
|
||||||
ptr_sbr_dec[0]->p_hbe_txposer = NULL;
|
|
||||||
ptr_sbr_dec[1]->p_hbe_txposer = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p_str_sbr_dec_inst->ptr_pvc_data_str->prev_first_bnd_idx = -1;
|
p_str_sbr_dec_inst->ptr_pvc_data_str->prev_first_bnd_idx = -1;
|
||||||
|
|
@ -752,7 +749,7 @@ ia_handle_sbr_dec_inst_struct ixheaacd_init_sbr(
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLATFORM_INLINE WORD16 ixheaacd_create_sbr_env_calc(
|
static PLATFORM_INLINE WORD16 ixheaacd_create_sbr_env_calc(
|
||||||
ia_sbr_tables_struct *pstr_sbr_tables,
|
|
||||||
ixheaacd_misc_tables *pstr_common_table, ia_sbr_calc_env_struct *hs,
|
ixheaacd_misc_tables *pstr_common_table, ia_sbr_calc_env_struct *hs,
|
||||||
WORD16 chan, VOID *sbr_persistent_mem_v,
|
WORD16 chan, VOID *sbr_persistent_mem_v,
|
||||||
ia_sbr_header_data_struct *ptr_header_data, WORD audio_object_type) {
|
ia_sbr_header_data_struct *ptr_header_data, WORD audio_object_type) {
|
||||||
|
|
@ -772,7 +769,7 @@ static PLATFORM_INLINE WORD16 ixheaacd_create_sbr_env_calc(
|
||||||
ixheaacd_reset_sbrenvelope_calc(hs);
|
ixheaacd_reset_sbrenvelope_calc(hs);
|
||||||
|
|
||||||
if ((chan == 0) && (audio_object_type == AOT_ER_AAC_ELD)) {
|
if ((chan == 0) && (audio_object_type == AOT_ER_AAC_ELD)) {
|
||||||
err = ixheaacd_calc_frq_bnd_tbls(ptr_header_data, pstr_sbr_tables,
|
err = ixheaacd_calc_frq_bnd_tbls(ptr_header_data,
|
||||||
pstr_common_table);
|
pstr_common_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1083,8 +1080,7 @@ static PLATFORM_INLINE WORD32 ixheaacd_create_cplx_synt_qmfbank(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD16 ixheaacd_create_sbrdec(ia_sbr_tables_struct *pstr_sbr_tables,
|
WORD16 ixheaacd_create_sbrdec(ixheaacd_misc_tables *pstr_common_table,
|
||||||
ixheaacd_misc_tables *pstr_common_table,
|
|
||||||
ia_sbr_channel_struct *ptr_sbr_channel,
|
ia_sbr_channel_struct *ptr_sbr_channel,
|
||||||
ia_sbr_header_data_struct *ptr_header_data,
|
ia_sbr_header_data_struct *ptr_header_data,
|
||||||
WORD16 chan, FLAG down_sample_flag,
|
WORD16 chan, FLAG down_sample_flag,
|
||||||
|
|
@ -1112,7 +1108,7 @@ WORD16 ixheaacd_create_sbrdec(ia_sbr_tables_struct *pstr_sbr_tables,
|
||||||
sbr_persistent_mem->pstr_prev_frame_data[chan];
|
sbr_persistent_mem->pstr_prev_frame_data[chan];
|
||||||
|
|
||||||
err = ixheaacd_create_sbr_env_calc(
|
err = ixheaacd_create_sbr_env_calc(
|
||||||
pstr_sbr_tables, pstr_common_table, &hs->str_sbr_calc_env, chan,
|
pstr_common_table, &hs->str_sbr_calc_env, chan,
|
||||||
sbr_persistent_mem, ptr_header_data, audio_object_type);
|
sbr_persistent_mem, ptr_header_data, audio_object_type);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
||||||
|
|
@ -935,7 +935,7 @@ VOID ixheaacd_pre_processing(FLOAT32 ptr_src_buf_real[][64],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
WORD32 ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
||||||
FLOAT32 ptr_src_buf_imag[][64],
|
FLOAT32 ptr_src_buf_imag[][64],
|
||||||
FLOAT32 ptr_ph_vocod_buf_real[][64],
|
FLOAT32 ptr_ph_vocod_buf_real[][64],
|
||||||
FLOAT32 ptr_ph_vocod_buf_imag[][64],
|
FLOAT32 ptr_ph_vocod_buf_imag[][64],
|
||||||
|
|
@ -1109,6 +1109,10 @@ VOID ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_bands_in_patch <= 0) {
|
if (num_bands_in_patch <= 0) {
|
||||||
|
if(num_bands_in_patch == 0)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1245,4 +1249,5 @@ VOID ixheaacd_generate_hf(FLOAT32 ptr_src_buf_real[][64],
|
||||||
for (i = 0; i < num_if_bands; i++) {
|
for (i = 0; i < num_if_bands; i++) {
|
||||||
bw_array_prev[i] = bw_array[i];
|
bw_array_prev[i] = bw_array[i];
|
||||||
}
|
}
|
||||||
|
return 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