[FFmpeg-devel] rmdec.c: add SIPR codec try #2

Kostya kostya.shishkov
Wed Mar 18 04:57:32 CET 2009


On Tue, Mar 17, 2009 at 05:34:01PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Mar 17, 2009 at 4:40 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> > On Tue, Mar 17, 2009 at 4:31 PM, Reimar D?ffinger
> > <Reimar.Doeffinger at gmx.de> wrote:
> >> On Tue, Mar 17, 2009 at 04:15:19PM -0400, Ronald S. Bultje wrote:
> >>> Second if: i&1 and !(o&1) after first iteration: !(i&1) and o&1
> >>> Last (else): !(i&1) and o&1 after first iteration: i&1 and !(o&1)
> >>
> >> So either it breaks right after the first iteration or you don't need
> >> one case.
> >
> > Holy shit, how did that work? :-).
> 
> No idea how that worked, but it should break. Probably too many zeroes
> in my test-samples... Anyway, attached is a fixed version, just for
> historical purposes. Kostya, you sure you don't like this one?
> 
> Ronald

[...]
> +        /* swap 4bit-nibbles of block 'i' with 'o' */
> +        if (!((i ^ o) & 1)) LOOP_ITER {
> +            buf[i >> 1] = (buf[i >> 1] & mask2) | (buf[o >> 1] & mask1);
> +            buf[o >> 1] = (buf[o >> 1] & mask2) | tmp;
> +        } LOOP_END else LOOP_ITER {
> +            int shift1 = (i & 1) ? 4 : 0, shift2 = (i & 1) ? 0 : 4;
> +            buf[i >> 1] = (buf[i >> 1] & mask2) |
> +                (((buf[o >> 1] & mask2) << shift1) >> shift2);
> +            buf[o >> 1] = (buf[o >> 1] & mask1) | ((tmp << shift2) >> shift1);
> +        } LOOP_END;

No, that still looks like some suspicious condition.
You'd better write it without macroses.




More information about the ffmpeg-devel mailing list