On Tue, Feb 02, 2016 at 01:54:10AM -0300, James Almer wrote:
> > diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
> > index ce06b90..301b39b 100644
> > --- a/libavcodec/x86/Makefile
> > +++ b/libavcodec/x86/Makefile
> > @@ -133,7 +133,7 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o
> >  YASM-OBJS-$(CONFIG_ALAC_DECODER)       += x86/alacdsp.o
> >  YASM-OBJS-$(CONFIG_APNG_DECODER)       += x86/pngdsp.o
> >  YASM-OBJS-$(CONFIG_DCA_DECODER)        += x86/synth_filter.o
> > -YASM-OBJS-$(CONFIG_DIRAC_DECODER)      += x86/diracdsp_mmx.o 
> > x86/diracdsp_yasm.o \
> > +YASM-OBJS-$(CONFIG_DIRAC_DECODER)      += x86/diracdsp.o 
> > x86/diracdsp_init.o \
> 
> diracdsp_init.o should be part of OBJS, not YASM-OBJS.

Done.

> 
> While you're at it you could also change dirac_dwt in a similar
> fashion.

And done.

Timothy
>From af049dcfa5d769b5a48fc0768790a3a406d4035e Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothyg...@gmail.com>
Date: Mon, 1 Feb 2016 20:50:22 -0800
Subject: [PATCH 1/2] diracdsp: Make x86 files/functions names consistent

---
 libavcodec/diracdsp.c                              |  4 +-
 libavcodec/diracdsp.h                              |  1 +
 libavcodec/x86/Makefile                            |  3 +-
 libavcodec/x86/{diracdsp_yasm.asm => diracdsp.asm} |  0
 libavcodec/x86/{diracdsp_mmx.c => diracdsp_init.c} | 45 +++++++++++++++++----
 libavcodec/x86/diracdsp_mmx.h                      | 47 ----------------------
 6 files changed, 43 insertions(+), 57 deletions(-)
 rename libavcodec/x86/{diracdsp_yasm.asm => diracdsp.asm} (100%)
 rename libavcodec/x86/{diracdsp_mmx.c => diracdsp_init.c} (80%)
 delete mode 100644 libavcodec/x86/diracdsp_mmx.h

diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c
index 12f27ce..ab8d149 100644
--- a/libavcodec/diracdsp.c
+++ b/libavcodec/diracdsp.c
@@ -20,7 +20,6 @@
 
 #include "avcodec.h"
 #include "diracdsp.h"
