AnsweredAssumed Answered

efficient way to convert 32bitsamples into 24bitsamples

Question asked by pfeifferc on Oct 15, 2014
Latest reply on Mar 11, 2015 by pfeifferc

hi !

We use network based audio distribution in uncompressed format (16bit,24bit,32bit).

Now I want to speed up our routines, especially the 24bit are  the slowest one (12cycles for 4channels for each sample)

is there any efficient asm code snippet to do this job ??? e.g. with align statements I don't have enough asm experience to do this in a few hours !!

so the c-code is

  for(i=0; i<samplesPerFrame;i++)

  {//loc.input1

      currInpSample = iLocalInput1[i];

      *pEtherOut1Byte ++ = currInpSample;

      *pEtherOut1Byte ++ = currInpSample>>8;

      *pEtherOut1Byte ++ = currInpSample>>16;

   //   //loc.input2

   currInpSample = iLocalInput2[i];

      *pEtherOut2Byte ++ = currInpSample;

   *pEtherOut2Byte ++ = currInpSample>>8;

   *pEtherOut2Byte ++ = currInpSample>>16;

      //local inp3  

    currInpSample = iLocalInput3[i];

    *pEtherOut3Byte ++ = currInpSample;

   *pEtherOut3Byte ++ = currInpSample>>8;

   *pEtherOut3Byte ++ = currInpSample>>16;

     //loc.input4

   currInpSample = iLocalInput4[i];

   //measureIn4=max(abs(currInpSample),measureIn4);

   *pEtherOut4Byte ++ = currInpSample;

   *pEtherOut4Byte ++ = currInpSample>>8;

   *pEtherOut4Byte ++ = currInpSample>>16;

    }

 

regards chris

Outcomes