diff options
author | Shivraj Patil <shivraj.patil@imgtec.com> | 2015-06-11 11:27:01 +0530 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-11 12:24:02 +0200 |
commit | b87dc70c6590556d42ddc21ba0f6e9c790ddd23d (patch) | |
tree | 482d5f7bfea88e5b367e0ea7306392fd58588fc3 /libavcodec/mips/h264chroma_init_mips.c | |
parent | fd004e10d37f448cf6f6aee3bd3788874c1b9fbc (diff) | |
download | ffmpeg-b87dc70c6590556d42ddc21ba0f6e9c790ddd23d.tar.gz |
avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for AVC chroma mc functions
s patch adds MSA (MIPS-SIMD-Arch) optimizations for AVC chroma mc functions in new file h264chroma_msa.c
Adds new generic macros (needed for this patch) in libavutil/mips/generic_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/h264chroma_init_mips.c')
-rw-r--r-- | libavcodec/mips/h264chroma_init_mips.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/mips/h264chroma_init_mips.c b/libavcodec/mips/h264chroma_init_mips.c index 4c10da7488..1cc57674b3 100644 --- a/libavcodec/mips/h264chroma_init_mips.c +++ b/libavcodec/mips/h264chroma_init_mips.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn> + * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com) * * This file is part of FFmpeg. * @@ -20,6 +21,23 @@ #include "h264chroma_mips.h" +#if HAVE_MSA +static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth) +{ + const int high_bit_depth = bit_depth > 8; + + if (!high_bit_depth) { + c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_msa; + c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_msa; + c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_msa; + + c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_msa; + c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_msa; + c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_msa; + } +} +#endif // #if HAVE_MSA + #if HAVE_LOONGSON3 static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth) { @@ -36,6 +54,9 @@ static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth) av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth) { +#if HAVE_MSA + h264chroma_init_msa(c, bit_depth); +#endif // #if HAVE_MSA #if HAVE_LOONGSON3 h264chroma_init_mmi(c, bit_depth); #endif /* HAVE_LOONGSON3 */ |