-#include "libavcodec/x86/diracdsp_mmx.h"
 
 #define FILTER(src, stride)                                     \
     ((21*((src)[ 0*stride] + (src)[1*stride])                   \
@@ -222,5 +221,6 @@ av_cold void ff_diracdsp_init(DiracDSPContext *c)
     PIXFUNC(avg, 16);
     PIXFUNC(avg, 32);
 
-    if (HAVE_MMX && HAVE_YASM) ff_diracdsp_init_mmx(c);
+    if (ARCH_X86)
+        ff_diracdsp_init_x86(c);
 }
diff --git a/libavcodec/diracdsp.h b/libavcodec/diracdsp.h
index 439bda2..25a872d 100644
--- a/libavcodec/diracdsp.h
+++ b/libavcodec/diracdsp.h
@@ -63,5 +63,6 @@ DECL_DIRAC_PIXOP(put, l4_c);
 DECL_DIRAC_PIXOP(avg, l4_c);
 
 void ff_diracdsp_init(DiracDSPContext *c);
+void ff_diracdsp_init_x86(DiracDSPContext* c);
 
 #endif /* AVCODEC_DIRACDSP_H */
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index ce06b90..1baec49 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -6,6 +6,7 @@ OBJS-$(CONFIG_AUDIODSP)                += x86/audiodsp_init.o
 OBJS-$(CONFIG_BLOCKDSP)                += x86/blockdsp_init.o
 OBJS-$(CONFIG_BSWAPDSP)                += x86/bswapdsp_init.o
 OBJS-$(CONFIG_DCT)                     += x86/dct_init.o
+OBJS-$(CONFIG_DIRAC_DECODER)           += x86/diracdsp_init.o
 OBJS-$(CONFIG_FDCTDSP)                 += x86/fdctdsp_init.o
 OBJS-$(CONFIG_FFT)                     += x86/fft_init.o
 OBJS-$(CONFIG_FLACDSP)                 += x86/flacdsp_init.o
@@ -133,7 +134,7 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o
 YASM-OBJS-$(CONFIG_ALAC_DECODER)       += x86/alacdsp.o
 YASM-OBJS-$(CONFIG_APNG_DECODER)       += x86/pngdsp.o
 YASM-OBJS-$(CONFIG_DCA_DECODER)        += x86/synth_filter.o
-YASM-OBJS-$(CONFIG_DIRAC_DECODER)      += x86/diracdsp_mmx.o x86/diracdsp_yasm.o \
+YASM-OBJS-$(CONFIG_DIRAC_DECODER)      += x86/diracdsp.o                \
                                           x86/dwt_yasm.o
 YASM-OBJS-$(CONFIG_DNXHD_ENCODER)      += x86/dnxhdenc.o
 YASM-OBJS-$(CONFIG_FLAC_DECODER)       += x86/flacdsp.o
diff --git a/libavcodec/x86/diracdsp_yasm.asm b/libavcodec/x86/diracdsp.asm
similarity index 100%
rename from libavcodec/x86/diracdsp_yasm.asm
rename to libavcodec/x86/diracdsp.asm
diff --git a/libavcodec/x86/diracdsp_mmx.c b/libavcodec/x86/diracdsp_init.c
similarity index 80%
rename from libavcodec/x86/diracdsp_mmx.c
rename to libavcodec/x86/diracdsp_init.c
index d260364..5fae798 100644
--- a/libavcodec/x86/diracdsp_mmx.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -19,14 +19,35 @@
  */
 
 #include "libavutil/x86/cpu.h"
-#include "diracdsp_mmx.h"
+#include "libavcodec/diracdsp.h"
 #include "fpel.h"
 
+DECL_DIRAC_PIXOP(put, mmx);
+DECL_DIRAC_PIXOP(avg, mmx);
+DECL_DIRAC_PIXOP(avg, mmxext);
+
+void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
+void ff_avg_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
+void ff_put_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
+void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
+
+void ff_add_rect_clamped_mmx(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int);
+void ff_add_rect_clamped_sse2(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int);
+
+void ff_add_dirac_obmc8_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
+void ff_add_dirac_obmc16_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
+void ff_add_dirac_obmc32_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
+
+void ff_add_dirac_obmc16_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
+void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
+
 void ff_put_rect_clamped_mmx(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height);
 void ff_put_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_mmx(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height);
 
+#if HAVE_YASM
+
 #define HPEL_FILTER(MMSIZE, EXT)                                                             \
     void ff_dirac_hpel_filter_v_ ## EXT(uint8_t *, const uint8_t *, int, int);               \
     void ff_dirac_hpel_filter_h_ ## EXT(uint8_t *, const uint8_t *, int);                    \
@@ -47,11 +68,6 @@ void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t
         }                                                                                    \
     }
 
-#if !ARCH_X86_64
-HPEL_FILTER(8, mmx)
-#endif
-HPEL_FILTER(16, sse2)
-
 #define PIXFUNC(PFX, IDX, EXT)                                                   \
     /*MMXDISABLEDc->PFX ## _dirac_pixels_tab[0][IDX] = ff_ ## PFX ## _dirac_pixels8_ ## EXT;*/  \
     c->PFX ## _dirac_pixels_tab[1][IDX] = ff_ ## PFX ## _dirac_pixels16_ ## EXT; \
@@ -119,7 +135,22 @@ void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride,
     }
 }
 
