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));
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 >
If you encode with
int iByteSizeEncoded = opus_encode(m_enc, m_ShortsInput,
(1920/sizeof(short)), m_EncodedBytes, (960*6));
... the byte size is 120.
I thought that an odd value like 359 has to be a fault on my side.
I thought it would be a multiple of something.
So 359 is really correct???
Thank you for clearing this up.
Am 06.10.2013 16:50, schrieb Jean-Marc Valin:> 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
>>
>