2 * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "h264dsp_mips.h"
24 static av_cold void h264dsp_init_msa(H264DSPContext *c,
26 const int chroma_format_idc)
29 c->h264_v_loop_filter_luma = ff_h264_v_lpf_luma_inter_msa;
30 c->h264_h_loop_filter_luma = ff_h264_h_lpf_luma_inter_msa;
31 c->h264_h_loop_filter_luma_mbaff =
32 ff_h264_h_loop_filter_luma_mbaff_msa;
33 c->h264_v_loop_filter_luma_intra = ff_h264_v_lpf_luma_intra_msa;
34 c->h264_h_loop_filter_luma_intra = ff_h264_h_lpf_luma_intra_msa;
35 c->h264_h_loop_filter_luma_mbaff_intra =
36 ff_h264_h_loop_filter_luma_mbaff_intra_msa;
37 c->h264_v_loop_filter_chroma = ff_h264_v_lpf_chroma_inter_msa;
39 if (chroma_format_idc <= 1)
40 c->h264_h_loop_filter_chroma = ff_h264_h_lpf_chroma_inter_msa;
42 c->h264_h_loop_filter_chroma =
43 ff_h264_h_loop_filter_chroma422_msa;
45 if (chroma_format_idc > 1)
46 c->h264_h_loop_filter_chroma_mbaff =
47 ff_h264_h_loop_filter_chroma422_mbaff_msa;
49 c->h264_v_loop_filter_chroma_intra =
50 ff_h264_v_lpf_chroma_intra_msa;
52 if (chroma_format_idc <= 1)
53 c->h264_h_loop_filter_chroma_intra =
54 ff_h264_h_lpf_chroma_intra_msa;
57 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels16_8_msa;
58 c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels8_8_msa;
59 c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels4_8_msa;
61 c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16_8_msa;
62 c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels8_8_msa;
63 c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels4_8_msa;
64 } // if (8 == bit_depth)
66 #endif // #if HAVE_MSA
68 av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
69 const int chroma_format_idc)
72 h264dsp_init_msa(c, bit_depth, chroma_format_idc);
73 #endif // #if HAVE_MSA