Coverage Report

Created: 2025-11-11 06:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libavc/decoder/ih264d_function_selector_generic.c
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Copyright (C) 2015 The Android Open Source Project
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at:
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 *****************************************************************************
18
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19
*/
20
/**
21
 *******************************************************************************
22
 * @file
23
 *  ih264e_function_selector_generic.c
24
 *
25
 * @brief
26
 *  Contains functions to initialize function pointers of codec context
27
 *
28
 * @author
29
 *  Ittiam
30
 *
31
 * @par List of Functions:
32
 *  - ih264e_init_function_ptr_generic
33
 *
34
 * @remarks
35
 *  None
36
 *
37
 *******************************************************************************
38
 */
39
40
/*****************************************************************************/
41
/* File Includes                                                             */
42
/*****************************************************************************/
43
44
/* System Include files */
45
#include <stdio.h>
46
#include <stddef.h>
47
#include <stdlib.h>
48
#include <string.h>
49
50
/* User Include files */
51
#include "ih264_typedefs.h"
52
#include "iv.h"
53
#include "ivd.h"
54
#include "ih264_defs.h"
55
#include "ih264_size_defs.h"
56
#include "ih264_error.h"
57
#include "ih264_trans_quant_itrans_iquant.h"
58
#include "ih264_inter_pred_filters.h"
59
60
#include "ih264d_structs.h"
61
#include "ih264d_function_selector.h"
62
63
/**
64
 *******************************************************************************
65
 *
66
 * @brief Initialize the intra/inter/transform/deblk function pointers of
67
 * codec context
68
 *
69
 * @par Description: the current routine initializes the function pointers of
70
 * codec context basing on the architecture in use
71
 *
72
 * @param[in] ps_codec
73
 *  Codec context pointer
74
 *
75
 * @returns  none
76
 *
77
 * @remarks none
78
 *
79
 *******************************************************************************
80
 */
