So you telling me that the code for both cases is the same ?

cited from wiki: "Big-endian:
The most significant byte (MSB) value, is stored at the memory location with
the lowest address". Thats ((value) & 0xFF;)
This value is set to zero an therefor is not used in expression.
Next the LSB is stored at highest address ((value >> 24) & 0xFF) . I'm
outputing LSB in that stream first.

In the LE case im outpuing LSB (value && 0xFF) first too.

What do you think ? I'm pretty unsure now.

metyl


On Tue, Nov 10, 2009 at 7:38 PM, Max Kellermann <m...@duempel.org> wrote:

> On 2009/11/10 20:06, Metyl Methylius <the.me...@gmail.com> wrote:
> > why pcm24_to_wave its wrong ? it's maybe not effective but should not be
> > wrong
> > it works for little endian and GUINT32_TO_LE() helps to use same masks as
> > with little endian.
> > As you pointed its very ineffective and i have rewritten it.
>
> That's still wrong.
>
> On little endian, GUINT32_TO_LE() is a no-op.  That's why it worked on
> little-endian.
>


> Your new big-endian code:


> + *dst8++ = (value >> 24) & 0xFF;
> + *dst8++ = (value >> 16) & 0xFF;
> + *dst8++ = (value >> 8) & 0xFF;
>
> Basically, this code writes a big-endian 24 bit integer into the file
> (most significant byte first).  But you told me today that you have to
> use little-endian for the WAV on-disk format.
>
> (btw. the "& 0xFF" is redundant)
>



-- 
This mess was sent using 100% recycled electrons. If you want to get rid of
this mess just turn off your computer,



-- 
This mess was sent using 100% recycled electrons. If you want to get rid of
this mess just turn off your computer,
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to