All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Midgley <bmidgley@xmission.com>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] unrolling sbc decoder
Date: Sun, 04 Sep 2005 02:24:16 -0600	[thread overview]
Message-ID: <431AAF30.304@xmission.com> (raw)

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

                 reply	other threads:[~2005-09-04  8:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=431AAF30.304@xmission.com \
    --to=bmidgley@xmission.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.