There are 5 messages in this thread.
You are currently looking at messages 1 to .
Is this discussion worth a thumbs up?
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______________________________
"Mauritz Jameson" <m...@gmail.com> wrote in message news:2...@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______________________________
"Vladimir Vassilevsky" <n...@nowhere.com> wrote in message news:d...@giganews.com... > > "Mauritz Jameson" <m...@gmail.com> wrote in message > news:2...@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______________________________
Thanks Vlad :-)______________________________
On Sat, 11 Aug 2012 09:32:55 -0700 (PDT), Mauritz Jameson <m...@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______________________________