<span style='font-family:Verdana'><span style='font-size:12px'><div><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">Hi all,</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">I noticed some odd behavior with the Opus encoder, and I was wondering if this is a known issue.</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">First, note that this problem occurs when the Opus encoder is created with OPUS_APPLICATION_VOIP, there is no issue if the encoder is created with OPUS_APPLICATION_AUDIO.</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">If compiled for a 32 bit architecture (i386), the encoder experiences significant slowdowns when regular audio is followed by digital silence. The size of the encoded frames is also far too big: 128 byes for 20ms of pure silence. The problem does not occur if the library was compiled for a 64 bit architecture (amd64).</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">For example, if a single audio frame (20 ms, 48kHz, mono, 16 bit) normally takes less than a millisecond to encode, after hitting the digital silence opus_encode() can take up to 30ms to encode a single frame. Note that this is longer than the actual frame! Resetting the encoder state after each encoded frame can eliminate the slowdown.</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">I've tested this with versions 1.0.2, 1.0.3, and a couple of 1.1-beta snapshots. The 1.0.x versions experience significant slowdowns. The 1.1-beta is faster, but still not as fast as it probably should be. The 1.0.x versions were tested on Linux and Windows (same problem on both), 1.1-beta was tested only on Linux. Again, when compiled for 64 bit, all versions are fine.</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">I noticed a recent commit that references something that might be related: <a href="http://git.xiph.org/?p=opus.git;a=commit;h=260474fb81463420adf6acbcfdcac892a4b7c912">http://git.xiph.org/?p=opus.git;a=commit;h=260474fb81463420adf6acbcfdcac892a4b7c912</a></span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">However the changes made in the commit do not seem to affect VOIP. I also tried earlier snapshots and the problem is still there (though not as bad since it's the 1.1 branch).</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">Any ideas as to what is going on? I can provide more information if it helps.</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">Thanks,</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">- DB</span></span></p><p class="MsoNormal"><span style="font-family:Verdana"><span style="font-size:12px">&nbsp;</span></span></p></div></span></span>