[CELT-dev] Seamless Looping

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Tue Jan 12 17:36:32 PST 2010


On 2010-01-12 20:00, Chen-Po Sun wrote:
> Just wondering, because it seems to be the case with my listening tests.
> Is CELT supposed to be looping seamlessly without me having to do
> anything special?

It's really hard to be precise without a clear definition of what you 
mean by "looping" and "seemless". What I suspect is that the CELT frames 
are so short that any artefact you may have gets mostly hidden. If you 
really want to do looping samples flawlessly, I would still recommend 
doing some cross-fading. Basically, you should do the same as you would 
do for PCM, except that you also make sure you have gapless support like 
celtenc/celtdec do.

	Jean-Marc

> *Chen-Po Sun* | Programmer
> Firelight Technologies Pty Ltd.
> FMOD Sound System | www.fmod.org
> PH: +61 3 96635947 Fax: +61 3 96635951
>
> On 12/01/2010 22:59, Jean-Marc Valin wrote:
>> Hi,
>>
>> It's really hard to say what's going on without all the details, but
>> it should be pretty easy for you to figure it out by looking at the
>> signal at the sample level. CELT uses fixed frames with (in most
>> modes) 128 samples overlap, so it shouldn't be too confusing.
>>
>> Jean-Marc
>>
>> On 2010-01-11 23:31, Chen-Po Sun wrote:
>>> Hi,
>>>
>>> I've been working on seamless looping of our CELT encoded sound banks.
>>>
>>> One of the tricks we do to get seamless looping with mp3 is to prime the
>>> encoder by encoding last two frames of the source data first, then
>>> discarding the result before doing the actual encoding of the whole
>>> source data.
>>>
>>> I have found that with CELT, I am able to get seamless looping without
>>> having to do any of this.
>>>
>>> Just for kicks though, I decided to implement the same trick of decoding
>>> and discarding of the last two frames first anyway in our CELT encoder.
>>> With this I have found that it actually causes loops to not loop
>>> seamlessly, which surprised me. What would be the cause of this? It
>>> seems quite strange that it would loop okay without the "trick" but not
>>> with it.
>>>
>>> Encode settings are set as follows:
>>>
>>> error = FSBank_CELT_State.celt_encoder_ctl(celtencoder,
>>> CELT_SET_VBR_RATE(0));
>>> error = FSBank_CELT_State.celt_encoder_ctl(celtencoder,
>>> CELT_SET_PREDICTION(0));
>>> error = FSBank_CELT_State.celt_encoder_ctl(celtencoder,
>>> CELT_SET_COMPLEXITY(0));
>>>
>>> Thanks for your help,
>>> --
>>> *Chen-Po Sun* | Programmer
>>> Firelight Technologies Pty Ltd.
>>> FMOD Sound System | www.fmod.org
>>> PH: +61 3 96635947 Fax: +61 3 96635951
>>>
>>>
>>>
>>> _______________________________________________
>>> celt-dev mailing list
>>> celt-dev at xiph.org
>>> http://lists.xiph.org/mailman/listinfo/celt-dev
>>
>>
>
>
> _______________________________________________
> celt-dev mailing list
> celt-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/celt-dev



More information about the celt-dev mailing list