forked from len0rd/rockbox
Unroll mpc's requantization loops for some (minor) speed up.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25891 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7831a23376
commit
452c5b2197
1 changed files with 60 additions and 19 deletions
|
@ -125,54 +125,95 @@ void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r,
|
|||
//------------------------------------------------------------------------------
|
||||
// macros
|
||||
//------------------------------------------------------------------------------
|
||||
#define REQUANT_M1_S1_SAMPLES(IDX) \
|
||||
*(YL+=IDX) = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); \
|
||||
*(YR+=IDX) = templ - tempr;
|
||||
|
||||
#define REQUANT_M1_S1(SUBFRAME) \
|
||||
facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , d->SCF_Index_L[Band][SUBFRAME] & 0xFF); \
|
||||
facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , d->SCF_Index_R[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); \
|
||||
*YR = templ - tempr; \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_M1_S1_SAMPLES( 0); \
|
||||
REQUANT_M1_S1_SAMPLES(32); \
|
||||
REQUANT_M1_S1_SAMPLES(32); \
|
||||
REQUANT_M1_S1_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_M1_S0_SAMPLES(IDX) \
|
||||
*(YR+=IDX) = *(YL+=IDX) = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
|
||||
|
||||
#define REQUANT_M1_S0(SUBFRAME) \
|
||||
facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , d->SCF_Index_L[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_M1_S0_SAMPLES( 0); \
|
||||
REQUANT_M1_S0_SAMPLES(32); \
|
||||
REQUANT_M1_S0_SAMPLES(32); \
|
||||
REQUANT_M1_S0_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_M0_S1_SAMPLES(IDX) \
|
||||
*(YR+=IDX) = -(*(YL+=IDX) = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
|
||||
|
||||
#define REQUANT_M0_S1(SUBFRAME) \
|
||||
facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , d->SCF_Index_R[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_M0_S1_SAMPLES( 0); \
|
||||
REQUANT_M0_S1_SAMPLES(32); \
|
||||
REQUANT_M0_S1_SAMPLES(32); \
|
||||
REQUANT_M0_S1_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_L1_R1_SAMPLES(IDX) \
|
||||
*(YL+=IDX) = MPC_MULTIPLY_FLOAT_INT(facL,*L++); \
|
||||
*(YR+=IDX) = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
|
||||
|
||||
#define REQUANT_L1_R1(SUBFRAME) \
|
||||
facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , d->SCF_Index_L[Band][SUBFRAME] & 0xFF); \
|
||||
facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , d->SCF_Index_R[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); \
|
||||
*YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_L1_R1_SAMPLES( 0); \
|
||||
REQUANT_L1_R1_SAMPLES(32); \
|
||||
REQUANT_L1_R1_SAMPLES(32); \
|
||||
REQUANT_L1_R1_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_L1_R0_SAMPLES(IDX) \
|
||||
*(YL+=IDX) = MPC_MULTIPLY_FLOAT_INT(facL,*L++); \
|
||||
*(YR+=IDX) = 0;
|
||||
|
||||
#define REQUANT_L1_R0(SUBFRAME) \
|
||||
facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , d->SCF_Index_L[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); \
|
||||
*YR = 0; \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_L1_R0_SAMPLES( 0); \
|
||||
REQUANT_L1_R0_SAMPLES(32); \
|
||||
REQUANT_L1_R0_SAMPLES(32); \
|
||||
REQUANT_L1_R0_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_L0_R1_SAMPLES(IDX) \
|
||||
*(YL+=IDX) = 0; \
|
||||
*(YR+=IDX) = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
|
||||
|
||||
#define REQUANT_L0_R1(SUBFRAME) \
|
||||
facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , d->SCF_Index_R[Band][SUBFRAME] & 0xFF); \
|
||||
for (n = 0; n < 12; n++, YL += 32, YR += 32) { \
|
||||
*YL = 0; \
|
||||
*YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_L0_R1_SAMPLES( 0); \
|
||||
REQUANT_L0_R1_SAMPLES(32); \
|
||||
REQUANT_L0_R1_SAMPLES(32); \
|
||||
REQUANT_L0_R1_SAMPLES(32); \
|
||||
}
|
||||
|
||||
#define REQUANT_SILENCE_SAMPLES(IDX) \
|
||||
*(YR+=IDX) = *(YL+=IDX) = 0;
|
||||
|
||||
#define REQUANT_SILENCE \
|
||||
for (n = 0; n < 36; n++, YL += 32, YR += 32) { \
|
||||
*YR = *YL = 0; \
|
||||
for (n = 0; n < 12; n+=4, YL += 32, YR += 32) { \
|
||||
REQUANT_SILENCE_SAMPLES( 0); \
|
||||
REQUANT_SILENCE_SAMPLES(32); \
|
||||
REQUANT_SILENCE_SAMPLES(32); \
|
||||
REQUANT_SILENCE_SAMPLES(32); \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set the scf indexes for seeking use
|
||||
* needed only for sv7 seeking
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue