Re: [FFmpeg-devel] [PATCH 5/5] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for pixblock functions

2015-06-29 Thread Michael Niedermayer
On Sun, Jun 14, 2015 at 11:26:26PM +0530, shivraj.pa...@imgtec.com wrote:
> From: Shivraj Patil 
> 
> This patch adds MSA (MIPS-SIMD-Arch) optimizations for pixblock functions in 
> new file pixblockdsp_msa.c
> Adds new generic macros (needed for this patch) in 
> libavutil/mips/generic_macros_msa.h
> 
> Signed-off-by: Shivraj Patil 
> ---
>  libavcodec/mips/Makefile|   2 +
>  libavcodec/mips/pixblockdsp_init_mips.c |  53 
>  libavcodec/mips/pixblockdsp_mips.h  |  33 
>  libavcodec/mips/pixblockdsp_msa.c   | 143 
> 
>  libavcodec/pixblockdsp.c|   2 +
>  libavcodec/pixblockdsp.h|   2 +
>  libavutil/mips/generic_macros_msa.h |   8 ++
>  7 files changed, 243 insertions(+)
>  create mode 100644 libavcodec/mips/pixblockdsp_init_mips.c
>  create mode 100644 libavcodec/mips/pixblockdsp_mips.h
>  create mode 100644 libavcodec/mips/pixblockdsp_msa.c

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 5/5] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for pixblock functions

2015-06-29 Thread Shivraj Patil
Hi,
May I request somebody from maintainers to review this patch please?

-Original Message-
From: Shivraj Patil 
Sent: 14 June 2015 23:26
To: ffmpeg-devel@ffmpeg.org
Cc: Rob Isherwood; Shivraj Patil
Subject: [PATCH 5/5] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for 
pixblock functions

From: Shivraj Patil 

This patch adds MSA (MIPS-SIMD-Arch) optimizations for pixblock functions in 
new file pixblockdsp_msa.c Adds new generic macros (needed for this patch) in 
libavutil/mips/generic_macros_msa.h

Signed-off-by: Shivraj Patil 
---
 libavcodec/mips/Makefile|   2 +
 libavcodec/mips/pixblockdsp_init_mips.c |  53 
 libavcodec/mips/pixblockdsp_mips.h  |  33 
 libavcodec/mips/pixblockdsp_msa.c   | 143 
 libavcodec/pixblockdsp.c|   2 +
 libavcodec/pixblockdsp.h|   2 +
 libavutil/mips/generic_macros_msa.h |   8 ++
 7 files changed, 243 insertions(+)
 create mode 100644 libavcodec/mips/pixblockdsp_init_mips.c
 create mode 100644 libavcodec/mips/pixblockdsp_mips.h
 create mode 100644 libavcodec/mips/pixblockdsp_msa.c

diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index 
823a2c5..c0ecb15 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -28,6 +28,7 @@ OBJS-$(CONFIG_H263DSP)+= 
mips/h263dsp_init_mips.o
 OBJS-$(CONFIG_QPELDSP)+= mips/qpeldsp_init_mips.o
 OBJS-$(CONFIG_HPELDSP)+= mips/hpeldsp_init_mips.o
 OBJS-$(CONFIG_BLOCKDSP)   += mips/blockdsp_init_mips.o
+OBJS-$(CONFIG_PIXBLOCKDSP)+= mips/pixblockdsp_init_mips.o
 MSA-OBJS-$(CONFIG_HEVC_DECODER)   += mips/hevcdsp_msa.o\
  mips/hevc_mc_uni_msa.o\
  mips/hevc_mc_uniw_msa.o   \
@@ -45,5 +46,6 @@ MSA-OBJS-$(CONFIG_H263DSP)+= 
mips/h263dsp_msa.o
 MSA-OBJS-$(CONFIG_QPELDSP)+= mips/qpeldsp_msa.o
 MSA-OBJS-$(CONFIG_HPELDSP)+= mips/hpeldsp_msa.o
 MSA-OBJS-$(CONFIG_BLOCKDSP)   += mips/blockdsp_msa.o
+MSA-OBJS-$(CONFIG_PIXBLOCKDSP)+= mips/pixblockdsp_msa.o
 LOONGSON3-OBJS-$(CONFIG_H264DSP)  += mips/h264dsp_mmi.o
 LOONGSON3-OBJS-$(CONFIG_H264CHROMA)   += mips/h264chroma_mmi.o
