Skip to contentSkip to conversation

sbc synthesis inconsistencies

Bluez-devel Brad Midgley 2 participants 3 messages Sep 4, 2005 – Sep 5, 2005 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Guys,

Have any of you looked closely at this? It comes straight from the spec for a2dp on page 66:

	/* Build a 80 values vector U */
	for (i = 0; i <= 4; i++) {
		for (j = 0; j < 8; j++) {
			state->U[ch][i * 16 + j] = state->V[ch][i * 32 + j];
			state->U[ch][i * 16 + j + 8] = state->V[ch][i * 32 + j + 24];
		}
	}

But isn't this code only populating u[ch][0..63] and not through 79 like the comment suggests? So the u[ch][64..79] terms are always 0 right?

This isn't the only thing that looks wrong in the spec. We also have a sliding window of v[] values that moves 16 values in each pass. The vector is 160 elements long even though the code above never accesses anything beyond the 128th value!

It's amazing this stuff even works as poorly specified as it is :(

BTW, in our code it looks like sbc_synthesize_eight was multiplying sbc_proto_8_80 by -4 where it should be -8. I changed that in cvs.

Brad

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Hi,

outer loop goes from i=0 up to i=4 -> 5 times * 8 * 2 = 80

Ciao,

Peter

Quoted 30 lines · Brad Midgley

Guys,

Have any of you looked closely at this? It comes straight from the spec for a2dp on page 66:

	/* Build a 80 values vector U */
	for (i = 0; i <= 4; i++) {
		for (j = 0; j < 8; j++) {
			state->U[ch][i * 16 + j] = state->V[ch][i * 32 + j];
			state->U[ch][i * 16 + j + 8] = state->V[ch][i * 32 + j + 24];
		}
	}

But isn't this code only populating u[ch][0..63] and not through 79 like the comment suggests? So the u[ch][64..79] terms are always 0 right?

This isn't the only thing that looks wrong in the spec. We also have a sliding window of v[] values that moves 16 values in each pass. The vector is 160 elements long even though the code above never accesses anything beyond the 128th value!

It's amazing this stuff even works as poorly specified as it is :(

BTW, in our code it looks like sbc_synthesize_eight was multiplying sbc_proto_8_80 by -4 where it should be -8. I changed that in cvs.

Brad

Quoted 10 lines

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

|	Peter Wippich 			Voice: +49 30 46776411		|
|	G&W Instruments GmbH		fax:   +49 30 46776419		|
|	Gustav-Meyer-Allee 25, Geb. 12	Email: [email protected]	|
|	D-13355 Berlin  / Germany					|

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Peter

Quoted 1 line

outer loop goes from i=0 up to i=4 -> 5 times * 8 * 2 = 80

Yes, thanks... I missed the <= (working too late).

I also remembered that Henryk was always testing the decoder against sbc files on the filesystem which simplifies testing. I'm going to have another whack at the simplification step and then try unrolling things.

Brad

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel