Coverage Report

Created: 2026-02-14 06:46

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
170k
{
83
84
170k
    WORD32 i = 0;
85
86
    /* Init function pointers for intra pred leaf level functions luma
87
     * Intra 16x16 */
88
170k
    ps_codec->apf_intra_pred_luma_16x16[0] =
89
170k
                    ih264_intra_pred_luma_16x16_mode_vert;
90
170k
    ps_codec->apf_intra_pred_luma_16x16[1] =
91
170k
                    ih264_intra_pred_luma_16x16_mode_horz;
92
170k
    ps_codec->apf_intra_pred_luma_16x16[2] =
93
170k
                    ih264_intra_pred_luma_16x16_mode_dc;
94
170k
    ps_codec->apf_intra_pred_luma_16x16[3] =
95
170k
                    ih264_intra_pred_luma_16x16_mode_plane;
96
97
    /* Init function pointers for intra pred leaf level functions luma
98
     * Intra 4x4 */
99
170k
    ps_codec->apf_intra_pred_luma_4x4[0] = ih264_intra_pred_luma_4x4_mode_vert;
100
170k
    ps_codec->apf_intra_pred_luma_4x4[1] = ih264_intra_pred_luma_4x4_mode_horz;
101
170k
    ps_codec->apf_intra_pred_luma_4x4[2] = ih264_intra_pred_luma_4x4_mode_dc;
102
170k
    ps_codec->apf_intra_pred_luma_4x4[3] =
103
170k
                    ih264_intra_pred_luma_4x4_mode_diag_dl;
104
170k
    ps_codec->apf_intra_pred_luma_4x4[4] =
105
170k
                    ih264_intra_pred_luma_4x4_mode_diag_dr;
106
170k
    ps_codec->apf_intra_pred_luma_4x4[5] =
107
170k
                    ih264_intra_pred_luma_4x4_mode_vert_r;
108
170k
    ps_codec->apf_intra_pred_luma_4x4[6] =
109
170k
                    ih264_intra_pred_luma_4x4_mode_horz_d;
110
170k
    ps_codec->apf_intra_pred_luma_4x4[7] =
111
170k
                    ih264_intra_pred_luma_4x4_mode_vert_l;
112
170k
    ps_codec->apf_intra_pred_luma_4x4[8] =
113
170k
                    ih264_intra_pred_luma_4x4_mode_horz_u;
114
115
    /* Init function pointers for intra pred leaf level functions luma
116
     * Intra 8x8 */
117
170k
    ps_codec->apf_intra_pred_luma_8x8[0] = ih264_intra_pred_luma_8x8_mode_vert;
118
170k
    ps_codec->apf_intra_pred_luma_8x8[1] = ih264_intra_pred_luma_8x8_mode_horz;
119
170k
    ps_codec->apf_intra_pred_luma_8x8[2] = ih264_intra_pred_luma_8x8_mode_dc;
120
170k
    ps_codec->apf_intra_pred_luma_8x8[3] =
121
170k
                    ih264_intra_pred_luma_8x8_mode_diag_dl;
122
170k
    ps_codec->apf_intra_pred_luma_8x8[4] =
123
170k
                    ih264_intra_pred_luma_8x8_mode_diag_dr;
124
170k
    ps_codec->apf_intra_pred_luma_8x8[5] =
125
170k
                    ih264_intra_pred_luma_8x8_mode_vert_r;
126
170k
    ps_codec->apf_intra_pred_luma_8x8[6] =
127
170k
                    ih264_intra_pred_luma_8x8_mode_horz_d;
128
170k
    ps_codec->apf_intra_pred_luma_8x8[7] =
129
170k
                    ih264_intra_pred_luma_8x8_mode_vert_l;
130
170k
    ps_codec->apf_intra_pred_luma_8x8[8] =
131
170k
                    ih264_intra_pred_luma_8x8_mode_horz_u;
132
133
170k
    ps_codec->pf_intra_pred_ref_filtering =
134
170k
                    ih264_intra_pred_luma_8x8_mode_ref_filtering;
135
136
    /* Init function pointers for intra pred leaf level functions chroma
137
     * Intra 8x8 */
138
170k
    ps_codec->apf_intra_pred_chroma[0] = ih264_intra_pred_chroma_8x8_mode_vert;
139
170k
    ps_codec->apf_intra_pred_chroma[1] = ih264_intra_pred_chroma_8x8_mode_horz;
140
170k
    ps_codec->apf_intra_pred_chroma[2] = ih264_intra_pred_chroma_8x8_mode_dc;
141
170k
    ps_codec->apf_intra_pred_chroma[3] = ih264_intra_pred_chroma_8x8_mode_plane;
142
143
170k
    ps_codec->pf_default_weighted_pred_luma = ih264_default_weighted_pred_luma;
144
170k
    ps_codec->pf_default_weighted_pred_chroma =
145
170k
                    ih264_default_weighted_pred_chroma;
146
170k
    ps_codec->pf_weighted_pred_luma = ih264_weighted_pred_luma;
147
170k
    ps_codec->pf_weighted_pred_chroma = ih264_weighted_pred_chroma;
148
170k
    ps_codec->pf_weighted_bi_pred_luma = ih264_weighted_bi_pred_luma;
149
170k
    ps_codec->pf_weighted_bi_pred_chroma = ih264_weighted_bi_pred_chroma;
150
151
    /* Padding Functions */
152
170k
    ps_codec->pf_pad_top = ih264_pad_top;
153
170k
    ps_codec->pf_pad_bottom = ih264_pad_bottom;
154
170k
    ps_codec->pf_pad_left_luma = ih264_pad_left_luma;
155
170k
    ps_codec->pf_pad_left_chroma = ih264_pad_left_chroma;
156
170k
    ps_codec->pf_pad_right_luma = ih264_pad_right_luma;
157
170k
    ps_codec->pf_pad_right_chroma = ih264_pad_right_chroma;
158
159
170k
    ps_codec->pf_iquant_itrans_recon_luma_4x4 = ih264_iquant_itrans_recon_4x4;
160
170k
    ps_codec->pf_iquant_itrans_recon_luma_4x4_dc =
161
170k
                    ih264_iquant_itrans_recon_4x4_dc;
162
170k
    ps_codec->pf_iquant_itrans_recon_luma_8x8 = ih264_iquant_itrans_recon_8x8;
163
170k
    ps_codec->pf_iquant_itrans_recon_luma_8x8_dc =
164
170k
                    ih264_iquant_itrans_recon_8x8_dc;
165
170k
    ps_codec->pf_iquant_itrans_recon_chroma_4x4 =
166
170k
                    ih264_iquant_itrans_recon_chroma_4x4;
167
170k
    ps_codec->pf_iquant_itrans_recon_chroma_4x4_dc =
168
170k
                    ih264_iquant_itrans_recon_chroma_4x4_dc;
169
170k
    ps_codec->pf_ihadamard_scaling_4x4 = ih264_ihadamard_scaling_4x4;
170
171
    /* Init fn ptr luma deblocking */
172
170k
    ps_codec->pf_deblk_luma_vert_bs4 = ih264_deblk_luma_vert_bs4;
173
170k
    ps_codec->pf_deblk_luma_vert_bslt4 = ih264_deblk_luma_vert_bslt4;
174
170k
    ps_codec->pf_deblk_luma_vert_bs4_mbaff = ih264_deblk_luma_vert_bs4_mbaff;
175
170k
    ps_codec->pf_deblk_luma_vert_bslt4_mbaff =
176
170k
                    ih264_deblk_luma_vert_bslt4_mbaff;
177
178
170k
    ps_codec->pf_deblk_luma_horz_bs4 = ih264_deblk_luma_horz_bs4;
179
170k
    ps_codec->pf_deblk_luma_horz_bslt4 = ih264_deblk_luma_horz_bslt4;
180
181
    /* Init fn ptr chroma deblocking */
182
170k
    ps_codec->pf_deblk_chroma_vert_bs4 = ih264_deblk_chroma_vert_bs4;
183
170k
    ps_codec->pf_deblk_chroma_vert_bslt4 = ih264_deblk_chroma_vert_bslt4;
184
170k
    ps_codec->pf_deblk_chroma_vert_bs4_mbaff =
185
170k
                    ih264_deblk_chroma_vert_bs4_mbaff;
186
170k
    ps_codec->pf_deblk_chroma_vert_bslt4_mbaff =
187
170k
                    ih264_deblk_chroma_vert_bslt4_mbaff;
188
189
170k
    ps_codec->pf_deblk_chroma_horz_bs4 = ih264_deblk_chroma_horz_bs4;
190
170k
    ps_codec->pf_deblk_chroma_horz_bslt4 = ih264_deblk_chroma_horz_bslt4;
191
192
    /* Inter pred leaf level functions */
193
170k
    ps_codec->apf_inter_pred_luma[0] = ih264_inter_pred_luma_copy;
194
170k
    ps_codec->apf_inter_pred_luma[1] = ih264_inter_pred_luma_horz_qpel;
195
170k
    ps_codec->apf_inter_pred_luma[2] = ih264_inter_pred_luma_horz;
196
170k
    ps_codec->apf_inter_pred_luma[3] = ih264_inter_pred_luma_horz_qpel;
197
170k
    ps_codec->apf_inter_pred_luma[4] = ih264_inter_pred_luma_vert_qpel;
198
170k
    ps_codec->apf_inter_pred_luma[5] =
199
170k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
200
170k
    ps_codec->apf_inter_pred_luma[6] =
201
170k
                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
202
170k
    ps_codec->apf_inter_pred_luma[7] =
203
170k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
204
170k
    ps_codec->apf_inter_pred_luma[8] = ih264_inter_pred_luma_vert;
205
170k
    ps_codec->apf_inter_pred_luma[9] =
206
170k
                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
207
170k
    ps_codec->apf_inter_pred_luma[10] =
208
170k
                    ih264_inter_pred_luma_horz_hpel_vert_hpel;
209
170k
    ps_codec->apf_inter_pred_luma[11] =
210
170k
                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
211
170k
    ps_codec->apf_inter_pred_luma[12] = ih264_inter_pred_luma_vert_qpel;
212
170k
    ps_codec->apf_inter_pred_luma[13] =
213
170k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
214
170k
    ps_codec->apf_inter_pred_luma[14] =
215
170k
                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
216
170k
    ps_codec->apf_inter_pred_luma[15] =
217
170k
                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
218
219
170k
    ps_codec->pf_inter_pred_chroma = ih264_inter_pred_chroma;
220
221
170k
    return;
222
170k
}