TUT HEVC Encoder
Loading...
Searching...
No Matches
ml_intra_cu_depth_pred.c File Reference
Include dependency graph for ml_intra_cu_depth_pred.c:

Functions

static int tree_predict_merge_depth_1 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_merge_depth_2 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_merge_depth_3 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_merge_depth_4 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_split_depth_0 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_split_depth_1 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_split_depth_2 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
static int tree_predict_split_depth_3 (features_s *p_features, double *p_nb_iter, double *p_nb_bad)
 
ml_intra_ctu_pred_tkvz_init_ml_intra_depth_const ()
 Allocate the structure and buffer.
 
void kvz_end_ml_intra_depth_const (ml_intra_ctu_pred_t *ml_intra_depth_ctu)
 Fee the bufer and structure.
 
static void features_init_array (features_s *arr_features, int16_t _size, int _qp)
 
static double vect_average_blck_int8 (const kvz_pixel *_mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, size_t _width)
 Compute the average of a block inside an 8 bits 2D vector.
 
static double vect_variance_blck_int8 (const kvz_pixel *_mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, double _avg_blck, size_t _width)
 Compute the variance of a block inside an 8 bits 2D vector.
 
static void features_var_avg_blck (kvz_pixel *arr_luma_px, uint32_t i_xLcu, uint32_t i_yLcu, uint32_t i_xBlck, uint32_t i_yBlck, uint8_t i_blockSize, int32_t i_width, int32_t i_height, double *p_average, double *p_variance)
 Function to compute the average and the variance of a pixel block inside of a LCU.
 
static void features_combine_var (double *arr_var, double *arr_avgLuma, uint32_t i_x, uint32_t i_y, uint32_t i_depth, double *p_varianceC, double *p_avgLumaC)
 Function to combine the variance and mean values of four blocks.
 
static double features_get_var_of_sub_mean (double *arr_avgLuma, int16_t i_sb0, int16_t i_sb1, int16_t i_sb2, int16_t i_sb3)
 Function to combine the variance of the mean values of the sub block.
 
static void features_var_neighbor (features_s *arr_features, int16_t _x, int16_t _y, int16_t _depth)
 Build the neighboring variances of four cu's.
 
static void features_compute (features_s *arr_features, uint8_t i_depth, double *arr_var, double *arr_avg)
 Extract the features from the pixels for a given different depth.
 
static void features_sub_var (features_s *arr_features, features_s *arr_sub_features, uint8_t i_depth)
 Set the features Sub_var from the sub level for a given different depth.
 
static void features_merge_var (features_s *arr_features, features_s *arr_up_features, uint8_t i_rdepth)
 Set the features Merge_var from the up level for a given different depth.
 
static void features_var_of_sub_var (features_s *arr_features, uint8_t i_depth)
 Set the features Var_of_sub_var from the sub level for a given different depth.
 
static void features_compute_all (features_s *arr_features[5], kvz_pixel *luma_px)
 Extract the features from the pixels for all the depth.
 
static int neighbor_constrain_bu (uint8_t *arr_depthMap, int _x, int _y, int _depth, int _level)
 Compute the constrain on the neighboring depth of a cu for a given depth for a BU approach.
 
static int8_t combined_tree_function (int8_t merge_prediction[4], int8_t split_prediction, uint8_t test_id, uint8_t depth)
 
static void fill_depth_matrix_8 (uint8_t *matrix, vect_2D *cu, int8_t curr_depth, int8_t val)
 
static void ml_os_qt_gen (uint8_t *arr_depthMap, features_s *arr_features_cur, features_s *arr_features_up, uint8_t i_depth, int _level, uint8_t limited_flag)
 Generate the PUM depth map in a 8*8 array for a given depth with a Buttom-Up approach.
 
static void os_luma_qt_pred (ml_intra_ctu_pred_t *ml_intra_depth_ctu, kvz_pixel *luma_px, int8_t qp, uint8_t *arr_CDM)
 
static void fill_matrix_with_depth (uint8_t *matrix, int32_t x, int32_t y, int8_t depth)
 
static uint8_t merge_matrix_64 (uint8_t *_mat_seed, uint8_t *_mat_dst)
 Merge the depth of the blocks of a depth map if four blocks of the same depths are found.
 
static void matrix_mask (uint8_t *_mat_mask, const uint8_t *_mat_src, size_t _size_w, size_t _size_h)
 Perform an in place element wise mask between the two matrix.
 
