summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2007-11-30 15:53:04 +0000
committerBrad Midgley <bmidgley@xmission.com>2007-11-30 15:53:04 +0000
commit87f83cd60537de472248311f48b6eb4cde6801d4 (patch)
treee8eed936ba5f41d80fe21988ece5c2619b4958d2 /sbc
parent76e595a98b7b73ee54ae17e6162f05ad81c9b654 (diff)
combine two conditionals in bit packing
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sbc/sbc.c b/sbc/sbc.c
index a785c48d..001910a5 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -1153,15 +1153,11 @@ static int sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len)
for (blk = 0; blk < frame->blocks; blk++) {
for (ch = 0; ch < frame->channels; ch++) {
for (sb = 0; sb < frame->subbands; sb++) {
- if (levels[ch][sb] > 0)
+ if (levels[ch][sb] > 0) {
audio_sample =
(uint16_t) ((((frame->sb_sample_f[blk][ch][sb]*levels[ch][sb]) >>
(frame->scale_factor[ch][sb] + 1)) +
levels[ch][sb]) >> 1);
- else
- audio_sample = 0;
-
- if (bits[ch][sb] != 0) {
audio_sample <<= 16 - bits[ch][sb];
for (bit = 0; bit < bits[ch][sb]; bit++) {
data[produced >> 3] <<= 1;