FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h264dsp_init_mips.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
3  * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "h264dsp_mips.h"
23 
24 #if HAVE_MSA
25 static av_cold void h264dsp_init_msa(H264DSPContext *c,
26  const int bit_depth,
27  const int chroma_format_idc)
28 {
29  if (8 == bit_depth) {
39 
40  if (chroma_format_idc <= 1)
42  else
45 
46  if (chroma_format_idc > 1)
49 
52 
53  if (chroma_format_idc <= 1)
56 
57  /* Weighted MC */
61 
65 
72 
73  if (chroma_format_idc <= 1)
75  else
77 
80  } // if (8 == bit_depth)
81 }
82 #endif // #if HAVE_MSA
83 
84 #if HAVE_MMI
85 static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
86  const int chroma_format_idc)
87 {
88  if (bit_depth == 8) {
97 
98  if (chroma_format_idc <= 1)
100  else
102 
104 
105  if (chroma_format_idc <= 1)
108  else
111 
115 
119 
122 
123  if (chroma_format_idc <= 1) {
128  }
129 
134  }
135 }
136 #endif /* HAVE_MMI */
137 
138 av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
139  const int chroma_format_idc)
140 {
141 #if HAVE_MSA
142  h264dsp_init_msa(c, bit_depth, chroma_format_idc);
143 #endif // #if HAVE_MSA
144 #if HAVE_MMI
145  h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
146 #endif /* HAVE_MMI */
147 }
void ff_deblock_v_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp_mmi.c:2268
void ff_h264_h_lpf_chroma_inter_msa(uint8_t *src, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_msa.c:2388
void(* h264_idct_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:80
void ff_h264_idct4x4_addblk_dc_msa(uint8_t *dst, int16_t *src, int32_t dst_stride)
Definition: h264idct_msa.c:334
void ff_h264_h_lpf_luma_inter_msa(uint8_t *src, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_msa.c:2343
void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, int weightd, int weights, int offset)
Definition: h264dsp_msa.c:2519
void ff_h264_idct_add16_8_mmi(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp_mmi.c:795
void ff_h264_idct_add8_8_mmi(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp_mmi.c:842
void(* h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp.h:54
void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input, int qmul)
Definition: h264dsp_mmi.c:886
void(* h264_h_loop_filter_luma_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp.h:58
void ff_h264_h_lpf_luma_intra_msa(uint8_t *src, int stride, int alpha, int beta)
Definition: h264dsp_msa.c:2432
void(* h264_h_loop_filter_chroma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:64
void ff_h264_idct8_add4_8_mmi(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp_mmi.c:825
void ff_h264_idct_add8_422_msa(uint8_t **dst, const int32_t *blk_offset, int16_t *block, int32_t dst_stride, const uint8_t nnzc[15 *8])
Definition: h264idct_msa.c:412
void(* h264_add_pixels4_clear)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:107
void(* h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:62
void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_mmi.c:1798
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_mmi.c:1365
void(* h264_idct_add16)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:89
#define av_cold
Definition: attributes.h:82
void ff_h264_v_lpf_luma_intra_msa(uint8_t *src, int stride, int alpha, int beta)
Definition: h264dsp_msa.c:2440
void(* h264_h_loop_filter_luma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:51
void(* h264_idct_add8)(uint8_t **dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:95
void ff_h264_idct8_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp_mmi.c:713
h264_weight_func weight_h264_pixels_tab[4]
Definition: h264dsp.h:43
void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, int weightd, int weights, int offset)
Definition: h264dsp_msa.c:2528
void ff_h264_deq_idct_luma_dc_msa(int16_t *dst, int16_t *src, int32_t de_q_val)
Definition: h264idct_msa.c:465
void(* h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp.h:69
void(* h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:60
void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp_mmi.c:179
void ff_h264_idct_add8_msa(uint8_t **dst, const int32_t *blk_offset, int16_t *block, int32_t dst_stride, const uint8_t nnzc[15 *8])
Definition: h264idct_msa.c:391
void(* h264_idct8_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:82
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)
Definition: h264dsp_mmi.c:1208
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)
Definition: h264dsp_mmi.c:1316
void(* h264_luma_dc_dequant_idct)(int16_t *output, int16_t *input, int qmul)
Definition: h264dsp.h:101
void ff_deblock_h_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_mmi.c:1953
void ff_h264_v_lpf_luma_inter_msa(uint8_t *src, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_msa.c:2365
void ff_h264_h_lpf_chroma_intra_msa(uint8_t *src, int stride, int alpha, int beta)
Definition: h264dsp_msa.c:2448
h264_biweight_func biweight_h264_pixels_tab[4]
Definition: h264dsp.h:44
Context for storing H.264 DSP functions.
Definition: h264dsp.h:41
void(* h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp.h:67
void ff_h264_idct8_dc_addblk_msa(uint8_t *dst, int16_t *src, int32_t dst_stride)
Definition: h264idct_msa.c:340
void(* h264_idct_dc_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:84
void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_msa.c:2505
void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp_mmi.c:1879
void ff_h264_idct_add_msa(uint8_t *dst, int16_t *src, int32_t dst_stride)
Definition: h264idct_msa.c:320
void ff_h264_idct_add8_422_8_mmi(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp_mmi.c:858
void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, int weightd, int weights, int offset)
Definition: h264dsp_msa.c:2537
void ff_h264_idct8_addblk_msa(uint8_t *dst, int16_t *src, int32_t dst_stride)
Definition: h264idct_msa.c:327
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)
Definition: h264dsp_mmi.c:1405
void ff_h264_h_loop_filter_chroma422_msa(uint8_t *src, int32_t stride, int32_t alpha, int32_t beta, int8_t *tc0)
Definition: h264dsp_msa.c:2464
void(* h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:47
void ff_deblock_h_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_mmi.c:2275
av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
void(* h264_idct8_add4)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:92
void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_msa.c:2512
void ff_h264_add_pixels4_8_mmi(uint8_t *_dst, int16_t *_src, int stride)
Definition: h264dsp_mmi.c:30
void ff_h264_idct_add16_msa(uint8_t *dst, const int32_t *blk_offset, int16_t *block, int32_t stride, const uint8_t nnzc[15 *8])
Definition: h264idct_msa.c:346
void(* h264_chroma_dc_dequant_idct)(int16_t *block, int qmul)
Definition: h264dsp.h:103
void ff_h264_v_lpf_chroma_intra_msa(uint8_t *src, int stride, int alpha, int beta)
Definition: h264dsp_msa.c:2456
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_mmi.c:1155
void ff_deblock_v_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_mmi.c:2259
void(* h264_idct8_dc_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:86
void(* h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp.h:56
void ff_deblock_h_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp_mmi.c:2110
static double c[64]
void ff_deblock_h_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha, int beta)
Definition: h264dsp_mmi.c:2521
void ff_h264_h_loop_filter_luma_mbaff_intra_msa(uint8_t *src, int stride, int alpha, int beta)
void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul)
Definition: h264dsp_mmi.c:1108
static unsigned bit_depth(uint64_t mask)
Definition: af_astats.c:142
void ff_h264_idct_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp_mmi.c:662
void ff_h264_idct8_add4_msa(uint8_t *dst, const int *blk_offset, int16_t *blk, int dst_stride, const uint8_t nnzc[15 *8])
void(* h264_idct_add16intra)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:98
void ff_h264_v_lpf_chroma_inter_msa(uint8_t *src, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp_msa.c:2410
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_mmi.c:1276
void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul)
Definition: h264dsp_mmi.c:1141
void(* h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
Definition: h264dsp.h:49
void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp_msa.c:2498
void ff_h264_idct_add16_intra_msa(uint8_t *dst, const int32_t *blk_offset, int16_t *block, int32_t dst_stride, const uint8_t nnzc[15 *8])
Definition: h264idct_msa.c:446
void ff_h264_h_loop_filter_luma_mbaff_msa(uint8_t *src, int32_t stride, int32_t alpha, int32_t beta, int8_t *tc0)
Definition: h264dsp_msa.c:2481
void ff_h264_h_loop_filter_chroma422_mbaff_msa(uint8_t *src, int32_t stride, int32_t alpha, int32_t beta, int8_t *tc0)
Definition: h264dsp_msa.c:2472
void ff_h264_idct_add16intra_8_mmi(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp_mmi.c:812
void ff_h264_idct_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp_mmi.c:84