-void ff_diracdsp_init_mmx(DiracDSPContext* c)
+#else // HAVE_YASM
+
+#define HPEL_FILTER(MMSIZE, EXT)                                                     \
+    void dirac_hpel_filter_ ## EXT(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc,              \
+                                   const uint8_t *src, int stride, int width, int height);
+
+#define PIXFUNC(PFX, IDX, EXT) do {} while (0)
+
+#endif // HAVE_YASM
+
+#if !ARCH_X86_64
+HPEL_FILTER(8, mmx)
+#endif
+HPEL_FILTER(16, sse2)
+
+void ff_diracdsp_init_x86(DiracDSPContext* c)
 {
     int mm_flags = av_get_cpu_flags();
 
diff --git a/libavcodec/x86/diracdsp_mmx.h b/libavcodec/x86/diracdsp_mmx.h
deleted file mode 100644
index d15dc91..0000000
--- a/libavcodec/x86/diracdsp_mmx.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2010 David Conrad
- *
- * 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_X86_DIRACDSP_MMX_H
-#define AVCODEC_X86_DIRACDSP_MMX_H
-
-#include "libavcodec/diracdsp.h"
-
-void ff_diracdsp_init_mmx(DiracDSPContext* c);
-
-DECL_DIRAC_PIXOP(put, mmx);
-DECL_DIRAC_PIXOP(avg, mmx);
-DECL_DIRAC_PIXOP(avg, mmxext);
-
-void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
-void ff_avg_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
-void ff_put_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
-void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h);
-
-void ff_add_rect_clamped_mmx(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int);
-void ff_add_rect_clamped_sse2(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int);
-
-void ff_add_dirac_obmc8_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-void ff_add_dirac_obmc16_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-void ff_add_dirac_obmc32_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-
-void ff_add_dirac_obmc16_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-
-#endif
-- 
2.1.4

>From ffe6d8055bbdeba316e92c4bbf18798ba4d9f069 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothyg...@gmail.com>
Date: Wed, 3 Feb 2016 00:21:46 +0000
Subject: [PATCH 2/2] dirac_dwt: Make x86 files/functions names consistent

---
 libavcodec/dirac_dwt.c                           |  5 ++--
 libavcodec/dirac_dwt.h                           |  1 +
 libavcodec/x86/Makefile                          |  6 ++---
 libavcodec/x86/{dwt_yasm.asm => dirac_dwt.asm}   |  2 +-
 libavcodec/x86/dirac_dwt.h                       | 30 ------------------------
 libavcodec/x86/{dirac_dwt.c => dirac_dwt_init.c} |  6 ++---
 6 files changed, 10 insertions(+), 40 deletions(-)
 rename libavcodec/x86/{dwt_yasm.asm => dirac_dwt.asm} (99%)
 delete mode 100644 libavcodec/x86/dirac_dwt.h
 rename libavcodec/x86/{dirac_dwt.c => dirac_dwt_init.c} (98%)

diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c
index 6cf32ae..a267aac 100644
--- a/libavcodec/dirac_dwt.c
+++ b/libavcodec/dirac_dwt.c
@@ -23,7 +23,6 @@
 #include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "dirac_dwt.h"
-#include "libavcodec/x86/dirac_dwt.h"
 
 #define TEMPLATE_8bit
 #include "dirac_dwt_template.c"
@@ -54,8 +53,8 @@ int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height,
         return AVERROR_INVALIDDATA;
     }
 
-    if (bit_depth == 8 && HAVE_MMX)
-        ff_spatial_idwt_init_mmx(d, type);
+    if (bit_depth == 8 && ARCH_X86)
+        ff_spatial_idwt_init_x86(d, type);
     return 0;
 }
 
diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index 41842b5..b3be596 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -79,6 +79,7 @@ enum dwt_type {
 int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height,
                           int stride, enum dwt_type type, int decomposition_count,
                           uint8_t *temp, int bit_depth);
+void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type);
 
 void ff_spatial_idwt_slice2(DWTContext *d, int y);
 
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 1baec49..bfdf0b3 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -6,7 +6,8 @@ OBJS-$(CONFIG_AUDIODSP)                += x86/audiodsp_init.o
 OBJS-$(CONFIG_BLOCKDSP)                += x86/blockdsp_init.o
 OBJS-$(CONFIG_BSWAPDSP)                += x86/bswapdsp_init.o
 OBJS-$(CONFIG_DCT)                     += x86/dct_init.o
-OBJS-$(CONFIG_DIRAC_DECODER)           += x86/diracdsp_init.o
+OBJS-$(CONFIG_DIRAC_DECODER)           += x86/diracdsp_init.o           \
+                                          x86/dirac_dwt_init.o
 OBJS-$(CONFIG_FDCTDSP)                 += x86/fdctdsp_init.o
 OBJS-$(CONFIG_FFT)                     += x86/fft_init.o
 OBJS-$(CONFIG_FLACDSP)                 += x86/flacdsp_init.o
