<div dir="ltr">thanks for all your feedback. here's the revised patch:<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 11, 2017 at 2:20 PM Timothy B. Terriberry <<a href="mailto:tterribe@xiph.org">tterribe@xiph.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jean-Marc Valin wrote:<br>
> I think you'll want something like:<br>
> (opus_int16)((unsigned)demixing_matrix[2*i+1] << 8)<br>
> (though you might want to check it too)<br>
<br>
FWIW, we use the construct<br>
   int s = buf[2*i + 1] << 8 | buf[2*i];<br>
   s = ((s & 0xFFFF) ^ 0x8000) - 0x8000;<br>
<br>
to manually sign-extend the result in opus_compare (and also opus_demo).<br>
If you ultimately cast s to (opus_int16), then I'm pretty sure most<br>
compilers will turn the second line into a no-op and optimize it away.<br>
_______________________________________________<br>
opus mailing list<br>
<a href="mailto:opus@xiph.org" target="_blank">opus@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/opus" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/listinfo/opus</a><br>
</blockquote></div></div>