* [Bluez-devel] unrolling sbc decoder
@ 2005-09-04 8:24 Brad Midgley
0 siblings, 0 replies; only message in thread
From: Brad Midgley @ 2005-09-04 8:24 UTC (permalink / raw)
To: BlueZ Mailing List
Hey
I thought I had this nailed after some careful unrolling/simplifying
work but there may still be something I missed. I'm finding I get choppy
audio, but then I reverted and it was still choppy... can someone try
this in sbc.c with a2recv by transmit 8-subband audio to it from some
other device?
Brad
static inline void sbc_synthesize_eight(struct sbc_decoder_state *state,
struct sbc_frame *frame, int ch, int blk)
{
int i, j, k, idx, offset;
static int off1[] = {0, 16, 32, 48, 64, 80, 96, 112, 0, 16, 32, 48, 64,
80, 96};
static int off2[] = {24, 40, 56, 72, 88, 104, 120, 8, 24, 40, 56, 72,
88, 104, 120};
static int pass = 0;
int window = pass*16;
/* Matrixing */
for (k = 0; k < 16; k++) {
state->V[ch][window+k] = 0;
for (i = 0; i < 8; i++) {
state->V[ch][window+k] += synmatrix8[k][i] *
frame->sb_sample[blk][ch][i];
}
}
for (j = 0; j < 8; j++) {
state->X[ch][j] = 0;
}
/* Calculate 8 audio samples */
for (i = 0; i <= 4; i++) {
offset = (i*2) + pass;
idx = i*16;
for (j = 0; j < 8; j++, idx++) {
state->X[ch][j] +=
state->V[ch][off1[offset] + j] * sbc_proto_8_80[idx] +
state->V[ch][off2[offset] + j] * sbc_proto_8_80[idx+8];
}
}
/* Ouput 8 reconstructed Audio Samples */
for (i = 0; i < 8; i++) {
frame->pcm_sample[ch][blk * 8 + i] = (int16_t)(-8.0 * state->X[ch][i]);
}
pass = (pass+1) & 0x7;
}
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-09-04 8:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-04 8:24 [Bluez-devel] unrolling sbc decoder Brad Midgley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.