[FFmpeg-devel] [PATCH 2/2] alpha/me_cmp: move code out of dsputil

James Almer jamrial at gmail.com
Fri Jul 18 04:45:35 CEST 2014


Signed-off-by: James Almer <jamrial at gmail.com>
---
Untested.

 libavcodec/alpha/Makefile                          |  5 ++-
 libavcodec/alpha/dsputil_alpha.c                   | 40 ----------------------
 libavcodec/alpha/dsputil_alpha.h                   | 32 -----------------
 .../alpha/{motion_est_alpha.c => me_cmp_alpha.c}   | 27 ++++++++++++---
 .../{motion_est_mvi_asm.S => me_cmp_mvi_asm.S}     |  0
 libavcodec/alpha/pixblockdsp_alpha.c               |  1 -
 6 files changed, 24 insertions(+), 81 deletions(-)
 delete mode 100644 libavcodec/alpha/dsputil_alpha.c
 delete mode 100644 libavcodec/alpha/dsputil_alpha.h
 rename libavcodec/alpha/{motion_est_alpha.c => me_cmp_alpha.c} (88%)
 rename libavcodec/alpha/{motion_est_mvi_asm.S => me_cmp_mvi_asm.S} (100%)

diff --git a/libavcodec/alpha/Makefile b/libavcodec/alpha/Makefile
index 42cabfe..796d976 100644
--- a/libavcodec/alpha/Makefile
+++ b/libavcodec/alpha/Makefile
@@ -1,7 +1,6 @@
 OBJS-$(CONFIG_BLOCKDSP)                 += alpha/blockdsp_alpha.o
-OBJS-$(CONFIG_DSPUTIL)                  += alpha/dsputil_alpha.o        \
-                                           alpha/motion_est_alpha.o     \
-                                           alpha/motion_est_mvi_asm.o
+OBJS-$(CONFIG_ME_CMP)                   += alpha/me_cmp_alpha.o         \
+                                           alpha/me_cmp_mvi_asm.o
 OBJS-$(CONFIG_HPELDSP)                  += alpha/hpeldsp_alpha.o        \
                                            alpha/hpeldsp_alpha_asm.o
 OBJS-$(CONFIG_IDCTDSP)                  += alpha/idctdsp_alpha.o        \
diff --git a/libavcodec/alpha/dsputil_alpha.c b/libavcodec/alpha/dsputil_alpha.c
deleted file mode 100644
index e00497d..0000000
--- a/libavcodec/alpha/dsputil_alpha.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk at debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_alpha.h"
-#include "asm.h"
-
-av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
-{
-    /* amask clears all bits that correspond to present features.  */
-    if (amask(AMASK_MVI) == 0) {
-        c->sad[0]           = pix_abs16x16_mvi_asm;
-        c->sad[1]           = pix_abs8x8_mvi;
-        c->pix_abs[0][0]    = pix_abs16x16_mvi_asm;
-        c->pix_abs[1][0]    = pix_abs8x8_mvi;
-        c->pix_abs[0][1]    = pix_abs16x16_x2_mvi;
-        c->pix_abs[0][2]    = pix_abs16x16_y2_mvi;
-        c->pix_abs[0][3]    = pix_abs16x16_xy2_mvi;
-    }
-
-}
diff --git a/libavcodec/alpha/dsputil_alpha.h b/libavcodec/alpha/dsputil_alpha.h
deleted file mode 100644
index a48765f..0000000
--- a/libavcodec/alpha/dsputil_alpha.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
-#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-
-
-#endif /* AVCODEC_ALPHA_DSPUTIL_ALPHA_H */
diff --git a/libavcodec/alpha/motion_est_alpha.c b/libavcodec/alpha/me_cmp_alpha.c
similarity index 88%
rename from libavcodec/alpha/motion_est_alpha.c
rename to libavcodec/alpha/me_cmp_alpha.c
index 246b4a7..8f36019 100644
--- a/libavcodec/alpha/motion_est_alpha.c
+++ b/libavcodec/alpha/me_cmp_alpha.c
@@ -19,9 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "dsputil_alpha.h"
+#include "libavutil/attributes.h"
+#include "libavcodec/me_cmp.h"
 #include "asm.h"
 
+int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
+
 static inline uint64_t avg2(uint64_t a, uint64_t b)
 {
     return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
@@ -41,7 +44,7 @@ static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4)
     return r1 + r2;
 }
 
-int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 {
     int result = 0;
 
@@ -116,7 +119,7 @@ int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size)
 }
 #endif
 
-int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 {
     int result = 0;
     uint64_t disalign = (size_t) pix2 & 0x7;
@@ -189,7 +192,7 @@ int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
     return result;
 }
 
-int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 {
     int result = 0;
 
@@ -242,7 +245,7 @@ int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
     return result;
 }
 
-int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 {
     int result = 0;
 
@@ -298,3 +301,17 @@ int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
 
     return result;
 }
+
+av_cold void ff_me_cmp_init_alpha(MECmpContext *c, AVCodecContext *avctx)
+{
+    /* amask clears all bits that correspond to present features.  */
+    if (amask(AMASK_MVI) == 0) {
+        c->sad[0]           = pix_abs16x16_mvi_asm;
+        c->sad[1]           = pix_abs8x8_mvi;
+        c->pix_abs[0][0]    = pix_abs16x16_mvi_asm;
+        c->pix_abs[1][0]    = pix_abs8x8_mvi;
+        c->pix_abs[0][1]    = pix_abs16x16_x2_mvi;
+        c->pix_abs[0][2]    = pix_abs16x16_y2_mvi;
+        c->pix_abs[0][3]    = pix_abs16x16_xy2_mvi;
+    }
+}
diff --git a/libavcodec/alpha/motion_est_mvi_asm.S b/libavcodec/alpha/me_cmp_mvi_asm.S
similarity index 100%
rename from libavcodec/alpha/motion_est_mvi_asm.S
rename to libavcodec/alpha/me_cmp_mvi_asm.S
diff --git a/libavcodec/alpha/pixblockdsp_alpha.c b/libavcodec/alpha/pixblockdsp_alpha.c
index c9295e6..4e49c9b 100644
--- a/libavcodec/alpha/pixblockdsp_alpha.c
+++ b/libavcodec/alpha/pixblockdsp_alpha.c
@@ -19,7 +19,6 @@
  */
 
 #include "libavutil/attributes.h"
-#include "libavcodec/dsputil.h"
 #include "libavcodec/pixblockdsp.h"
 #include "asm.h"
 
-- 
1.8.5.5



More information about the ffmpeg-devel mailing list