static void matrix_add_level_roi (const uint8_t *_mat_sup, uint8_t *_mat_inf, uint8_t *_mat_sup_dst, int8_t _nb_level, const uint8_t *_mat_roi)
 Add 1 depth level to the depth map. If d + 1 > 4 then d - 1 is done. This function use a mask to add level only on selected roi.
 
static void generate_interval_from_os_pred (ml_intra_ctu_pred_t *ml_intra_depth_ctu, uint8_t *_mat_depth_MEP)
 Generate a search interval of controlled level around a MEP seed.
 
void kvz_lcu_luma_depth_pred (ml_intra_ctu_pred_t *ml_intra_depth_ctu, kvz_pixel *luma_px, int8_t qp)
 Generate the interval of depth predictions based on the luma samples.
 

Function Documentation

◆ combined_tree_function()

static int8_t combined_tree_function ( int8_t merge_prediction[4],
int8_t split_prediction,
uint8_t test_id,
uint8_t depth )
static
Here is the caller graph for this function:

◆ features_combine_var()

static void features_combine_var ( double * arr_var,
double * arr_avgLuma,
uint32_t i_x,
uint32_t i_y,
uint32_t i_depth,
double * p_varianceC,
double * p_avgLumaC )
inlinestatic
Parameters
arr_varArray of 4*4 variances of the LCU.
arr_avgLumaArray of 4*4 mean values of the LCU.
i_xX coordinate of the top left block.
i_yY coordinate of the top left block.
i_depthDepth of the blocks (0,1,2,3 or 4).
p_varianceCPointer to be filled with the combined variance.
p_avgLumaCPointer to be filled with the combined average.
Returns
None.

< Top left sub block index

< Top right sub block index

< Bottom left sub block index

< Bottom right sub block index

Here is the caller graph for this function:

◆ features_compute()

static void features_compute ( features_s * arr_features,
uint8_t i_depth,
double * arr_var,
double * arr_avg )
static
Parameters
arr_featuresArray of features to be retrieved for the current depth.
i_depthDepth to be evaluated.
arr_varArray of 16*16 variances.
arr_avgArray of 16*16 average lumas.
Returns
None.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ features_compute_all()

static void features_compute_all ( features_s * arr_features[5],
kvz_pixel * luma_px )
static
Parameters
main_handlerPointer to the main high level reduction handler.
p_statePointer to the state of the current LCU.
arr_features_4Array of features for level of depth 4.
arr_features_8Array of features for level of depth 3.
arr_features_16Array of features for level of depth 2.
arr_features_32Array of features for level of depth 1.
p_features64Pointer to the features of depth 0.
Returns
None.

< Top left X of the lcu

< Top left Y of the lcu

< Compute the variance for all 4*4 blocs

Here is the call graph for this function:
Here is the caller graph for this function:

◆ features_get_var_of_sub_mean()

static double features_get_var_of_sub_mean ( double * arr_avgLuma,
int16_t i_sb0,
int16_t i_sb1,
int16_t i_sb2,
int16_t i_sb3 )
inlinestatic
Parameters
arr_avgLumaArray of 4*4 mean values of the LCU.
i_sb0Index of the sub_blocks 0 in the array of avg values .
i_sb1Index of the sub_blocks 1 in the array of avg values.
i_sb2Index of the sub_blocks 2 in the array of avg values
i_sb3Index of the sub_blocks 3 in the array of avg values
Returns
variance of the average of the sub blocks.
Here is the caller graph for this function:

◆ features_init_array()

static void features_init_array ( features_s * arr_features,
int16_t _size,
int _qp )
static
Here is the caller graph for this function:

◆ features_merge_var()

static void features_merge_var ( features_s * arr_features,
features_s * arr_up_features,
uint8_t i_rdepth )
static
Parameters
arr_featuresArray of features to be retrieved for the current depth.
arr_up_featuresArray of features to be retrieved for the upper depth (depth - 1).
i_rdepthDepth to be evaluated.
Returns
None.

< Top left sub block index

< Top right sub block index

< Bottom left sub block index

< Bottom right sub block index

Here is the caller graph for this function:

◆ features_sub_var()

static void features_sub_var ( features_s * arr_features,
features_s * arr_sub_features,
uint8_t i_depth )
static
Parameters
arr_featuresArray of features to be retrieved for the current depth.
arr_sub_featuresArray of features to be retrieved for the sub depth (depth - 1).
i_rdepthDepth to be evaluated.
Returns
None.

