summaryrefslogtreecommitdiff
path: root/libavcodec/mips/hevc_macros_msa.h
diff options
context:
space:
mode:
authorShivraj Patil <shivraj.patil@imgtec.com>2015-05-28 20:10:58 +0530
committerMichael Niedermayer <michaelni@gmx.at>2015-05-28 16:51:38 +0200
commit10b77fbf0d1b4b3c79d41b49a81ce3c07beae8bb (patch)
tree6291712aa7e2f2587b9ecbe42ec4e2326e71d738 /libavcodec/mips/hevc_macros_msa.h
parent6f2c64fd03a17c804334df8b8406bf7dd1b92c88 (diff)
downloadffmpeg-10b77fbf0d1b4b3c79d41b49a81ce3c07beae8bb.tar.gz
avcodec/mips: Split uni mc optimizations to new file
This patch moves HEVC code of uni mc cases to new file hevc_mc_uni_msa.c. (There are total 5 sub-modules of HEVC mc functions, if we add all these modules in one single file, its size would be huge (~750k) & difficult to maintain, so splitting it in multiple files) This patch also adds new HEVC header file libavcodec/mips/hevc_macros_msa.h Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mips/hevc_macros_msa.h')
-rw-r--r--libavcodec/mips/hevc_macros_msa.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/libavcodec/mips/hevc_macros_msa.h b/libavcodec/mips/hevc_macros_msa.h
new file mode 100644
index 0000000000..7a89f93a9c
--- /dev/null
+++ b/libavcodec/mips/hevc_macros_msa.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@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
+ */
+
+#ifndef AVCODEC_MIPS_HEVC_MACROS_MSA_H
+#define AVCODEC_MIPS_HEVC_MACROS_MSA_H
+
+#define HEVC_PCK_SW_SB2(in0, in1, out) \
+{ \
+ v8i16 tmp0_m; \
+ \
+ tmp0_m = __msa_pckev_h((v8i16) in0, (v8i16) in1); \
+ out = (v4i32) __msa_pckev_b((v16i8) tmp0_m, (v16i8) tmp0_m); \
+}
+
+#define HEVC_PCK_SW_SB4(in0, in1, in2, in3, out) \
+{ \
+ v8i16 tmp0_m, tmp1_m; \
+ \
+ PCKEV_H2_SH(in0, in1, in2, in3, tmp0_m, tmp1_m); \
+ out = (v4i32) __msa_pckev_b((v16i8) tmp1_m, (v16i8) tmp0_m); \
+}
+
+#define HEVC_FILT_8TAP(in0, in1, in2, in3, \
+ filt0, filt1, filt2, filt3) \
+( { \
+ v4i32 out_m; \
+ \
+ out_m = __msa_dotp_s_w((v8i16) in0, (v8i16) filt0); \
+ out_m = __msa_dpadd_s_w(out_m, (v8i16) in1, (v8i16) filt1); \
+ DPADD_SH2_SW(in2, in3, filt2, filt3, out_m, out_m); \
+ out_m; \
+} )
+
+#endif /* AVCODEC_MIPS_HEVC_MACROS_MSA_H */