@@ -73,7 +74,6 @@ OBJS-$(CONFIG_WEBP_DECODER)            += x86/vp8dsp_init.o
 
 # GCC inline assembly optimizations
 # subsystems
-MMX-OBJS-$(CONFIG_DIRAC_DECODER)       += x86/dirac_dwt.o
 MMX-OBJS-$(CONFIG_FDCTDSP)             += x86/fdct.o
 MMX-OBJS-$(CONFIG_IDCTDSP)             += x86/simple_idct.o
 
@@ -135,7 +135,7 @@ YASM-OBJS-$(CONFIG_ALAC_DECODER)       += x86/alacdsp.o
 YASM-OBJS-$(CONFIG_APNG_DECODER)       += x86/pngdsp.o
 YASM-OBJS-$(CONFIG_DCA_DECODER)        += x86/synth_filter.o
 YASM-OBJS-$(CONFIG_DIRAC_DECODER)      += x86/diracdsp.o                \
-                                          x86/dwt_yasm.o
+                                          x86/dirac_dwt.o
 YASM-OBJS-$(CONFIG_DNXHD_ENCODER)      += x86/dnxhdenc.o
 YASM-OBJS-$(CONFIG_FLAC_DECODER)       += x86/flacdsp.o
 ifdef CONFIG_GPL
diff --git a/libavcodec/x86/dwt_yasm.asm b/libavcodec/x86/dirac_dwt.asm
similarity index 99%
rename from libavcodec/x86/dwt_yasm.asm
rename to libavcodec/x86/dirac_dwt.asm
index 658acc1..8980689 100644
--- a/libavcodec/x86/dwt_yasm.asm
+++ b/libavcodec/x86/dirac_dwt.asm
@@ -1,5 +1,5 @@
 ;******************************************************************************
-;* MMX optimized discrete wavelet trasnform
+;* x86 optimized discrete wavelet trasnform
 ;* Copyright (c) 2010 David Conrad
 ;*
 ;* This file is part of FFmpeg.
diff --git a/libavcodec/x86/dirac_dwt.h b/libavcodec/x86/dirac_dwt.h
deleted file mode 100644
index 126b290..0000000
--- a/libavcodec/x86/dirac_dwt.h
+++ /dev/null
@@ -1,30 +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_X86_DIRAC_DWT_H
-#define AVCODEC_X86_DIRAC_DWT_H
-
-#include "libavcodec/dirac_dwt.h"
-
-void ff_horizontal_compose_dd97i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
-void ff_horizontal_compose_haar1i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
-void ff_horizontal_compose_haar0i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
-
-void ff_spatial_idwt_init_mmx(DWTContext *d, enum dwt_type type);
-
-#endif
diff --git a/libavcodec/x86/dirac_dwt.c b/libavcodec/x86/dirac_dwt_init.c
similarity index 98%
rename from libavcodec/x86/dirac_dwt.c
rename to libavcodec/x86/dirac_dwt_init.c
index c9c7093..afdf0a1 100644
--- a/libavcodec/x86/dirac_dwt.c
+++ b/libavcodec/x86/dirac_dwt_init.c
@@ -1,5 +1,5 @@
 /*
- * MMX optimized discrete wavelet transform
+ * x86 optimized discrete wavelet transform
  * Copyright (c) 2002-2004 Michael Niedermayer <michae...@gmx.at>
  * Copyright (c) 2010 David Conrad
  *
@@ -22,7 +22,7 @@
 
 #include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
-#include "dirac_dwt.h"
+#include "libavcodec/dirac_dwt.h"
 
 #define COMPOSE_VERTICAL(ext, align) \
 void ff_vertical_compose53iL0##ext(int16_t *b0, int16_t *b1, int16_t *b2, int width); \
@@ -158,7 +158,7 @@ static void horizontal_compose_dd97i_ssse3(uint8_t *_b, uint8_t *_tmp, int w)
 }
 #endif
 
-void ff_spatial_idwt_init_mmx(DWTContext *d, enum dwt_type type)
+void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type)
 {
 #if HAVE_YASM
   int mm_flags = av_get_cpu_flags();
-- 
2.1.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to