< Top left sub block index

< Top right sub block index

< Bottom left sub block index

< Bottom right sub block index

Here is the caller graph for this function:

◆ features_var_avg_blck()

static void features_var_avg_blck ( kvz_pixel * arr_luma_px,
uint32_t i_xLcu,
uint32_t i_yLcu,
uint32_t i_xBlck,
uint32_t i_yBlck,
uint8_t i_blockSize,
int32_t i_width,
int32_t i_height,
double * p_average,
double * p_variance )
inlinestatic
Parameters
arr_luma_pxArray of the pixels of the block.
i_xLcuX coordinate of the lcu.
i_yLcuY coordinate of the lcu.
i_xBlckX coordinate of the pixel block inside the LCU.
i_yBlckY coordinate of the pixel block inside the LCU.
i_blockSizeSize of the block in pixels (4, 8, 16, 32 or 64).
i_widthWidth of the frame in pixels.
i_heightHeight of the frame in pixels.
p_averagePointer to be filled with the average.
p_variancePointer to be filled with the variance;
Returns
None.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ features_var_neighbor()

static void features_var_neighbor ( features_s * arr_features,
int16_t _x,
int16_t _y,
int16_t _depth )
static
Parameters
arr_featuresArray of features for current depth.
_xX position of the first cu in the array.
_yY position of the first cu in the array.
_depthEvaluated depth.
Returns
None.
Here is the caller graph for this function:

◆ features_var_of_sub_var()

static void features_var_of_sub_var ( features_s * arr_features,
uint8_t i_depth )
static
Parameters
arr_featuresArray of features to be retrieved for the current depth.
i_rdepthDepth to be evaluated.
Returns
None.
Here is the caller graph for this function:

◆ fill_depth_matrix_8()

static void fill_depth_matrix_8 ( uint8_t * matrix,
vect_2D * cu,
int8_t curr_depth,
int8_t val )
static
Here is the caller graph for this function:

◆ fill_matrix_with_depth()

static void fill_matrix_with_depth ( uint8_t * matrix,
int32_t x,
int32_t y,
int8_t depth )
static
Here is the caller graph for this function:

◆ generate_interval_from_os_pred()

static void generate_interval_from_os_pred ( ml_intra_ctu_pred_t * ml_intra_depth_ctu,
uint8_t * _mat_depth_MEP )
static
Parameters
_mat_depth_minUpper depth map (considered as the MEP on call).
_mat_depth_maxLower depth map (considered initialized with the MEP values).
_nb_levelFixed distance between the two generated depth map.
Returns
None.

< Matrix used to store the ref map

< Matrix used as mask

< Matrix used to store current depth map max

< Copy the original map seed

< Apply the RCDM on the upper map

< Extract the mask

< Add a level only on the masked area

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_end_ml_intra_depth_const()

void kvz_end_ml_intra_depth_const ( ml_intra_ctu_pred_t * ml_intra_depth_ctu)
Here is the caller graph for this function:

◆ kvz_init_ml_intra_depth_const()

ml_intra_ctu_pred_t * kvz_init_ml_intra_depth_const ( void )
Here is the caller graph for this function:

◆ kvz_lcu_luma_depth_pred()

