summaryrefslogtreecommitdiffstats
path: root/libavcodec/mips/h264dsp_init_mips.c
diff options
context:
space:
mode:
author周晓勇 <[email protected]>2015-09-02 18:02:24 +0800
committerMichael Niedermayer <[email protected]>2015-10-16 14:47:56 +0200
commit1a67b0f9ae6c28cdb6ae9c87ae04561d44834053 (patch)
tree56739b86c9103cea3e9d01eb2f7496d5c773ea5e /libavcodec/mips/h264dsp_init_mips.c
parente3fcd88f08f447fe67992f671e92497ddb95f4b1 (diff)
avcodec: loongson optimize h264dsp idct and loop filter with mmi
Change-Id: Ic87fb8f5cd22a502ff9dbbc5a5a8ea97cfc8a1dd Signed-off-by: ZhouXiaoyong <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavcodec/mips/h264dsp_init_mips.c')
-rw-r--r--libavcodec/mips/h264dsp_init_mips.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/libavcodec/mips/h264dsp_init_mips.c b/libavcodec/mips/h264dsp_init_mips.c
index 369462190e..1fe7f8468c 100644
--- a/libavcodec/mips/h264dsp_init_mips.c
+++ b/libavcodec/mips/h264dsp_init_mips.c
@@ -82,11 +82,33 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c,
#endif // #if HAVE_MSA
#if HAVE_MMI
-static av_cold void h264dsp_init_mmi(H264DSPContext * c,
- const int bit_depth,
- const int chroma_format_idc)
+static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
+ const int chroma_format_idc)
{
if (bit_depth == 8) {
+ c->h264_add_pixels4_clear = ff_h264_add_pixels4_8_mmi;
+ c->h264_idct_add = ff_h264_idct_add_8_mmi;
+ c->h264_idct8_add = ff_h264_idct8_add_8_mmi;
+ c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmi;
+ c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmi;
+ c->h264_idct_add16 = ff_h264_idct_add16_8_mmi;
+ c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmi;
+ c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmi;
+
+ if (chroma_format_idc <= 1)
+ c->h264_idct_add8 = ff_h264_idct_add8_8_mmi;
+ else
+ c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmi;
+
+ c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_8_mmi;
+
+ if (chroma_format_idc <= 1)
+ c->h264_chroma_dc_dequant_idct =
+ ff_h264_chroma_dc_dequant_idct_8_mmi;
+ else
+ c->h264_chroma_dc_dequant_idct =
+ ff_h264_chroma422_dc_dequant_idct_8_mmi;
+
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;
@@ -94,6 +116,21 @@ static av_cold void h264dsp_init_mmi(H264DSPContext * c,
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;
+
+ c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmi;
+ c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmi;
+
+ if (chroma_format_idc <= 1) {
+ c->h264_h_loop_filter_chroma =
+ ff_deblock_h_chroma_8_mmi;
+ c->h264_h_loop_filter_chroma_intra =
+ ff_deblock_h_chroma_intra_8_mmi;
+ }
+
+ c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmi;
+ c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmi;
+ c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmi;
+ c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmi;
}
}
#endif /* HAVE_MMI */