[FFmpeg-cvslog] avutil/sha512: Reshuffle Maj() operands

Michael Niedermayer git at videolan.org
Sun Jun 2 13:24:01 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun  2 13:18:16 2013 +0200| [09d6beee2496b6d8cd821e914522682cfd18a723] | committer: Michael Niedermayer

avutil/sha512: Reshuffle Maj() operands

This reduces dependancy chains and improves speed by about 2%

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09d6beee2496b6d8cd821e914522682cfd18a723
---

 libavutil/sha512.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/sha512.c b/libavutil/sha512.c
index 7ed4ea5..445480c 100644
--- a/libavutil/sha512.c
+++ b/libavutil/sha512.c
@@ -91,7 +91,7 @@ static const uint64_t K512[80] = {
 #define ror(value, bits) (((value) >> (bits)) | ((value) << (64 - (bits))))
 
 #define Ch(x,y,z)   (((x) & ((y) ^ (z))) ^ (z))
-#define Maj(x,y,z)  ((((x) | (y)) & (z)) | ((x) & (y)))
+#define Maj(z,y,x)  ((((x) | (y)) & (z)) | ((x) & (y)))
 
 #define Sigma0_512(x)   (ror((x), 28) ^ ror((x), 34) ^ ror((x), 39))
 #define Sigma1_512(x)   (ror((x), 14) ^ ror((x), 18) ^ ror((x), 41))



More information about the ffmpeg-cvslog mailing list