Home | History | Annotate | Download | only in encoder
      1 /******************************************************************************
      2  *
      3  * Copyright (C) 2018 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 ihevce_cmn_utils_instr_set_router.c
     23 *
     24 * \brief
     25 *    This file contains function pointer initialization of common utility
     26 *    functions
     27 *
     28 * \date
     29 *    15/07/2013
     30 *
     31 * \author
     32 *    Ittiam
     33 *
     34 * List of Functions
     35 *  ihevce_cmn_utils_instr_set_router()
     36 *
     37 ******************************************************************************
     38 */
     39 
     40 /*****************************************************************************/
     41 /* File Includes                                                             */
     42 /*****************************************************************************/
     43 /* System include files */
     44 #include <stdio.h>
     45 #include <stdlib.h>
     46 #include <assert.h>
     47 
     48 /* User include files */
     49 #include "ihevc_typedefs.h"
     50 #include "itt_video_api.h"
     51 #include "ihevc_debug.h"
     52 
     53 #include "ihevce_cmn_utils_instr_set_router.h"
     54 
     55 /*****************************************************************************/
     56 /* Function Definitions                                                      */
     57 /*****************************************************************************/
     58 
     59 /*!
     60 ******************************************************************************
     61 * \if Function name : ihevce_cmn_utils_instr_set_router \endif
     62 *
     63 * \brief
     64 *    Function pointer initialization of common utils struct
     65 *
     66 *****************************************************************************
     67 */
     68 void ihevce_cmn_utils_instr_set_router(
     69     ihevce_cmn_opt_func_t *ps_func_list, UWORD8 u1_is_popcnt_available, IV_ARCH_T e_arch)
     70 {
     71     // clang-format off
     72     switch(e_arch)
     73     {
     74     (void)u1_is_popcnt_available;
     75 #ifdef ENABLE_NEON
     76     case ARCH_ARM_A9Q:
     77     case ARCH_ARM_V8_NEON:
     78         ps_func_list->pf_2d_square_copy = ihevce_2d_square_copy_luma_neon;
     79         ps_func_list->pf_AC_HAD_8x8_8bit = ihevce_compute_ac_had_8x8_8bit_neon;
     80         ps_func_list->pf_chroma_AC_HAD_4x4_8bit = ihevce_chroma_compute_AC_HAD_4x4_8bit_neon;
     81         ps_func_list->pf_chroma_HAD_16x16_8bit = ihevce_chroma_HAD_16x16_8bit_neon;
     82         ps_func_list->pf_chroma_HAD_4x4_8bit = ihevce_chroma_HAD_4x4_8bit_neon;
     83         ps_func_list->pf_chroma_HAD_8x8_8bit = ihevce_chroma_HAD_8x8_8bit_neon;
     84         ps_func_list->pf_chroma_interleave_2d_copy = ihevce_chroma_interleave_2d_copy_neon;
     85         ps_func_list->pf_chroma_interleave_ssd_calculator = ihevce_chroma_interleave_ssd_calculator_neon;
     86         ps_func_list->pf_copy_2d = ihevce_copy_2d_neon;
     87         ps_func_list->pf_get_chroma_eo_sao_params = ihevce_get_chroma_eo_sao_params_neon;
     88         ps_func_list->pf_get_luma_eo_sao_params = ihevce_get_luma_eo_sao_params_neon;
     89         ps_func_list->pf_HAD_16x16_8bit = ihevce_HAD_16x16_8bit_neon;
     90         ps_func_list->pf_HAD_32x32_8bit = ihevce_HAD_32x32_8bit_neon;
     91         ps_func_list->pf_HAD_4x4_8bit = ihevce_HAD_4x4_8bit_neon;
     92         ps_func_list->pf_HAD_8x8_8bit = ihevce_HAD_8x8_8bit_neon;
     93         ps_func_list->pf_itrans_recon_dc = ihevce_itrans_recon_dc_neon;
     94         ps_func_list->pf_scan_coeffs = ihevce_scan_coeffs_neon;
     95         ps_func_list->pf_ssd_and_sad_calculator = ihevce_ssd_and_sad_calculator_neon;
     96         ps_func_list->pf_ssd_calculator = ihevce_ssd_calculator_neon;
     97         ps_func_list->pf_wt_avg_2d = ihevce_wt_avg_2d_neon;
     98         break;
     99 #endif
    100     default:
    101         ps_func_list->pf_2d_square_copy = ihevce_2d_square_copy_luma;
    102         ps_func_list->pf_AC_HAD_8x8_8bit = ihevce_compute_ac_had_8x8_8bit;
    103         ps_func_list->pf_chroma_AC_HAD_4x4_8bit = ihevce_chroma_compute_AC_HAD_4x4_8bit;
    104         ps_func_list->pf_chroma_HAD_16x16_8bit = ihevce_chroma_HAD_16x16_8bit;
    105         ps_func_list->pf_chroma_HAD_4x4_8bit = ihevce_chroma_HAD_4x4_8bit;
    106         ps_func_list->pf_chroma_HAD_8x8_8bit = ihevce_chroma_HAD_8x8_8bit;
    107         ps_func_list->pf_chroma_interleave_2d_copy = ihevce_chroma_interleave_2d_copy;
    108         ps_func_list->pf_chroma_interleave_ssd_calculator = ihevce_chroma_interleave_ssd_calculator;
    109         ps_func_list->pf_copy_2d = ihevce_copy_2d;
    110         ps_func_list->pf_get_chroma_eo_sao_params = ihevce_get_chroma_eo_sao_params;
    111         ps_func_list->pf_get_luma_eo_sao_params = ihevce_get_luma_eo_sao_params;
    112         ps_func_list->pf_HAD_16x16_8bit = ihevce_HAD_16x16_8bit;
    113         ps_func_list->pf_HAD_32x32_8bit = ihevce_HAD_32x32_8bit;
    114         ps_func_list->pf_HAD_4x4_8bit = ihevce_HAD_4x4_8bit;
    115         ps_func_list->pf_HAD_8x8_8bit = ihevce_HAD_8x8_8bit;
    116         ps_func_list->pf_itrans_recon_dc = ihevce_itrans_recon_dc;
    117         ps_func_list->pf_scan_coeffs = ihevce_scan_coeffs;
    118         ps_func_list->pf_ssd_and_sad_calculator = ihevce_ssd_and_sad_calculator;
    119         ps_func_list->pf_ssd_calculator = ihevce_ssd_calculator;
    120         ps_func_list->pf_wt_avg_2d = ihevce_wt_avg_2d;
    121         break;
    122     }
    123     // clang-format on
    124 }
    125