Re: [PATCH v6 11/17] sbc: Add SBC_MSBC flag to enable 15 block encoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Fred,

> This patch defines the SBC_MSBC flag. The purpose of this flag is to encode 15
> blocks. It is private to the library and can't be set from standard API.
> sbc_init_msbc() function will be defined to set this flag.
> ---
> sbc/sbc.c |   38 ++++++++++++++++++++++++++++++--------
> 1 file changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/sbc/sbc.c b/sbc/sbc.c
> index ffdf05d..631072e 100644
> --- a/sbc/sbc.c
> +++ b/sbc/sbc.c
> @@ -52,6 +52,10 @@
> 
> #define SBC_SYNCWORD	0x9C
> 
> +#define SBC_MSBC	0x01

can we get rid of SBC_MSBC. It is confusing.

> +#define MSBC_SYNCWORD	0xAD
> +#define MSBC_BLOCKS	15
> +
> /* This structure contains an unpacked SBC frame.
>    Yes, there is probably quite some unused space herein */
> struct sbc_frame {
> @@ -903,18 +907,22 @@ static ssize_t sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len
> 	}
> }
> 
> -static void sbc_encoder_init(struct sbc_encoder_state *state,
> -					const struct sbc_frame *frame)
> +static void sbc_encoder_init(unsigned long flags, unsigned long pflags,
> +		struct sbc_encoder_state *state, const struct sbc_frame *frame)
> {
> 	memset(&state->X, 0, sizeof(state->X));
> 	state->position = (SBC_X_BUFFER_SIZE - frame->subbands * 9) & ~7;
> -	state->increment = 4;
> +	if (pflags & SBC_MSBC)
> +		state->increment = 1;
> +	else
> +		state->increment = 4;

This pflags thing seems not a good idea. Can we not just hand over the increment value.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux