FFmpeg
h264pred_init_mips.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
3  * 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 "libavutil/attributes.h"
23 #include "libavutil/mips/cpu.h"
24 #include "config.h"
25 #include "h264dsp_mips.h"
26 #include "h264pred_mips.h"
27 
29  int bit_depth,
30  const int chroma_format_idc)
31 {
33 
34  if (have_mmi(cpu_flags)) {
35  if (bit_depth == 8) {
36  if (chroma_format_idc == 1) {
39  } else {
42  }
43 
44  h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmi;
47  h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmi;
48  h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmi;
49 
50  #if ARCH_MIPS64
51  switch (codec_id) {
52  case AV_CODEC_ID_SVQ3:
54  break;
55  case AV_CODEC_ID_RV40:
57  break;
58  case AV_CODEC_ID_VP7:
59  case AV_CODEC_ID_VP8:
60  break;
61  default:
63  break;
64  }
65  #endif
66 
68  if (chroma_format_idc == 1) {
70  h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmi;
71  }
72  }
73  }
74  }
75 
76  if (have_msa(cpu_flags)) {
77  if (8 == bit_depth) {
78  if (chroma_format_idc == 1) {
81  }
82 
84  if (chroma_format_idc == 1) {
86  }
87  }
89  && codec_id != AV_CODEC_ID_VP8) {
90  if (chroma_format_idc == 1) {
92  h->pred8x8[LEFT_DC_PRED8x8] =
94  h->pred8x8[TOP_DC_PRED8x8] =
96  h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] =
98  h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] =
100  h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] =
102  h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] =
104  }
105  } else {
107  h->pred8x8[7] = ff_vp8_pred8x8_127_dc_8_msa;
108  h->pred8x8[8] = ff_vp8_pred8x8_129_dc_8_msa;
109  }
110  }
111 
112  if (chroma_format_idc == 1) {
114  }
115 
119 
120  switch (codec_id) {
121  case AV_CODEC_ID_SVQ3:
122  case AV_CODEC_ID_RV40:
123  break;
124  case AV_CODEC_ID_VP7:
125  case AV_CODEC_ID_VP8:
126  h->pred16x16[7] = ff_vp8_pred16x16_127_dc_8_msa;
127  h->pred16x16[8] = ff_vp8_pred16x16_129_dc_8_msa;
128  break;
129  default:
130  h->pred16x16[PLANE_PRED8x8] =
132  break;
133  }
134 
138  }
139  }
140 }
HOR_PRED8x8
#define HOR_PRED8x8
Definition: h264pred.h:69
bit_depth
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:226
ff_pred8x8l_dc_8_mmi
void ff_pred8x8l_dc_8_mmi(uint8_t *src, int has_topleft, int has_topright, ptrdiff_t stride)
Definition: h264pred_mmi.c:246
ff_h264_intra_predict_mad_cow_dc_l00_8x8_msa
void ff_h264_intra_predict_mad_cow_dc_l00_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:504
DC_PRED8x8
#define DC_PRED8x8
Definition: h264pred.h:68
have_mmi
#define have_mmi(flags)
Definition: cpu.h:25
ff_h264_intra_predict_hor_dc_8x8_msa
void ff_h264_intra_predict_hor_dc_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:482
ff_pred16x16_plane_h264_8_mmi
void ff_pred16x16_plane_h264_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:977
ff_pred8x8_dc_8_mmi
void ff_pred8x8_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:577
ff_h264_intra_predict_plane_16x16_msa
void ff_h264_intra_predict_plane_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:516
ff_h264_intra_pred_horiz_16x16_msa
void ff_h264_intra_pred_horiz_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:585
ff_pred16x16_vertical_8_mmi
void ff_pred16x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:30
DC_PRED
@ DC_PRED
Definition: vp9.h:48
ff_pred16x16_horizontal_8_mmi
void ff_pred16x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:60
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:98
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:50
ff_h264_intra_pred_dc_16x16_msa
void ff_h264_intra_pred_dc_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:535
ff_pred8x8_top_dc_8_mmi
void ff_pred8x8_top_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:525
ff_h264_intra_pred_vert_8x8_msa
void ff_h264_intra_pred_vert_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:521
ff_h264_intra_pred_dc_left_16x16_msa
void ff_h264_intra_pred_dc_left_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:592
ff_pred8x8_vertical_8_mmi
void ff_pred8x8_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:465
av_cold
#define av_cold
Definition: attributes.h:90
ff_h264_pred_init_mips
av_cold void ff_h264_pred_init_mips(H264PredContext *h, int codec_id, int bit_depth, const int chroma_format_idc)
Definition: h264pred_init_mips.c:28
ff_h264_intra_predict_dc_4blk_8x8_msa
void ff_h264_intra_predict_dc_4blk_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:477
have_msa
#define have_msa(flags)
Definition: cpu.h:26
ff_h264_intra_predict_vert_dc_8x8_msa
void ff_h264_intra_predict_vert_dc_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:487
codec_id
enum AVCodecID codec_id
Definition: vaapi_decode.c:369
AV_CODEC_ID_SVQ3
@ AV_CODEC_ID_SVQ3
Definition: codec_id.h:73
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:77
TOP_DC_PRED8x8
#define TOP_DC_PRED8x8
Definition: h264pred.h:75
h264pred_mips.h
h264dsp_mips.h
ff_vp8_pred16x16_129_dc_8_msa
void ff_vp8_pred16x16_129_dc_8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:687
ff_h264_intra_pred_horiz_8x8_msa
void ff_h264_intra_pred_horiz_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:528
ff_pred16x16_plane_svq3_8_mmi
void ff_pred16x16_plane_svq3_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:982
ff_h264_intra_pred_vert_16x16_msa
void ff_h264_intra_pred_vert_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:578
VERT_PRED8x8
#define VERT_PRED8x8
Definition: h264pred.h:70
ff_pred16x16_plane_rv40_8_mmi
void ff_pred16x16_plane_rv40_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:987
ff_pred16x16_dc_8_mmi
void ff_pred16x16_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:97
DC_128_PRED8x8
#define DC_128_PRED8x8
Definition: h264pred.h:76
ff_pred8x8l_top_dc_8_mmi
void ff_pred8x8l_top_dc_8_mmi(uint8_t *src, int has_topleft, int has_topright, ptrdiff_t stride)
Definition: h264pred_mmi.c:155
ff_h264_intra_pred_dc_top_16x16_msa
void ff_h264_intra_pred_dc_top_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:624
attributes.h
ff_h264_intra_pred_dc_128_16x16_msa
void ff_h264_intra_pred_dc_128_16x16_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:661
PLANE_PRED8x8
#define PLANE_PRED8x8
Definition: h264pred.h:71
ff_h264_intra_predict_plane_8x8_msa
void ff_h264_intra_predict_plane_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:472
AV_CODEC_ID_VP7
@ AV_CODEC_ID_VP7
Definition: codec_id.h:231
AV_CODEC_ID_RV40
@ AV_CODEC_ID_RV40
Definition: codec_id.h:119
ff_h264_intra_predict_mad_cow_dc_0l0_8x8_msa
void ff_h264_intra_predict_mad_cow_dc_0l0_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:510
ff_h264_intra_pred_dc_128_8x8_msa
void ff_h264_intra_pred_dc_128_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:648
ALZHEIMER_DC_L00_PRED8x8
#define ALZHEIMER_DC_L00_PRED8x8
Definition: h264pred.h:81
LEFT_DC_PRED8x8
#define LEFT_DC_PRED8x8
Definition: h264pred.h:74
ff_h264_intra_predict_mad_cow_dc_l0t_8x8_msa
void ff_h264_intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:492
ff_vp8_pred16x16_127_dc_8_msa
void ff_vp8_pred16x16_127_dc_8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:682
ff_h264_intra_predict_mad_cow_dc_0lt_8x8_msa
void ff_h264_intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:498
ALZHEIMER_DC_0L0_PRED8x8
#define ALZHEIMER_DC_0L0_PRED8x8
Definition: h264pred.h:82
H264PredContext
Context for storing H.264 prediction functions.
Definition: h264pred.h:92
ALZHEIMER_DC_L0T_PRED8x8
#define ALZHEIMER_DC_L0T_PRED8x8
Definition: h264pred.h:79
ff_pred8x8_horizontal_8_mmi
void ff_pred8x8_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:492
TOP_DC_PRED
@ TOP_DC_PRED
Definition: vp9.h:57
cpu.h
AV_CODEC_ID_VP8
@ AV_CODEC_ID_VP8
Definition: codec_id.h:190
ALZHEIMER_DC_0LT_PRED8x8
#define ALZHEIMER_DC_0LT_PRED8x8
Definition: h264pred.h:80
h
h
Definition: vp9dsp_template.c:2038
ff_vp8_pred8x8_129_dc_8_msa
void ff_vp8_pred8x8_129_dc_8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:677
ff_pred8x16_horizontal_8_mmi
void ff_pred8x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:714
ff_vp8_pred8x8_127_dc_8_msa
void ff_vp8_pred8x8_127_dc_8_msa(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_msa.c:672
ff_pred8x16_vertical_8_mmi
void ff_pred8x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
Definition: h264pred_mmi.c:683