[FFmpeg-devel] [PATCH] TAK demuxer and decoder

Paul B Mahol onemda at gmail.com
Sat Oct 6 15:35:51 CEST 2012


On 10/6/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Oct 05, 2012 at 06:42:42AM +0000, Paul B Mahol wrote:
>> On 9/30/12, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Sat, Sep 29, 2012 at 04:27:20PM +0000, Paul B Mahol wrote:
>> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> [...]
>> >> +static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
>> >> +{
>> >> +    GetBitContext  *gb = &s->gb;
>
>> >> +    int32_t *p1 = &s->decode_buffer[c1 * s->nb_samples + 1];
>> >> +    int32_t *p2 = &s->decode_buffer[c2 * s->nb_samples + 1];
>> >> +    int a, b, i, j, x, tmp;
> [...]
>> >> +        for (i = 0; i < length; i++, p1++, p2++) {
>> >> +            x   = (*p2 & 1) + 2 * *p1;
>> >> +            *p1 = (  x - *p2) & 0x80000000 | (  x - *p2 >> 1);
>> >> +            *p2 = (*p2 + x  ) & 0x80000000 | (*p2 + x   >> 1);
>> >
>> > the & 0x80000000 | seems redundant if these are signed 32bit variables
>>
>> They are unsigned.
>
> all the data types look quite signed to me

All such operations are not redundant so all such data types should be unsigned,
unless there is some other way to produce same output with less operations.


More information about the ffmpeg-devel mailing list