[opus] Encoder off by one

Hermann Weber hermie.weber at gmx.de
Sun Oct 6 03:33:02 PDT 2013


Why does opus_encode return 359, and not 360, please?

This is my code:

         int iShortsRead = fread(m_RawBytes, sizeof(short), 
(5760/sizeof(short)), fin);
         for(int i=0;i<iShortsRead;i++)
         {
             opus_int32 s;
             s=m_RawBytes[2*i+1]<<8|m_RawBytes[2*i];
             s=((s&0xFFFF)^0x8000)-0x8000;
             m_ShortsInput[i]=s;
         }
         int iByteSizeEncoded = opus_encode(m_enc, m_ShortsInput, 
(5760/sizeof(short)), m_EncodedBytes, (960*6));


More information about the opus mailing list