diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-05-18 14:47:49 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-05-18 14:47:49 +0000 |
commit | 3d6b20f58304faafcb7e3804ac29d1d81379e79e (patch) | |
tree | 5eba5f7fccd648cd0f94837b82b77f2a68c34de1 | |
parent | 51efc88dd3dcd082c9a95bdfa499641f927cbf07 (diff) |
Make SBC parameters configurable
-rw-r--r-- | alsa/sbc.c | 17 | ||||
-rw-r--r-- | alsa/sbc.h | 3 |
2 files changed, 16 insertions, 4 deletions
@@ -1225,6 +1225,12 @@ int sbc_init(sbc_t *sbc, unsigned long flags) memset(sbc->priv, 0, sizeof(struct sbc_priv)); + sbc->rate = 44100; + sbc->channels = 2; + sbc->subbands = 8; + sbc->blocks = 16; + sbc->bitpool = 32; + return 0; } @@ -1245,8 +1251,11 @@ int sbc_decode(sbc_t *sbc, void *data, int count) sbc_decoder_init(&priv->dec_state, &priv->frame); priv->init = 1; - sbc->rate = priv->frame.sampling_frequency * 1000; + sbc->rate = priv->frame.sampling_frequency * 1000; sbc->channels = priv->frame.channels; + sbc->subbands = priv->frame.subbands; + sbc->blocks = priv->frame.blocks; + sbc->bitpool = priv->frame.bitpool; } samples = sbc_synthesize_audio(&priv->dec_state, &priv->frame); @@ -1304,9 +1313,9 @@ int sbc_encode(sbc_t *sbc, void *data, int count) priv->frame.channel_mode = MONO; priv->frame.allocation_method = SNR; - priv->frame.subbands = 8; - priv->frame.blocks = 16; - priv->frame.bitpool = 32; + priv->frame.subbands = sbc->subbands; + priv->frame.blocks = sbc->blocks; + priv->frame.bitpool = sbc->bitpool; sbc_encoder_init(&priv->enc_state, &priv->frame); priv->init = 1; @@ -36,6 +36,9 @@ struct sbc_struct { int rate; int channels; + int blocks; + int subbands; + int bitpool; void *data; int size; |