[opus] Encoder off by one

Jean-Marc Valin jmvalin at jmvalin.ca
Sun Oct 6 07:50:59 PDT 2013


Why should it return 360 in the first place???

On 10/06/2013 06:33 AM, Hermann Weber wrote:
> 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));
> _______________________________________________
> opus mailing list
> opus at xiph.org
> http://lists.xiph.org/mailman/listinfo/opus
> 



More information about the opus mailing list