[Ffmpeg-devel] [PATCH] C93 demuxer and decoder (GSoC qualification task)

Måns Rullgård mans
Mon Apr 2 10:09:03 CEST 2007


Rich Felker <dalias at aerifal.cx> writes:

> On Mon, Apr 02, 2007 at 12:56:25AM +0200, Michael Niedermayer wrote:
>> [...]
>> > +        case C93_4X4_FROM_CURR:
>> > +            for (k = 0; k < 4; k++) {
>> > +                y_off = k > 1 ? 4 : 0;
>> > +                x_off = (k % 2) ? 4 : 0;
>> 
>> why not a y_off and x_off loop?
>
> Keep in mind also: (k % 2) CANNOT be optimized to (k & 1) by the
> compiler unless k is declared as an unsigned type or the compiler can
> prove that k always takes on nonnegative values. So always use &1
> instead of %2 if you mean &1.

Using unsigned types where negative values aren't needed is good
practice as well.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list