xref: /aosp_15_r20/external/libavc/decoder/arm/svc/isvcd_function_selector.c (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1 /******************************************************************************
2  *
3  * Copyright (C) 2022 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 *  isvcd_function_selector.c
24 *
25 * @brief
26 *  Contains functions to initialize function pointers used in hevc
27 *
28 * @author
29 *  Kishore
30 *
31 * @par List of Functions:
32 *  - isvcd_init_function_ptr()
33 *
34 * @remarks
35 *  None
36 *
37 *******************************************************************************
38 */
39 /*****************************************************************************/
40 /* File Includes                                                             */
41 /*****************************************************************************/
42 #include <stdio.h>
43 #include <stddef.h>
44 #include <stdlib.h>
45 #include <string.h>
46 
47 #include "ih264_typedefs.h"
48 #include "iv.h"
49 #include "ivd.h"
50 #include "ih264_defs.h"
51 #include "ih264_size_defs.h"
52 #include "ih264_error.h"
53 #include "ih264_trans_quant_itrans_iquant.h"
54 #include "ih264_inter_pred_filters.h"
55 #include "ih264d_structs.h"
56 #include "ih264d_function_selector.h"
57 #include "isvcd_structs.h"
58 #include "isvcd_function_selector.h"
59 
60 /**
61 *******************************************************************************
62 *
63 * @brief Initialize the intra/inter/transform/deblk function pointers of
64 * codec context
65 *
66 * @par Description: the current routine initializes the function pointers of
67 * codec context basing arm v8/x86/a9q architecture
68 *
69 * @param[in] ps_codec
70 *  ps_codec context pointer
71 *
72 * @returns  none
73 *
74 * @remarks none
75 *
76 *******************************************************************************
77 */
isvcd_init_function_ptr(svc_dec_lyr_struct_t * ps_svc_lyr_dec)78 void isvcd_init_function_ptr(svc_dec_lyr_struct_t *ps_svc_lyr_dec)
79 {
80     dec_struct_t *ps_codec = &ps_svc_lyr_dec->s_dec;
81     IVD_ARCH_T e_proc_arch = ps_codec->e_processor_arch;
82     isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
83     switch(e_proc_arch)
84     {
85 #if defined(ARMV8)
86         case ARCH_ARMV8_GENERIC:
87         default:
88             ih264d_init_function_ptr_av8(ps_codec);
89             isvcd_init_function_ptr_neonintr(ps_svc_lyr_dec);
90             break;
91 #elif !defined(DISABLE_NEON)
92         case ARCH_ARM_A5:
93         case ARCH_ARM_A7:
94         case ARCH_ARM_A9:
95         case ARCH_ARM_A15:
96         case ARCH_ARM_A9Q:
97         default:
98             ih264d_init_function_ptr_a9q(ps_codec);
99             isvcd_init_function_ptr_neonintr(ps_svc_lyr_dec);
100             break;
101 #else
102         default:
103 #endif
104         case ARCH_ARM_NONEON:
105             break;
106     }
107 }
108