<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gregory Maxwell schrieb:
<blockquote
 cite="mid:e692861c0908202214x36dbd9dey195e0a6c0725fff5@mail.gmail.com"
 type="cite">
  <pre wrap="">On Fri, Aug 21, 2009 at 1:12 AM, Gregory Maxwell<a class="moz-txt-link-rfc2396E" href="mailto:gmaxwell@gmail.com">&lt;gmaxwell@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">On Fri, Aug 21, 2009 at 1:07 AM, Volker<a class="moz-txt-link-rfc2396E" href="mailto:v.fischer@nt.tu-darmstadt.de">&lt;v.fischer@nt.tu-darmstadt.de&gt;</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Gregory Maxwell schrieb:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Hm? If you call celt_decode with a null pointer in place of the data
it should fade out the audio after consecutive losses.

The relevant code is around line 1286 in celt.c:
  for (i=0;i&lt;C*N;i++)
     freq[i] = ADD32(EPSILON, MULT16_32_Q15(QCONST16(.9f,15),freq[i]));

        </pre>
      </blockquote>
      <pre wrap="">If I interpret your code correctly, you use an exponential decay for the
fade out. In previous software projects I did something similar and got
strange effects when I applied a multiplication to very small floating point
values. I guess the same happens here, too. You should introduce a bound for
the floating point values. If the signal is below the bound, set the
floating point value to zero and the problems should disapear (I guess ;-)
).
      </pre>
    </blockquote>
    <pre wrap="">The addition of EPSILON prevents the creation of denormals and is more
efficient than the compare and branch required for zeroizing.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This makes me think however.. are you applying any gain control the
the output which might be making a quiet tone loud?</pre>
</blockquote>
I finally understand the code you posted above :-). I was a bit
confused by the ADD32 operation but with your explaination it makes
sense now. Putting your explaination as a comment in the code would
maybe help others, too.<br>
<br>
In llcon, I do not apply any gain to the decoded audio signal. The mono
signal is just copied in both stereo channels of the sound card and
then played by the sound card.<br>
</body>
</html>