diff --git a/libavcodec/mips/pixblockdsp_init_mips.c 
b/libavcodec/mips/pixblockdsp_init_mips.c
new file mode 100644
index 000..0f2fb15
--- /dev/null
+++ b/libavcodec/mips/pixblockdsp_init_mips.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (shivraj.pa...@imgtec.com)
+ *
+ * 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 "pixblockdsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
+ AVCodecContext *avctx,
+ unsigned high_bit_depth) {
+c->diff_pixels = ff_diff_pixels_msa;
+
+switch (avctx->bits_per_raw_sample) {
+case 9:
+case 10:
+case 12:
+case 14:
+c->get_pixels = ff_get_pixels_16_msa;
+break;
+default:
+if (avctx->bits_per_raw_sample <= 8 || avctx->codec_type !=
+AVMEDIA_TYPE_VIDEO) {
+c->get_pixels = ff_get_pixels_8_msa;
+}
+break;
+}
+}
+#endif  // #if HAVE_MSA
+
+void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
+  unsigned high_bit_depth) { #if HAVE_MSA
+pixblockdsp_init_msa(c, avctx, high_bit_depth); #endif  // #if 
+HAVE_MSA }
diff --git a/libavcodec/mips/pixblockdsp_mips.h 
b/libavcodec/mips/pixblockdsp_mips.h
new file mode 100644
index 000..3eee6e0
--- /dev/null
+++ b/libavcodec/mips/pixblockdsp_mips.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (shivraj.pa...@imgtec.com)
+ *
+ * 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

[FFmpeg-devel] [PATCH 5/5] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for pixblock functions

2015-06-14 Thread shivraj.patil
From: Shivraj Patil 

This patch adds MSA (MIPS-SIMD-Arch) optimizations for pixblock functions in 
new file pixblockdsp_msa.c
Adds new generic macros (needed for this patch) in 
libavutil/mips/generic_macros_msa.h

Signed-off-by: Shivraj Patil 
---
 libavcodec/mips/Makefile|   2 +
 libavcodec/mips/pixblockdsp_init_mips.c |  53 
 libavcodec/mips/pixblockdsp_mips.h  |  33 
 libavcodec/mips/pixblockdsp_msa.c   | 143 
 libavcodec/pixblockdsp.c|   2 +
 libavcodec/pixblockdsp.h|   2 +
 libavutil/mips/generic_macros_msa.h |   8 ++
 7 files changed, 243 insertions(+)
 create mode 100644 libavcodec/mips/pixblockdsp_init_mips.c
 create mode 100644 libavcodec/mips/pixblockdsp_mips.h
 create mode 100644 libavcodec/mips/pixblockdsp_msa.c

diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
index 823a2c5..c0ecb15 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -28,6 +28,7 @@ OBJS-$(CONFIG_H263DSP)+= 
mips/h263dsp_init_mips.o
 OBJS-$(CONFIG_QPELDSP)+= mips/qpeldsp_init_mips.o
 OBJS-$(CONFIG_HPELDSP)+= mips/hpeldsp_init_mips.o
 OBJS-$(CONFIG_BLOCKDSP)   += mips/blockdsp_init_mips.o
+OBJS-$(CONFIG_PIXBLOCKDSP)+= mips/pixblockdsp_init_mips.o
 MSA-OBJS-$(CONFIG_HEVC_DECODER)   += mips/hevcdsp_msa.o\
  mips/hevc_mc_uni_msa.o\
  mips/hevc_mc_uniw_msa.o   \
@@ -45,5 +46,6 @@ MSA-OBJS-$(CONFIG_H263DSP)+= 
mips/h263dsp_msa.o
 MSA-OBJS-$(CONFIG_QPELDSP)+= mips/qpeldsp_msa.o
 MSA-OBJS-$(CONFIG_HPELDSP)+= mips/hpeldsp_msa.o
 MSA-OBJS-$(CONFIG_BLOCKDSP)   += mips/blockdsp_msa.o
+MSA-OBJS-$(CONFIG_PIXBLOCKDSP)+= mips/pixblockdsp_msa.o
 LOONGSON3-OBJS-$(CONFIG_H264DSP)  += mips/h264dsp_mmi.o
 LOONGSON3-OBJS-$(CONFIG_H264CHROMA)   += mips/h264chroma_mmi.o
diff --git a/libavcodec/mips/pixblockdsp_init_mips.c 
b/libavcodec/mips/pixblockdsp_init_mips.c
new file mode 100644
index 000..0f2fb15
--- /dev/null
+++ b/libavcodec/mips/pixblockdsp_init_mips.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (shivraj.pa...@imgtec.com)
+ *
+ * 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 "pixblockdsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
+ AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+c->diff_pixels = ff_diff_pixels_msa;
+
+switch (avctx->bits_per_raw_sample) {
+case 9:
+case 10:
+case 12:
+case 14:
+c->get_pixels = ff_get_pixels_16_msa;
+break;
+default:
+if (avctx->bits_per_raw_sample <= 8 || avctx->codec_type !=
+AVMEDIA_TYPE_VIDEO) {
+c->get_pixels = ff_get_pixels_8_msa;
+}
+break;
+}
+}
+#endif  // #if HAVE_MSA
+
+void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
+  unsigned high_bit_depth)
+{
+#if HAVE_MSA
+pixblockdsp_init_msa(c, avctx, high_bit_depth);
+#endif  // #if HAVE_MSA
+}
diff --git a/libavcodec/mips/pixblockdsp_mips.h 
b/libavcodec/mips/pixblockdsp_mips.h
new file mode 100644
index 000..3eee6e0
--- /dev/null
+++ b/libavcodec/mips/pixblockdsp_mips.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (shivraj.pa...@imgtec.com)
+ *
+ * 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 wi