void kvz_lcu_luma_depth_pred ( ml_intra_ctu_pred_t * ml_intra_depth_ctu,
kvz_pixel * luma_px,
int8_t qp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ matrix_add_level_roi()

static void matrix_add_level_roi ( const uint8_t * _mat_sup,
uint8_t * _mat_inf,
uint8_t * _mat_sup_dst,
int8_t _nb_level,
const uint8_t * _mat_roi )
static
Parameters
_mat_supOriginal upper depth map .
_mat_infLower depth map.
_mat_sup_dstFinal upper depth map (WARNING: must be a different array as _mat_sup as it can be modified).
_nb_levelThe number of level there should be between inf and sup_dst.
_mat_roiMask used to determine which area should be modified on the _mat_inf (convention is 0 for changed area and 1 else).
Returns
None.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ matrix_mask()

static void matrix_mask ( uint8_t * _mat_mask,
const uint8_t * _mat_src,
size_t _size_w,
size_t _size_h )
static
Parameters
_mat_maskMatrix containing result of the mask (input/output).
_mat_srcMatrix used for the mask (input).
_size_wWidth of the matrix.
_size_hHeight of the matrix.
Returns
None.
Here is the caller graph for this function:

◆ merge_matrix_64()

static uint8_t merge_matrix_64 ( uint8_t * _mat_seed,
uint8_t * _mat_dst )
static
Parameters
_mat_seedArray of the depth used as seed for the merge (WARNING: must be the same as arrDepthMerge (tmp)).
_mat_dstArray of the depth merged.
Returns
1 if blocks have been merged, 0 else.

< All depth 4 blocks are merged by default to depth 3

< Skip the modulo operations and conditional tests

< Skip all the loop process, since 0 depth means there will be no other depths tested

< Offset to go check the three other blocks

< Check if we are on the fourth block of a depth

< Generate the real offset for the array

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ml_os_qt_gen()

static void ml_os_qt_gen ( uint8_t * arr_depthMap,
features_s * arr_features_cur,
features_s * arr_features_up,
uint8_t i_depth,
int _level,
uint8_t limited_flag )
static
Parameters
arr_depthMapArray of the depth map.
arr_features_curArray of features for current depth (i_depth).
arr_features_upArray of features for up depth (i_depth-1).
i_depthCurrent depth tested.
_levelNumber of level tested when the algo is Restrained (limited)
limited_flag0 to not test that the 4 blocks are at the same depth 1 to only merge a bloc if the 4 sub blocks are at the same depth
depth_flag0 to not use depth features 1 to use use depth features
Returns
None.

< Check if neighboring blocks are of the same size

Here is the call graph for this function:
Here is the caller graph for this function:

◆ neighbor_constrain_bu()

static int neighbor_constrain_bu ( uint8_t * arr_depthMap,
int _x,
int _y,
int _depth,
int _level )
static
Parameters
arr_depthMap8*8 depth map.
_xX coordinate of the cu in the 8*8 depth map;
_yY coordinate of the cu in the 8*8 depth map;
_depthCurrent depth tested.
_levelnumber of depth gap that we want
Returns
1 if the predictions should be tested for this cu, 0 else.
Here is the caller graph for this function:

◆ os_luma_qt_pred()

static void os_luma_qt_pred ( ml_intra_ctu_pred_t * ml_intra_depth_ctu,
kvz_pixel * luma_px,
int8_t qp,
uint8_t * arr_CDM )
static

< Set the depth map to 4 by default

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tree_predict_merge_depth_1()

static int tree_predict_merge_depth_1 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_merge_depth_2()

static int tree_predict_merge_depth_2 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_merge_depth_3()

static int tree_predict_merge_depth_3 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_merge_depth_4()

static int tree_predict_merge_depth_4 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_split_depth_0()

static int tree_predict_split_depth_0 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_split_depth_1()

static int tree_predict_split_depth_1 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_split_depth_2()

static int tree_predict_split_depth_2 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ tree_predict_split_depth_3()

static int tree_predict_split_depth_3 ( features_s * p_features,
double * p_nb_iter,
double * p_nb_bad )
static
Here is the caller graph for this function:

◆ vect_average_blck_int8()

static double vect_average_blck_int8 ( const kvz_pixel * _mat_src,
size_t _x,
size_t _x_end,
size_t _y,
size_t _y_end,
size_t _width )
inlinestatic
Parameters
_mat_srcFirst depth map.
_xX coordinate of the start of the block inside the matrix.
_x_endX coordinate of the end of the block inside the matrix.
_yY coordinate of the start of the block inside the matrix.
_y_endY coordinate of the end of the block inside the matrix.
_widthWidth of the matrix.
Returns
average value of the block, -1 if error.
Here is the caller graph for this function:

◆ vect_variance_blck_int8()

static double vect_variance_blck_int8 ( const kvz_pixel * _mat_src,
size_t _x,
size_t _x_end,
size_t _y,
size_t _y_end,
double _avg_blck,
size_t _width )
inlinestatic
Parameters
_mat_srcFirst depth map.
_xX coordinate of the start of the block inside the matrix.
_x_endX coordinate of the end of the block inside the matrix.
_yY coordinate of the start of the block inside the matrix.
_y_endY coordinate of the end of the block inside the matrix.
_avg_blckAverage value of the block.
_widthWidth of the matrix.
Returns
average value of the block, -1 if error.
Here is the caller graph for this function: