diff options
| author | Brad Midgley <bmidgley@xmission.com> | 2007-12-14 06:54:19 +0000 | 
|---|---|---|
| committer | Brad Midgley <bmidgley@xmission.com> | 2007-12-14 06:54:19 +0000 | 
| commit | 1da4920f71140a3d9478f013a1ff000197f9a1eb (patch) | |
| tree | 3f546135a205e95f67bec6581e4a83a2933ae03d | |
| parent | 9a14d423e7def6933b4df4bae8e9185a62b346ea (diff) | |
smooth out last shift-in-place wrinkle
| -rw-r--r-- | sbc/sbc.c | 13 | 
1 files changed, 2 insertions, 11 deletions
| @@ -1114,21 +1114,12 @@ static int sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len)  		data[4] = 0;  		for (sb = 0; sb < frame->subbands - 1; sb++) -			data[4] |= ((frame->join >> sb) & 0x01) << (7 - sb); +			data[4] |= ((frame->join >> sb) & 0x01) << (frame->subbands - 1 - sb); -		if (frame->subbands == 4) -			crc_header[crc_pos >> 3] = data[4] & 0xf0; -		else -			crc_header[crc_pos >> 3] = data[4]; +		crc_header[crc_pos >> 3] = data[4];  		produced += frame->subbands;  		crc_pos += frame->subbands; - -		/* this is temporary until we use an in-place shift above */ -		if(produced % 8) { -			data[produced >> 3] >>= 8 - (produced % 8); -			crc_header[crc_pos >> 3] >>= 8 - (crc_pos % 8); -		}  	}  	for (ch = 0; ch < frame->channels; ch++) { | 
