On Sat, 11 Aug 2012 09:32:55 -0700 (PDT), Mauritz Jameson
<mjames2393@gmail.com> wrote:
>Hi,
>
>I have some 24bit audio data (stored in an unsigned int). I have to
>sign extend it to 32 bit.
>From what I understand, I just look at bit 23 (counting from bit0)
>which is the sign-bit. If it
>is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
>need to do anything.
>
>Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
>in function or something?
>
>I haven't been able to find anything in the manuals (maybe I am
>overlooking something).
>
>Thanks
See Processor Manual page 11-79
Rn = FEXT Rx BY Ry (SE)
Mark DeArman
Reply by Mauritz Jameson●August 11, 20122012-08-11
Thanks Vlad :-)
Reply by Vladimir Vassilevsky●August 11, 20122012-08-11
"Vladimir Vassilevsky" <nospam@nowhere.com> wrote in message
news:dpednUa-xrCuDrvNnZ2dnUVZ5r-dnZ2d@giganews.com...
>
> "Mauritz Jameson" <mjames2393@gmail.com> wrote in message
> news:2ea9ca25-7c1e-4ce3-92bb-97a49cf6bbae@u7g2000yqj.googlegroups.com...
>> Hi,
>>
>> I have some 24bit audio data (stored in an unsigned int). I have to
>> sign extend it to 32 bit.
>> From what I understand, I just look at bit 23 (counting from bit0)
>> which is the sign-bit. If it
>> is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
>> need to do anything.
>>
>> Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
>> in function or something?
>> I haven't been able to find anything in the manuals (maybe I am
>> overlooking something).
>
> s32 y = (u32)(s24) x - (s32)0x800000
>
> Duh.
>
Oops.
s32 y = (x ^ 0x800000) - 0x800000
Vladimir Vassilevsky
DSP and Mixed Signal Consultant
www.abvolt.com
Reply by Vladimir Vassilevsky●August 11, 20122012-08-11
"Mauritz Jameson" <mjames2393@gmail.com> wrote in message
news:2ea9ca25-7c1e-4ce3-92bb-97a49cf6bbae@u7g2000yqj.googlegroups.com...
> Hi,
>
> I have some 24bit audio data (stored in an unsigned int). I have to
> sign extend it to 32 bit.
> From what I understand, I just look at bit 23 (counting from bit0)
> which is the sign-bit. If it
> is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
> need to do anything.
>
> Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
> in function or something?
> I haven't been able to find anything in the manuals (maybe I am
> overlooking something).
s32 y = (u32)(s24) x - (s32)0x800000
Duh.
Vladimir Vassilevsky
DSP and Mixed Signal Consultant
www.abvolt.com
Reply by Mauritz Jameson●August 11, 20122012-08-11
Hi,
I have some 24bit audio data (stored in an unsigned int). I have to
sign extend it to 32 bit.
From what I understand, I just look at bit 23 (counting from bit0)
which is the sign-bit. If it
is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
need to do anything.
Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
in function or something?
I haven't been able to find anything in the manuals (maybe I am
overlooking something).
Thanks