[FFmpeg-devel] [PATCH] WMA Voice decoder

Vitor Sessak vitor1001
Mon Jan 25 22:19:24 CET 2010


On Mon, Jan 25, 2010 at 10:41 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Sun, Jan 24, 2010 at 10:38 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>> Ronald S. Bultje wrote:
>>> On Jan 23, 2010, at 12:06 AM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>>>>> + ? ? ? ?v = (val & 0x200) ? -1.0 : 1.0;
>>>>> + ? ? ? ?out[idx - delta] = v;
>>>>> + ? ? ? ?out[idx] ? ? ? ? = (val & 1) ? -v : v;
>>>>
>>>> ff_set_fixed_vector()
>>>
>>> How? It doesn't repeat. Esp. If you want to use the same AMRFixed as the
>>> earlier pulses.
>>
>> I see... One way I see is doing "pitch_lag = INT_MAX". Another would be to
>> check (pitch_fac == 0) in ff_set_fixed_vector() and not do the loop in this
>> case.
>>
>> But anyway you will indeed need indeed two AMRFixed structs, one for
>> aw_pulse_set1() and ?one for aw_pulse_set2() :(
>
> Isn't ff_set_fixed_vector() much slower since it enters a loop (once)?

One can do something like

 void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size)
 {
     int i;

    if (in->pitch_fac == 0) {
         for (i=0; i < in->n; i++)
            out[in->x[i]] += in->y[i] * scale;
     } else {
     /// Code that exists currently
     }
}

> I might want to keep this away from unnecessary loops. Does G729/AMR
> have anything like this?

Not AMR, I'll give a look at G729 later.

-Vitor



More information about the ffmpeg-devel mailing list