81
void ih264d_init_function_ptr_generic(dec_struct_t *ps_codec)
82
227k
{
83
84
227k
    WORD32 i = 0;
85
86
    /* Init function pointers for intra pred leaf level functions luma
87
     * Intra 16x16 */
88
227k
    ps_codec->apf_intra_pred_luma_16x16[0] =
89
227k
                    ih264_intra_pred_luma_16x16_mode_vert;
90
227k
    ps_codec->apf_intra_pred_luma_16x16[1] =
91
227k
                    ih264_intra_pred_luma_16x16_mode_horz;
92
227k
    ps_codec->apf_intra_pred_luma_16x16[2] =
93
227k
                    ih264_intra_pred_luma_16x16_mode_dc;
94
227k
    ps_codec->apf_intra_pred_luma_16x16[3] =
95
227k
                    ih264_intra_pred_luma_16x16_mode_plane;
96
97
    /* Init function pointers for intra pred leaf level functions luma
98
     * Intra 4x4 */
99
227k
    ps_codec->apf_intra_pred_luma_4x4[0] = ih264_intra_pred_luma_4x4_mode_vert;
100
227k
    ps_codec->apf_intra_pred_luma_4x4[1] = ih264_intra_pred_luma_4x4_mode_horz;
101
227k
    ps_codec->apf_intra_pred_luma_4x4[2] = ih264_intra_pred_luma_4x4_mode_dc;
102
227k
    ps_codec->apf_intra_pred_luma_4x4[3] =
103
227k
                    ih264_intra_pred_luma_4x4_mode_diag_dl;
104
227k
    ps_codec->apf_intra_pred_luma_4x4[4] =
105
227k
                    ih264_intra_pred_luma_4x4_mode_diag_dr;
106
227k
    ps_codec->apf_intra_pred_luma_4x4[5] =
107
227k
                    ih264_intra_pred_luma_4x4_mode_vert_r;
108
227k
    ps_codec->apf_intra_pred_luma_4x4[6] =
109
227k
                    ih264_intra_pred_luma_4x4_mode_horz_d;
110
227k
    ps_codec->apf_intra_pred_luma_4x4[7] =
111
227k
                    ih264_intra_pred_luma_4x4_mode_vert_l;
112
227k
    ps_codec->apf_intra_pred_luma_4x4[8] =
113
227k
                    ih264_intra_pred_luma_4x4_mode_horz_u;
114
115
    /* Init function pointers for intra pred leaf level functions luma
116
     * Intra 8x8 */
117
227k
    ps_codec->apf_intra_pred_luma_8x8[0] = ih264_intra_pred_luma_8x8_mode_vert;
118
227k
    ps_codec->apf_intra_pred_luma_8x8[1] = ih264_intra_pred_luma_8x8_mode_horz;
119
227k
    ps_codec->apf_intra_pred_luma_8x8[2] = ih264_intra_pred_luma_8x8_mode_dc;
120
227k
    ps_codec->apf_intra_pred_luma_8x8[3] =
121
227k
                    ih264_intra_pred_luma_8x8_mode_diag_dl;
122
227k
    ps_codec->apf_intra_pred_luma_8x8[4] =
123
227k
                    ih264_intra_pred_luma_8x8_mode_diag_dr;
124
227k
    ps_codec->apf_intra_pred_luma_8x8[5] =
125
227k
                    ih264_intra_pred_luma_8x8_mode_vert_r;
126
227k
    ps_codec->apf_intra_pred_luma_8x8[6] =
127
227k
                    ih264_intra_pred_luma_8x8_mode_horz_d;
128
227k
    ps_codec->apf_intra_pred_luma_8x8[7] =
129
227k
                    ih264_intra_pred_luma_8x8_mode_vert_l;
130
227k
    ps_codec->apf_intra_pred_luma_8x8[8] =
131
227k
                    ih264_intra_pred_luma_8x8_mode_horz_u;
132
133
227k
    ps_codec->pf_intra_pred_ref_filtering =
134
227k
                    ih264_intra_pred_luma_8x8_mode_ref_filtering;
135
136
    /* Init function pointers for intra pred leaf level functions chroma
137
     * Intra 8x8 */
138
227k
    ps_codec->apf_intra_pred_chroma[0] = ih264_intra_pred_chroma_8x8_mode_vert;
139
227k
    ps_codec->apf_intra_pred_chroma[1] = ih264_intra_pred_chroma_8x8_mode_horz;
140
227k
    ps_codec->apf_intra_pred_chroma[2] = ih264_intra_pred_chroma_8x8_mode_dc;
141
227k
    ps_codec->apf_intra_pred_chroma[3] = ih264_intra_pred_chroma_8x8_mode_plane;
142
143
227k
    ps_codec->pf_default_weighted_pred_luma = ih264_default_weighted_pred_luma;
144
227k
    ps_codec->pf_default_weighted_pred_chroma =
145
227k
                    ih264_default_weighted_pred_chroma;
146
227k
    ps_codec->pf_weighted_pred_luma = ih264_weighted_pred_luma;
147
227k
    ps_codec->pf_weighted_pred_chroma = ih264_weighted_pred_chroma;
148
227k
    ps_codec->pf_weighted_bi_pred_luma = ih264_weighted_bi_pred_luma;
149
227k
    ps_codec->pf_weighted_bi_pred_chroma = ih264_weighted_bi_pred_chroma;
150
151
    /* Padding Functions */
152
227k
    ps_codec->pf_pad_top = ih264_pad_top;
153
227k
    ps_codec->pf_pad_bottom = ih264_pad_bottom;
154
227k
    ps_codec->pf_pad_left_luma = ih264_pad_left_luma;
155
227k
    ps_codec->pf_pad_left_chroma = ih264_pad_left_chroma;
156
227k
    ps_codec->pf_pad_right_luma = ih264_pad_right_luma;
157
227k
    ps_codec->pf_pad_right_chroma = ih264_pad_right_chroma;
158
159
227k
    ps_codec->pf_iquant_itrans_recon_luma_4x4 = ih264_iquant_itrans_recon_4x4;
160
227k
    ps_codec->pf_iquant_itrans_recon_luma_4x4_dc =
161
227k
                    ih264_iquant_itrans_recon_4x4_dc;
162
227k
    ps_codec->pf_iquant_itrans_recon_luma_8x8 = ih264_iquant_itrans_recon_8x8;
163
227k
    ps_codec->pf_iquant_itrans_recon_luma_8x8_dc =
164
227k
                    ih264_iquant_itrans_recon_8x8_dc;
165
227k
    ps_codec->pf_iquant_itrans_recon_chroma_4x4 =
166
227k
                    ih264_iquant_itrans_recon_chroma_4x4;
167
227k
    ps_codec->pf_iquant_itrans_recon_chroma_4x4_dc =
168
227k
                    ih264_iquant_itrans_recon_chroma_4x4_dc;
169
227k
    ps_codec->pf_ihadamard_scaling_4x4 = ih264_ihadamard_scaling_4x4;
170
171
    /* Init fn ptr luma deblocking */
172
227k
    ps_codec->pf_deblk_luma_vert_bs4 = ih264_deblk_luma_vert_bs4;
173
227k
    ps_codec->pf_deblk_luma_vert_bslt4 = ih264_deblk_luma_vert_bslt4;
174
227k
    ps_codec->pf_deblk_luma_vert_bs4_mbaff = ih264_deblk_luma_vert_bs4_mbaff;
175
227k
    ps_codec->pf_deblk_luma_vert_bslt4_mbaff =
176
227k
                    ih264_deblk_luma_vert_bslt4_mbaff;
177
178
227k
    ps_codec->pf_deblk_luma_horz_bs4 = ih264_deblk_luma_horz_bs4;
179
227k
    ps_codec->pf_deblk_luma_horz_bslt4 = ih264_deblk_luma_horz_bslt4;
180
181
    /* Init fn ptr chroma deblocking */
182
227k
    ps_codec->pf_deblk_chroma_vert_bs4 = ih264_deblk_chroma_vert_bs4;
183
227k
    ps_codec->pf_deblk_chroma_vert_bslt4 = ih264_deblk_chroma_vert_bslt4;
184
227k
    ps_codec->pf_deblk_chroma_vert_bs4_mbaff =
185
227k
                    ih264_deblk_chroma_vert_bs4_mbaff;
186
227k
    ps_codec->pf_deblk_chroma_vert_bslt4_mbaff =
187
227k
                    ih264_deblk_chroma_vert_bslt4_mbaff;
188
189
227k
    ps_codec->pf_deblk_chroma_horz_bs4 = ih264_deblk_chroma_horz_bs4;
190
227k
    ps_codec->pf_deblk_chroma_horz_bslt4 = ih264_deblk_chroma_horz_bslt4;
191
192
    /* Inter pred leaf level functions */
193
227k
    ps_codec->apf_inter_pred_luma[0] = ih264_inter_pred_luma_copy;
194
227k
    ps_codec->apf_inter_pred_luma[1] = ih264_inter_pred_luma_horz_qpel;
195
227k
    ps_codec->apf_inter_pred_luma[2] = ih264_inter_pred_luma_horz;
196
227k
    ps_codec->apf_inter_pred_luma[3] = ih264_inter_pred_luma_horz_qpel;
197
227k
    ps_codec->apf_inter_pred_luma[4] = ih264_inter_pred_luma_vert_qpel;
198
227k
    ps_codec->apf_inter_pred_luma[5] =
199
227k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
200
227k
    ps_codec->apf_inter_pred_luma[6] =
201
227k
                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
202
227k
    ps_codec->apf_inter_pred_luma[7] =
203
227k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
204
227k
    ps_codec->apf_inter_pred_luma[8] = ih264_inter_pred_luma_vert;
205
227k
    ps_codec->apf_inter_pred_luma[9] =
206
227k
                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
207
227k
    ps_codec->apf_inter_pred_luma[10] =
208
227k
                    ih264_inter_pred_luma_horz_hpel_vert_hpel;
209
227k
    ps_codec->apf_inter_pred_luma[11] =
210
227k
                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
211
227k
    ps_codec->apf_inter_pred_luma[12] = ih264_inter_pred_luma_vert_qpel;
212
227k
    ps_codec->apf_inter_pred_luma[13] =
213
227k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
214
227k
    ps_codec->apf_inter_pred_luma[14] =
215
227k
                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
216
227k
    ps_codec->apf_inter_pred_luma[15] =
217
227k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
218
219
227k
    ps_codec->pf_inter_pred_chroma = ih264_inter_pred_chroma;
220
221
227k
    return;
222
227k
}