Home | History | Annotate | Download | only in common
      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  *  ih264_intra_pred_filters.h
     24  *
     25  * @brief
     26  *  Declarations of functions used for intra prediction
     27  *
     28  * @author
     29  *  Ittiam
     30  *
     31  * @remarks
     32  *  None
     33  *
     34  *******************************************************************************
     35  */
     36 
     37 #ifndef IH264_INTRA_PRED_FILTERS_H_
     38 
     39 #define IH264_INTRA_PRED_FILTERS_H_
     40 
     41 /*****************************************************************************/
     42 /*  Macro Expansion                                                          */
     43 /*****************************************************************************/
     44 
     45 /*! Filter (1,2,1) i.e (a + 2b + c) / 4 */
     46 #define FILT121(a,b,c) ((a + (b<<1) + c + 2)>>2)
     47 /*! Filter (1,1) i.e (a + b) / 2 */
     48 #define FILT11(a,b) ((a + b + 1)>>1)
     49 /*****************************************************************************/
     50 /*  Global Variables                                                        */
     51 /*****************************************************************************/
     52 
     53 /* Global variables used only in assembly files*/
     54 extern const WORD8  ih264_gai1_intrapred_luma_plane_coeffs[];
     55 extern const WORD8  ih264_gai1_intrapred_chroma_plane_coeffs1[];
     56 extern const WORD8  ih264_gai1_intrapred_chroma_plane_coeffs2[];
     57 extern const WORD8  ih264_gai1_intrapred_luma_8x8_horz_u[];
     58 
     59 /*****************************************************************************/
     60 /* Extern Function Declarations                                              */
     61 /*****************************************************************************/
     62 
     63 
     64 typedef void ih264_intra_pred_ref_filtering_ft(UWORD8 *pu1_left,
     65                                                UWORD8 *pu1_topleft,
     66                                                UWORD8 *pu1_top,
     67                                                UWORD8 *pu1_dst,
     68                                                WORD32 left_strd,
     69                                                WORD32 ngbr_avail);
     70 
     71 typedef void ih264_intra_pred_luma_ft(UWORD8 *pu1_src,
     72                                       UWORD8 *pu1_dst,
     73                                       WORD32 src_strd,
     74                                       WORD32 dst_strd,
     75                                       WORD32 ngbr_avail);
     76 
     77 /* No Neon Definitions */
     78 
     79 /* Luma 4x4 Intra pred filters */
     80 
     81 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert;
     82 
     83 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz;
     84 
     85 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_dc;
     86 
     87 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dl;
     88 
     89 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dr;
     90 
     91 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_r;
     92 
     93 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_d;
     94 
     95 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_l;
     96 
     97 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_u;
     98 
     99 /* Luma 8x8 Intra pred filters */
    100 
    101 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert;
    102 
    103 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz;
    104 
    105 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_dc;
    106 
    107 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dl;
    108 
    109 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dr;
    110 
    111 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_r;
    112 
    113 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_d;
    114 
    115 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_l;
    116 
    117 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_u;
    118 
    119 /* Luma 16x16 Intra pred filters */
    120 
    121 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_vert;
    122 
    123 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_horz;
    124 
    125 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_dc;
    126 
    127 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_plane;
    128 
    129 /* Chroma 8x8 Intra pred filters */
    130 
    131 typedef ih264_intra_pred_luma_ft ih264_intra_pred_chroma_ft;
    132 
    133 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_dc;
    134 
    135 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_horz;
    136 
    137 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_vert;
    138 
    139 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_plane;
    140 
    141 
    142 ih264_intra_pred_ref_filtering_ft  ih264_intra_pred_luma_8x8_mode_ref_filtering;
    143 
    144 /* A9 Definition */
    145 
    146 /* Luma 4x4 Intra pred filters */
    147 
    148 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_a9q;
    149 
    150 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_a9q;
    151 
    152 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_dc_a9q;
    153 
    154 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dl_a9q;
    155 
    156 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dr_a9q;
    157 
    158 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_r_a9q;
    159 
    160 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_d_a9q;
    161 
    162 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_l_a9q;
    163 
    164 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_u_a9q;
    165 
    166 /* Luma 8x8 Intra pred filters */
    167 
    168 ih264_intra_pred_ref_filtering_ft  ih264_intra_pred_luma_8x8_mode_ref_filtering_a9q;
    169 
    170 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_a9q;
    171 
    172 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_a9q;
    173 
    174 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_dc_a9q;
    175 
    176 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dl_a9q;
    177 
    178 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dr_a9q;
    179 
    180 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_r_a9q;
    181 
    182 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_d_a9q;
    183 
    184 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_l_a9q;
    185 
    186 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_u_a9q;
    187 
    188 /* Luma 16x16 Intra pred filters */
    189 
    190 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_vert_a9q;
    191 
    192 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_horz_a9q;
    193 
    194 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_dc_a9q;
    195 
    196 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_plane_a9q;
    197 
    198 /* Chroma 8x8 Intra pred filters */
    199 
    200 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_dc_a9q;
    201 
    202 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_horz_a9q;
    203 
    204 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_vert_a9q;
    205 
    206 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_plane_a9q;
    207 
    208 /* X86 Intrinsic Definitions */
    209 
    210 /* Luma 4x4 Intra pred filters */
    211 
    212 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_ssse3;
    213 
    214 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_ssse3;
    215 
    216 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_dc_ssse3;
    217 
    218 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dl_ssse3;
    219 
    220 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dr_ssse3;
    221 
    222 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_r_ssse3;
    223 
    224 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_d_ssse3;
    225 
    226 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_l_ssse3;
    227 
    228 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_u_ssse3;
    229 
    230 /* Luma 8x8 Intra pred filters */
    231 
    232 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_ssse3;
    233 
    234 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_ssse3;
    235 
    236 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_dc_ssse3;
    237 
    238 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dl_ssse3;
    239 
    240 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dr_ssse3;
    241 
    242 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_r_ssse3;
    243 
    244 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_d_ssse3;
    245 
    246 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_l_ssse3;
    247 
    248 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_u_ssse3;
    249 
    250 /* Luma 16x16 Intra pred filters */
    251 
    252 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_vert_ssse3;
    253 
    254 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_horz_ssse3;
    255 
    256 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_dc_ssse3;
    257 
    258 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_plane_ssse3;
    259 
    260 /* Chroma 8x8 Intra pred filters */
    261 
    262 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_dc_ssse3;
    263 
    264 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_horz_ssse3;
    265 
    266 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_vert_ssse3;
    267 
    268 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_plane_ssse3;
    269 
    270 /* AV8 Definition */
    271 
    272 /* Luma 4x4 Intra pred filters */
    273 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_av8;
    274 
    275 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_av8;
    276 
    277 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_dc_av8;
    278 
    279 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dl_av8;
    280 
    281 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_diag_dr_av8;
    282 
    283 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_r_av8;
    284 
    285 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_d_av8;
    286 
    287 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_vert_l_av8;
    288 
    289 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_4x4_mode_horz_u_av8;
    290 
    291 /* Luma 8x8 Intra pred filters */
    292 
    293 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_av8;
    294 
    295 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_av8;
    296 
    297 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_dc_av8;
    298 
    299 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dl_av8;
    300 
    301 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_diag_dr_av8;
    302 
    303 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_r_av8;
    304 
    305 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_d_av8;
    306 
    307 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_vert_l_av8;
    308 
    309 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_8x8_mode_horz_u_av8;
    310 
    311 /* Luma 16x16 Intra pred filters */
    312 
    313 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_vert_av8;
    314 
    315 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_horz_av8;
    316 
    317 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_dc_av8;
    318 
    319 ih264_intra_pred_luma_ft  ih264_intra_pred_luma_16x16_mode_plane_av8;
    320 
    321 /* Chroma 8x8 Intra pred filters */
    322 
    323 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_dc_av8;
    324 
    325 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_horz_av8;
    326 
    327 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_vert_av8;
    328 
    329 ih264_intra_pred_chroma_ft ih264_intra_pred_chroma_8x8_mode_plane_av8;
    330 
    331 #endif /* IH264_INTRA_PRED_FILTERS_H_ */
    332