Commit e89e23e1 authored by 周晓勇's avatar 周晓勇 Committed by Michael Niedermayer

avcodec: loongson3 optimized h264dsp weighted mc with mmi

Signed-off-by: 's avatarZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1cf87e16
......@@ -22,3 +22,4 @@ OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o
OBJS-$(CONFIG_H264DSP) += mips/h264dsp_init_mips.o
MSA-OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_msa.o
MSA-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_msa.o
LOONGSON3-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o
/*
* Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
* Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
*
* This file is part of FFmpeg.
*
......@@ -65,10 +66,30 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c,
}
#endif // #if HAVE_MSA
#if HAVE_LOONGSON3
static av_cold void h264dsp_init_mmi(H264DSPContext * c,
const int bit_depth,
const int chroma_format_idc)
{
if (bit_depth == 8) {
c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi;
c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi;
c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi;
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi;
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
}
}
#endif /* HAVE_LOONGSON3 */
av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
{
#if HAVE_MSA
h264dsp_init_msa(c, bit_depth, chroma_format_idc);
#endif // #if HAVE_MSA
#if HAVE_LOONGSON3
h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
#endif /* HAVE_LOONGSON3 */
}
......@@ -68,4 +68,20 @@ void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride, int height,
void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride, int height,
int log2_denom, int weight, int offset);
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset);
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src,
int stride, int height, int log2_denom, int weightd, int weights,
int offset);
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset);
void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src,
int stride, int height, int log2_denom, int weightd, int weights,
int offset);
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset);
void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
int stride, int height, int log2_denom, int weightd, int weights,
int offset);
#endif // #ifndef H264_DSP_MIPS_H
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment