LCOV - code coverage report
Current view: top level - Codec - EbNeighborArrays.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2019-11-25 17:38:06 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /*
       2             : * Copyright(c) 2019 Intel Corporation
       3             : * SPDX - License - Identifier: BSD - 2 - Clause - Patent
       4             : */
       5             : 
       6             : #ifndef EbNeighborArrays_h
       7             : #define EbNeighborArrays_h
       8             : 
       9             : #include "EbDefinitions.h"
      10             : #include "EbSyntaxElements.h"
      11             : #include "EbMotionVectorUnit.h"
      12             : #include "EbObject.h"
      13             : 
      14             : #ifdef __cplusplus
      15             : extern "C" {
      16             : #endif
      17             :     // Neighbor Array Granulairity
      18             : #define LCU_NEIGHBOR_ARRAY_GRANULARITY                  64
      19             : #define CU_NEIGHBOR_ARRAY_GRANULARITY                   8
      20             : #define PU_NEIGHBOR_ARRAY_GRANULARITY                   4
      21             : #define TU_NEIGHBOR_ARRAY_GRANULARITY                   4
      22             : #define SAMPLE_NEIGHBOR_ARRAY_GRANULARITY               1
      23             : 
      24             :     typedef enum NeighborArrayType
      25             :     {
      26             :         NEIGHBOR_ARRAY_LEFT = 0,
      27             :         NEIGHBOR_ARRAY_TOP = 1,
      28             :         NEIGHBOR_ARRAY_TOPLEFT = 2,
      29             :         NEIGHBOR_ARRAY_INVALID = ~0
      30             :     } NeighborArrayType;
      31             : 
      32             : #define NEIGHBOR_ARRAY_UNIT_LEFT_MASK                   (1 << NEIGHBOR_ARRAY_LEFT)
      33             : #define NEIGHBOR_ARRAY_UNIT_TOP_MASK                    (1 << NEIGHBOR_ARRAY_TOP)
      34             : #define NEIGHBOR_ARRAY_UNIT_TOPLEFT_MASK                (1 << NEIGHBOR_ARRAY_TOPLEFT)
      35             : 
      36             : #define NEIGHBOR_ARRAY_UNIT_FULL_MASK                   (NEIGHBOR_ARRAY_UNIT_LEFT_MASK | NEIGHBOR_ARRAY_UNIT_TOP_MASK | NEIGHBOR_ARRAY_UNIT_TOPLEFT_MASK)
      37             : #define NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK      (NEIGHBOR_ARRAY_UNIT_LEFT_MASK | NEIGHBOR_ARRAY_UNIT_TOP_MASK)
      38             : 
      39             :     typedef struct NeighborArrayUnit
      40             :     {
      41             :         EbDctor    dctor;
      42             :         uint8_t   *left_array;
      43             :         uint8_t   *top_array;
      44             :         uint8_t   *top_left_array;
      45             :         uint16_t   left_array_size;
      46             :         uint16_t   top_array_size;
      47             :         uint16_t   top_left_array_size;
      48             :         uint8_t    unit_size;
      49             :         uint8_t    granularity_normal;
      50             :         uint8_t    granularity_normal_log2;
      51             :         uint8_t    granularity_top_left;
      52             :         uint8_t    granularity_top_left_log2;
      53             :     } NeighborArrayUnit;
      54             : 
      55             :     typedef struct NeighborArrayUnit32
      56             :     {
      57             :         EbDctor    dctor;
      58             :         uint32_t   *left_array;
      59             :         uint32_t   *top_array;
      60             :         uint32_t   *top_left_array;
      61             :         uint16_t   left_array_size;
      62             :         uint16_t   top_array_size;
      63             :         uint16_t   top_left_array_size;
      64             :         uint8_t    unit_size;
      65             :         uint8_t    granularity_normal;
      66             :         uint8_t    granularity_normal_log2;
      67             :         uint8_t    granularity_top_left;
      68             :         uint8_t    granularity_top_left_log2;
      69             :     } NeighborArrayUnit32;
      70             : 
      71             :     extern EbErrorType neighbor_array_unit_ctor32(
      72             :         NeighborArrayUnit32 *na_unit_ptr,
      73             :         uint32_t   max_picture_width,
      74             :         uint32_t   max_picture_height,
      75             :         uint32_t   unit_size,
      76             :         uint32_t   granularity_normal,
      77             :         uint32_t   granularity_top_left,
      78             :         uint32_t   type_mask);
      79             : 
      80             :     extern EbErrorType neighbor_array_unit_ctor(
      81             :         NeighborArrayUnit *na_unit_ptr,
      82             :         uint32_t   max_picture_width,
      83             :         uint32_t   max_picture_height,
      84             :         uint32_t   unit_size,
      85             :         uint32_t   granularity_normal,
      86             :         uint32_t   granularity_top_left,
      87             :         uint32_t   type_mask);
      88             : 
      89             :     extern void neighbor_array_unit_reset(NeighborArrayUnit *na_unit_ptr);
      90             : 
      91             :     extern void neighbor_array_unit_reset32(NeighborArrayUnit32 *na_unit_ptr);
      92             : 
      93             :     /*************************************************
      94             :      * Neighbor Array Unit Get Left Index
      95             :      *************************************************/
      96   133857410 :     static INLINE uint32_t get_neighbor_array_unit_left_index32(
      97             :         NeighborArrayUnit32 *na_unit_ptr,
      98             :         uint32_t               loc_y)
      99             :     {
     100   133857410 :         return (loc_y >> na_unit_ptr->granularity_normal_log2);
     101             :     }
     102             : 
     103   306348889 :     static INLINE uint32_t get_neighbor_array_unit_left_index(
     104             :         NeighborArrayUnit *na_unit_ptr,
     105             :         uint32_t               loc_y)
     106             :     {
     107   306348889 :         return (loc_y >> na_unit_ptr->granularity_normal_log2);
     108             :     }
     109             : 
     110             :     /*************************************************
     111             :      * Neighbor Array Unit Get Top Index
     112             :      *************************************************/
     113   133867340 :     static INLINE uint32_t get_neighbor_array_unit_top_index32(
     114             :         NeighborArrayUnit32 *na_unit_ptr,
     115             :         uint32_t               loc_x)
     116             :     {
     117   133867340 :         return (loc_x >> na_unit_ptr->granularity_normal_log2);
     118             :     }
     119             : 
     120   306353779 :     static INLINE uint32_t get_neighbor_array_unit_top_index(
     121             :         NeighborArrayUnit *na_unit_ptr,
     122             :         uint32_t               loc_x)
     123             :     {
     124   306353779 :         return (loc_x >> na_unit_ptr->granularity_normal_log2);
     125             :     }
     126             : 
     127             :     extern uint32_t get_neighbor_array_unit_top_left_index(
     128             :         NeighborArrayUnit *na_unit_ptr,
     129             :         int32_t              loc_x,
     130             :         int32_t              loc_y);
     131             : 
     132             :     extern void neighbor_array_unit_sample_write(
     133             :         NeighborArrayUnit *na_unit_ptr,
     134             :         uint8_t             *src_ptr,
     135             :         uint32_t             stride,
     136             :         uint32_t             src_origin_x,
     137             :         uint32_t             src_origin_y,
     138             :         uint32_t             pic_origin_x,
     139             :         uint32_t             pic_origin_y,
     140             :         uint32_t             block_width,
     141             :         uint32_t             block_height,
     142             :         uint32_t             neighbor_array_type_mask);
     143             : 
     144             :     void update_recon_neighbor_array(
     145             :         NeighborArrayUnit *na_unit_ptr,
     146             :         uint8_t             *src_ptr_top,
     147             :         uint8_t             *src_ptr_left,
     148             :         uint32_t             pic_origin_x,
     149             :         uint32_t             pic_origin_y,
     150             :         uint32_t             block_width,
     151             :         uint32_t             block_height);
     152             : 
     153             :     void update_recon_neighbor_array16bit(
     154             :         NeighborArrayUnit   *na_unit_ptr,
     155             :         uint16_t            *src_ptr_top,
     156             :         uint16_t            *src_ptr_left,
     157             :         uint32_t             pic_origin_x,
     158             :         uint32_t             pic_origin_y,
     159             :         uint32_t             block_width,
     160             :         uint32_t             block_height);
     161             : 
     162             :     void copy_neigh_arr(
     163             :         NeighborArrayUnit *na_src,
     164             :         NeighborArrayUnit *na_dst,
     165             :         uint32_t             origin_x,
     166             :         uint32_t             origin_y,
     167             :         uint32_t             bw,
     168             :         uint32_t             bh,
     169             :         uint32_t             neighbor_array_type_mask);
     170             : 
     171             :     void copy_neigh_arr_32(
     172             :         NeighborArrayUnit32 *na_src,
     173             :         NeighborArrayUnit32 *na_dst,
     174             :         uint32_t               origin_x,
     175             :         uint32_t               origin_y,
     176             :         uint32_t               bw,
     177             :         uint32_t               bh,
     178             :         uint32_t               neighbor_array_type_mask);
     179             : 
     180             :     extern void neighbor_array_unit16bit_sample_write(
     181             :         NeighborArrayUnit *na_unit_ptr,
     182             :         uint16_t            *src_ptr,
     183             :         uint32_t             stride,
     184             :         uint32_t             src_origin_x,
     185             :         uint32_t             src_origin_y,
     186             :         uint32_t             pic_origin_x,
     187             :         uint32_t             pic_origin_y,
     188             :         uint32_t             block_width,
     189             :         uint32_t             block_height,
     190             :         uint32_t             neighbor_array_type_mask);
     191             : 
     192             :     extern void neighbor_array_unit_mode_write32(
     193             :         NeighborArrayUnit32 *na_unit_ptr,
     194             :         uint32_t               value,
     195             :         uint32_t               origin_x,
     196             :         uint32_t               origin_y,
     197             :         uint32_t               block_width,
     198             :         uint32_t               block_height,
     199             :         uint32_t               neighbor_array_type_mask);
     200             : 
     201             :     extern void neighbor_array_unit_mode_write(
     202             :         NeighborArrayUnit *na_unit_ptr,
     203             :         uint8_t             *value,
     204             :         uint32_t             origin_x,
     205             :         uint32_t             origin_y,
     206             :         uint32_t             block_width,
     207             :         uint32_t             block_height,
     208             :         uint32_t             neighbor_array_type_mask);
     209             : 
     210             :     extern void neighbor_array_unit_mv_write(
     211             :         NeighborArrayUnit *na_unit_ptr,
     212             :         uint8_t             *value,
     213             :         uint32_t             origin_x,
     214             :         uint32_t             origin_y,
     215             :         uint32_t             BlockSize);
     216             : #ifdef __cplusplus
     217             : }
     218             : #endif
     219             : #endif //EbNeighborArrays_h

Generated by: LCOV version 1.14