diff options
author | 周晓勇 <zhouxiaoyong@loongson.cn> | 2015-07-16 15:06:27 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-16 14:27:49 +0200 |
commit | dcd14db80670866377a880cb3e03c372c5b2ebd5 (patch) | |
tree | 6499f968b7c510f600ab756c29b89b0ccd9a256c | |
parent | f1a38264f20382731cf2cc75fdd98f4c9a84a626 (diff) | |
download | ffmpeg-dcd14db80670866377a880cb3e03c372c5b2ebd5.tar.gz |
avcodec: loongson add constant definition
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mips/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/mips/constants.c | 53 | ||||
-rw-r--r-- | libavcodec/mips/constants.h | 56 |
3 files changed, 110 insertions, 0 deletions
diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index 9eb815a6d0..93ac2dc524 100644 --- a/libavcodec/mips/Makefile +++ b/libavcodec/mips/Makefile @@ -56,6 +56,7 @@ MSA-OBJS-$(CONFIG_IDCTDSP) += mips/idctdsp_msa.o \ MSA-OBJS-$(CONFIG_MPEGVIDEO) += mips/mpegvideo_msa.o MSA-OBJS-$(CONFIG_MPEGVIDEOENC) += mips/mpegvideoencdsp_msa.o MSA-OBJS-$(CONFIG_ME_CMP) += mips/me_cmp_msa.o +MMI-OBJS += mips/constants.o MMI-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o MMI-OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_mmi.o MMI-OBJS-$(CONFIG_H264PRED) += mips/h264pred_mmi.o diff --git a/libavcodec/mips/constants.c b/libavcodec/mips/constants.c new file mode 100644 index 0000000000..135b9d4b87 --- /dev/null +++ b/libavcodec/mips/constants.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015 Loongson Technology Corporation Limited + * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn> + * + * 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 "config.h" +#include "libavutil/mem.h" +#include "constants.h" + +const uint64_t __attribute__ ((aligned(8))) ff_pw_1 = {0x0001000100010001ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_4 = {0x0004000400040004ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_5 = {0x0005000500050005ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_3 = {0x0003000300030003ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_8 = {0x0008000800080008ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_9 = {0x0009000900090009ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_16 = {0x0010001000100010ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_18 = {0x0012001200120012ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_28 = {0x001C001C001C001CULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_32 = {0x0020002000200020ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_53 = {0x0035003500350035ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_64 = {0x0040004000400040ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_128 = {0x0080008000800080ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_m8tom5 = {0xFFFBFFFAFFF9FFF8ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_m4tom1 = {0xFFFFFFFEFFFDFFFCULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_1to4 = {0x0004000300020001ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_5to8 = {0x0008000700060005ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_0to3 = {0x0003000200010000ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pw_4to7 = {0x0007000600050004ULL}; + +const uint64_t __attribute__ ((aligned(8))) ff_pb_1 = {0x0101010101010101ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pb_3 = {0x0303030303030303ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pb_80 = {0x8080808080808080ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_pb_A1 = {0xA1A1A1A1A1A1A1A1ULL}; + +const uint64_t __attribute__ ((aligned(8))) ff_rnd = {0x0004000400040004ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_rnd2 = {0x0040004000400040ULL}; +const uint64_t __attribute__ ((aligned(8))) ff_rnd3 = {0x0020002000200020ULL}; diff --git a/libavcodec/mips/constants.h b/libavcodec/mips/constants.h new file mode 100644 index 0000000000..26b19f0f53 --- /dev/null +++ b/libavcodec/mips/constants.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015 Loongson Technology Corporation Limited + * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn> + * + * 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_CONSTANTS_H +#define AVCODEC_MIPS_CONSTANTS_H + +#include <stdint.h> + +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_1; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_3; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_4; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_5; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_8; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_9; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_16; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_18; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_28; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_32; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_53; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_64; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_128; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_m8tom5; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_m4tom1; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_1to4; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_5to8; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_0to3; +extern const uint64_t __attribute__ ((aligned(8))) ff_pw_4to7; + +extern const uint64_t __attribute__ ((aligned(8))) ff_pb_1; +extern const uint64_t __attribute__ ((aligned(8))) ff_pb_3; +extern const uint64_t __attribute__ ((aligned(8))) ff_pb_80; +extern const uint64_t __attribute__ ((aligned(8))) ff_pb_A1; + +extern const uint64_t __attribute__ ((aligned(8))) ff_rnd; +extern const uint64_t __attribute__ ((aligned(8))) ff_rnd2; +extern const uint64_t __attribute__ ((aligned(8))) ff_rnd3; + +#endif /* AVCODEC_MIPS_CONSTANTS_H */ |