All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] What endian type is supported by audio device ?
Date: Sun, 01 May 2005 14:49:34 +0200	[thread overview]
Message-ID: <1114951774.21785.4.camel@pegasus> (raw)
In-Reply-To: <20050501122209.63346.qmail@web8309.mail.in.yahoo.com>

Hi Mayank,

> Don't you think that we should first find out which
> endian type the user's audio device supports ?
> 
> I mean, in the file sbc.c in the following lines
> 
> for (i = 0; i < samples; i++) {
> 	for (ch = 0; ch < priv->frame.channels; ch++) {
> 		int16_t s =
> (int16_t)(priv->frame.pcm_sample[ch][i]);
> 		*ptr++ = (s & 0xff00) >> 8;
> 		*ptr++ = (s & 0x00ff);
> 	}
> }
> 
> Shouldn't we first check out whether the user's audio
> device supports little endian or big endian type ?
> 
> It should be something like below...
> 
> for (i = 0; i < samples; i++) {
> 	for (ch = 0; ch < priv->frame.channels; ch++) {
> 		int16_t s =
> (int16_t)(priv->frame.pcm_sample[ch][i]);
> 		if(BIG_ENDIAN) {
> 			*ptr++ = (s & 0xff00) >> 8;
> 			*ptr++ = (s & 0x00ff);
> 		}
> 		else {
> 			*ptr++ = (s & 0x00ff);
> 			*ptr++ = (s & 0xff00) >> 8;
> 		}
> 	}
> }
> 
> Ofcourse BIG_ENDIAN will be replaced by a function or
> macro which returns the endian type.
> 
> Do you have knowledge of such a function or macro ?
> If yes, please patch sbc.c file for us.
> 
> It will be great for people like me who have spent
> weeks in figuring out why the sound quality is so poor
> while using sbcdec.c
> 
> I use an Intel based machine, which follows
> little-endian format.
> But sbc.c was using big endian format.

actually this has nothing to do with the machine type. It depends on the
endian format of the input PCM stream. So we should add a flags that
tells us about the endian format of the input.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2005-05-01 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-01 12:22 [Bluez-devel] What endian type is supported by audio device ? Mayank Batra
2005-05-01 12:49 ` Marcel Holtmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-03 13:28 Mayank Batra
2005-05-03 15:33 ` Marcel Holtmann
2005-05-05 12:37 Mayank Batra
2005-05-05 13:05 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1114951774.21785.4.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.