[FFmpeg-devel] [PATCH] WMA Voice decoder

Vitor Sessak vitor1001
Tue Feb 9 20:13:31 CET 2010


Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Feb 9, 2010 at 1:14 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>> Ronald S. Bultje wrote:
>>> On Thu, Feb 4, 2010 at 12:06 AM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>>>> Ronald S. Bultje wrote:
>>>>> +    /* exclude ranges from pulses */
>>>>> +    memset(use_mask, -1, 10);
>>>>> +    if (pulse_off != NO_OFFSET)
>>>>> +        for (idx = pulse_off; idx < MAX_FRAMESIZE / 2; idx +=
>>>>> fcb->pitch_lag) {
>>>>> +            int range             = s->aw_pitch_range; // always 16 or
>>>>> 24
>>>>> +            int idx_sh            = idx >> 4;
>>>>> +            int idx_mask          = idx & 15;
>>>>> +            use_mask[idx_sh++]   &= ~(0xFFFF >> idx_mask);
>>>>> +            range                -= 16 - idx_mask;
>>>>> +            use_mask[idx_sh++]   &=   0xFFFF >> range;
>>>>> +            range                -= 16;
>>>>> +            if (range > 0)
>>>>> +                use_mask[idx_sh] &=   0xFFFF >> range;
>>>>> +        }
>>>> Does those excluded indexes correspond to some other pulses set (i.e.
>>>> those
>>>> set in aw_pulse_set1() or those set by aw_pulse_set2() in the last
>>>> frame)?
>>> Approximately, yes. _set1() pulses somewhere around pulse_off, in the
>>> range pulse_off +/- 10 (approximately) depending on bitstream values
>>> read in _set1().
>> Its funny, what is the point of forbidding pulses almost, but not exactly,
>> where you are already adding some in other function? Are you sure it is not
>> exactly the same after addition of pitch delay or something like that?
> 
> Sorry, I meant something different.
> 
> The (repeated) pulse set in set1() is somewhere in the range pulse_off
> -/+ 10 (approximately). We're forbidding pulses in the range pulse_off
> +/- 16/24 in the exclusion code of set2(). So regardless of the
> bitstream value for the exact position of the pulse set in set1(), the
> "extra" pulses in set2() never interfere with any possible pulse in
> set1().
> 
> (Does that make sense?)

Yes, but to what correspond those excluded pulses?

Also

>     for (n = 0; n < 11; n++) {
>         if (off_table[n] >= 0) {
>             int idx = off_table[n] >= MAX_FRAMESIZE / 2;
> 
>             if (s->aw_n_pulses[idx]++ == 0) {
>                 s->aw_first_pulse_off[idx] = off_table[n] -
>                     (idx * MAX_FRAMESIZE + s->aw_pitch_range) / 2;
>                 first_idx[idx]             = n;
>             }
>         }
>     }

      for (n = 0; n < 11 && off_table[n] < 0; n++) ;

      for (; n < 11; n++) {
             int idx = off_table[n] >= MAX_FRAMESIZE / 2;

             if (s->aw_n_pulses[idx]++ == 0) {
                 s->aw_first_pulse_off[idx] = off_table[n] -
                     (idx * MAX_FRAMESIZE + s->aw_pitch_range) / 2;
                 first_idx[idx]             = n;
             }
     }

-Vitor




More information about the ffmpeg-devel mailing list