aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msmpeg4.c
diff options
context:
space:
mode:
authorNick Kurshev <nickols_k@mail.ru>2002-01-20 14:48:02 +0000
committerNick Kurshev <nickols_k@mail.ru>2002-01-20 14:48:02 +0000
commit1e98dffb7aa4b4681ecc7949e7ad58acc80ad86a (patch)
treeeda5315707572d48e2f75e55cd210254068fea18 /libavcodec/msmpeg4.c
parent4bdd9157cc0b06c7001cb93e5cdd6304306253c4 (diff)
downloadffmpeg-1e98dffb7aa4b4681ecc7949e7ad58acc80ad86a.tar.gz
Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Originally committed as revision 274 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r--libavcodec/msmpeg4.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index db767422dc..c5bd55b93c 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -460,7 +460,19 @@ static int msmpeg4_pred_dc(MpegEncContext * s, int n,
: "r" (scale)
: "%eax", "%edx"
);
-#else
+#elif defined (ARCH_ALPHA)
+ /* Divisions are extremely costly on Alpha; optimize the most
+ common case. */
+ if (scale == 8) {
+ a = (a + (8 >> 1)) / 8;
+ b = (b + (8 >> 1)) / 8;
+ c = (c + (8 >> 1)) / 8;
+ } else {
+ a = (a + (scale >> 1)) / scale;
+ b = (b + (scale >> 1)) / scale;
+ c = (c + (scale >> 1)) / scale;
+ }
+#else
a = (a + (scale >> 1)) / scale;
b = (b + (scale >> 1)) / scale;
c = (c + (scale >> 1)) / scale;