"Ronald S. Bultje" <[email protected]> writes: > Hi, > > On Sun, Jul 3, 2011 at 10:24 AM, Mans Rullgard <[email protected]> wrote: >> -#define CORE(i, a, b, c, d) \ >> - t = S[i>>4][i&3];\ >> - a += T[i];\ >> -\ >> - if(i<32){\ >> - if(i<16) a += (d ^ (b&(c^d))) + X[ i &15 ];\ >> - else a += (c ^ (d&(c^b))) + X[ (1+5*i)&15 ];\ >> - }else{\ >> - if(i<48) a += (b^c^d) + X[ (5+3*i)&15 ];\ >> - else a += (c^(b|~d)) + X[ ( 7*i)&15 ];\ >> - }\ >> - a = b + (( a << t ) | ( a >> (32 - t) )); >> - >> -static void body(uint32_t ABCD[4], uint32_t X[16]){ >> - >> +#define CORE(i, a, b, c, d) do { \ >> + t = S[i >> 4][i & 3]; \ >> + a += T[i]; \ >> + \ >> + if (i < 32) { \ >> + if (i < 16) a += (d ^ (b & (c ^ d))) + X[ i & 15]; \ >> + else a += (c ^ (d & (c ^ b))) + X[(1 + 5*i) & 15]; \ >> + } else { \ >> + if (i < 48) a += (b ^ c ^ d) + X[(5 + 3*i) & 15]; \ >> + else a += (c ^ (b | ~d)) + X[( 7*i) & 15]; \ >> + } \ >> + a = b + (a << t | a >> (32 - t)); \ >> + } while (0) > > Big macros like this are just asking to be converted into proper > static av_always_inline functions.
This one modifies its arguments. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
