mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Updating to VTM6.0
This commit is contained in:
parent
a24f49c286
commit
ed76650fa5
371
src/alf.h
371
src/alf.h
|
@ -19,6 +19,7 @@
|
|||
//To reduce bits overhead, filter coefficients of different classification can be merged.
|
||||
//In slice header, the indices of the APSs used for the current slice are signaled.
|
||||
|
||||
#define ALF_FIXED_FILTER_NUM 64
|
||||
#define MAX_NUM_ALF_CLASSES 25
|
||||
#define MAX_NUM_ALF_LUMA_COEFF 13
|
||||
#define MAX_NUM_ALF_CHROMA_COEFF 7
|
||||
|
@ -32,9 +33,14 @@
|
|||
#define REG_SQR 0.0000001
|
||||
#define MAX_NUM_APS 32
|
||||
#define CLASSIFICATION_BLK_SIZE 32
|
||||
#define ALF_VB_POS_ABOVE_CTUROW_LUMA 4
|
||||
#define ALF_VB_POS_ABOVE_CTUROW_CHMA 2
|
||||
#define ALF_CTB_MAX_NUM_APS 8
|
||||
#define MAX_ALF_PADDING_SIZE 4
|
||||
#define MAX_ALF_NUM_CLIPPING_VALUES 4
|
||||
#define NUM_APS_TYPE_LEN 3
|
||||
|
||||
/* #if JVET_N0242_NON_LINEAR_ALF
|
||||
static const int g_fixed_filter_set_coeff[64][13] =
|
||||
static const int g_fixed_filter_set_coeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF] =
|
||||
{
|
||||
{ 0, 0, 2, -3, 1, -4, 1, 7, -1, 1, -1, 5, 0 },
|
||||
{ 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, -1, 2, 0 },
|
||||
|
@ -101,76 +107,8 @@ static const int g_fixed_filter_set_coeff[64][13] =
|
|||
{ 0, 1, 2, -8, 2, -6, 5, 15, 0, 2, -7, 9, 0 },
|
||||
{ 1, -1, 12, -15, -7, -2, 3, 6, 6, -1, 7, 30, 0 },
|
||||
};
|
||||
*/
|
||||
static const int g_fixed_filter_set_coeff[64][13] =
|
||||
{
|
||||
{ 0, 0, 2, -3, 1, -4, 1, 7, -1, 1, -1, 5, 112 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, -1, 2, 126 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 126 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 128 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 2, -7, -3, 0, -5, 13, 22, 12, -3, -3, 17, 34 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -1, 0, 6, -8, 1, -5, 1, 23, 0, 2, -5, 10, 80 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, -1, -1, 0, -1, 2, 1, 0, 0, -1, 4, 122 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 3, -11, 1, 0, -1, 35, 5, 2, -9, 9, 60 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 8, -8, -2, -7, 4, 4, 2, 1, -1, 25, 76 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 1, -1, 0, -3, 1, 3, -1, 1, -1, 3, 122 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 3, -3, 0, -6, 5, -1, 2, 1, -4, 21, 92 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -7, 1, 5, 4, -3, 5, 11, 13, 12, -8, 11, 12, 16 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -5, -3, 6, -2, -3, 8, 14, 15, 2, -7, 11, 16, 24 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, -1, -6, -5, -2, -2, 20, 14, -4, 0, -3, 25, 52 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 1, -8, -4, 0, -8, 22, 5, -3, 2, -10, 29, 70 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 1, -7, -1, 2, -11, 23, -5, 0, 2, -10, 29, 78 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -6, -3, 8, 9, -4, 8, 9, 7, 14, -2, 8, 9, 14 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 1, -4, -7, 0, -8, 17, 22, 1, -1, -4, 23, 44 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 0, -5, -7, 0, -7, 15, 18, -5, 0, -5, 27, 60 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 0, 0, -7, 1, -10, 13, 13, -4, 2, -7, 24, 74 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 3, -13, 4, -2, -5, 9, 21, 25, -2, -3, 12, 24 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -5, -2, 7, -3, -7, 9, 8, 9, 16, -2, 15, 12, 14 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, -1, 0, -7, -5, 4, 11, 11, 8, -6, 12, 21, 32 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, -2, -3, -8, -4, -1, 16, 15, -2, -3, 3, 26, 48 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 1, -5, -4, -1, -8, 16, 4, -2, 1, -7, 33, 68 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 1, -4, -2, 1, -10, 17, -2, 0, 2, -11, 33, 74 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, -2, 7, -15, -16, 10, 8, 8, 20, 11, 14, 11, 14 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 2, 3, -13, -13, 4, 8, 12, 2, -3, 16, 24, 40 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 4, 0, -7, -8, -4, 9, 9, -2, -2, 8, 29, 54 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 1, 2, -4, -1, -6, 6, 3, -1, -1, -3, 30, 74 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -7, 3, 2, 10, -2, 3, 7, 11, 19, -7, 8, 10, 14 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, -2, -5, -3, -2, 4, 20, 15, -1, -3, -1, 22, 40 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, -1, -8, -4, -1, -4, 22, 8, -4, 2, -8, 28, 62 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 3, -14, 3, 0, 1, 19, 17, 8, -3, -7, 20, 34 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 2, -1, -8, 3, -6, 5, 21, 1, 1, -9, 13, 84 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -4, -2, 8, 20, -2, 2, 3, 5, 21, 4, 6, 1, 4 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, -2, -3, -9, -4, 2, 14, 16, 3, -6, 8, 24, 38 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 1, 5, -16, -7, 2, 3, 11, 15, -3, 11, 22, 36 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 2, 3, -11, -2, -5, 4, 8, 9, -3, -2, 26, 68 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, -1, 10, -9, -1, -8, 2, 3, 4, 0, 0, 29, 70 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 2, 0, -5, 1, -9, 9, 3, 0, 1, -7, 20, 96 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ -2, 8, -6, -4, 3, -9, -8, 45, 14, 2, -13, 7, 54 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, -1, 16, -19, -8, -4, -3, 2, 19, 0, 4, 30, 54 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 1, -3, 0, 2, -11, 15, -5, 1, 2, -9, 24, 92 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, -2, 0, 1, -4, 4, 0, 0, 1, -4, 7, 120 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, 2, -5, 1, -6, 4, 10, -2, 1, -4, 10, 104 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 0, -3, -6, -2, -6, 14, 8, -1, -1, -3, 31, 60 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, 0, -2, 1, -6, 5, 1, 0, 1, -5, 13, 110 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 1, 9, -19, -21, 9, 7, 6, 13, 5, 15, 21, 30 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 2, 4, 3, -12, -13, 1, 7, 8, 3, 0, 12, 26, 46 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 3, 1, -8, -2, 0, -6, 18, 2, -2, 3, -10, 23, 84 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 1, -4, -1, 1, -5, 8, 1, -1, 2, -5, 10, 112 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, -1, 0, 0, -2, 2, 0, 0, 1, -2, 3, 124 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 1, -2, -7, 1, -7, 14, 18, 0, 0, -7, 21, 62 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, 0, -2, 0, -7, 8, 1, -2, 0, -3, 24, 88 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, 1, -2, 2, -10, 10, 0, -2, 1, -7, 23, 94 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 2, 2, -11, 2, -4, -3, 39, 7, 1, -10, 9, 60 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 0, 13, -16, -5, -6, -1, 8, 6, 0, 6, 29, 58 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, 3, 1, -6, -4, -7, 9, 6, -3, -2, 3, 33, 60 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 4, 0, -17, -1, -1, 5, 26, 8, -2, 3, -15, 30, 48 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, -2, 0, 2, -8, 12, -6, 1, 1, -6, 16, 106 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 0, 0, -1, 1, -4, 4, 0, 0, 0, -3, 11, 112 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 0, 1, 2, -8, 2, -6, 5, 15, 0, 2, -7, 9, 98 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
{ 1, -1, 12, -15, -7, -2, 3, 6, 6, -1, 7, 30, 50 - (1 << (ALF_NUM_BITS - 1)) },
|
||||
};
|
||||
|
||||
static const int g_class_to_filter_mapping[16][25] =
|
||||
static const int g_class_to_filter_mapping[ALF_NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES] =
|
||||
{
|
||||
{ 8, 2, 2, 2, 3, 4, 53, 9, 9, 52, 4, 4, 5, 9, 2, 8, 10, 9, 1, 3, 39, 39, 10, 9, 52 },
|
||||
{ 11, 12, 13, 14, 15, 30, 11, 17, 18, 19, 16, 20, 20, 4, 53, 21, 22, 23, 14, 25, 26, 26, 27, 28, 10 },
|
||||
|
@ -233,6 +171,11 @@ static const int alf_golomb_idx_7[14] = {
|
|||
typedef enum { ALF_FILTER_5X5 = 0, ALF_FILTER_7X7 = 1, ALF_NUM_OF_FILTER_TYPES = 2 } alf_filter_type;
|
||||
typedef enum { ALF_LUMA = 0, ALF_CHROMA = 1 } alf_type;
|
||||
|
||||
typedef enum {
|
||||
T_ALF_APS = 0,
|
||||
T_LMCS_APS = 1,
|
||||
} aps_type_values;
|
||||
|
||||
typedef enum {
|
||||
ALF_HOR = 0,
|
||||
ALF_VER = 1,
|
||||
|
@ -254,17 +197,24 @@ typedef enum {
|
|||
MAX_NUM_COMPONENT = 3,
|
||||
} alf_component_id;
|
||||
|
||||
double* g_luma_level_to_weight_plut;
|
||||
|
||||
static short g_fixed_filter_set_coeff_dec[ALF_NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
|
||||
static short g_coeff_aps_luma[6][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
static short g_coeff_aps_luma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
static short g_clipp_aps_luma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
static short g_coeff_final[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
static short g_clipp_final[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
|
||||
//short g_luma_coeff[max_num_alf_classes * max_num_alf_luma_coeff];
|
||||
//short g_chroma_coeff[max_num_alf_chroma_coeff];
|
||||
static short g_chroma_coeff_final[MAX_NUM_ALF_LUMA_COEFF];
|
||||
static short g_chroma_clipp_final[MAX_NUM_ALF_LUMA_COEFF];
|
||||
//short g_filter_coeff_delta_idx[max_num_alf_classes];
|
||||
static short g_filter_indices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES];
|
||||
static int g_clip_default_enc[MAX_NUM_ALF_LUMA_COEFF];
|
||||
static int g_filter_tmp[MAX_NUM_ALF_LUMA_COEFF];
|
||||
static int g_clip_tmp[MAX_NUM_ALF_LUMA_COEFF];
|
||||
//int g_fixed_filter_idx[max_num_alf_classes];
|
||||
static int g_bits_coeff_scan[11/*m_MAX_SCAN_VAL*/][16/*m_MAX_EXP_GOLOMB*/];
|
||||
|
||||
|
@ -279,8 +229,8 @@ short* g_alf_ctb_filter_index;
|
|||
//bool g_alf_luma_coeff_flag[max_num_alf_classes];
|
||||
|
||||
int** g_diff_filter_coeff;
|
||||
int** g_filter_coeff_set;
|
||||
int* g_filter_coeff_quant;
|
||||
int** g_filter_coeff_set; // [lumaClassIdx/chromaAltIdx][coeffIdx]
|
||||
int** g_filter_clipp_set; // [lumaClassIdx/chromaAltIdx][coeffIdx]
|
||||
|
||||
static int g_aps_id_start;
|
||||
//static double* g_ctb_distortion_fixed_filter; //Ei käytetty missään
|
||||
|
@ -293,20 +243,33 @@ static int g_k_min_tab[MAX_NUM_ALF_LUMA_COEFF];
|
|||
|
||||
static const double frac_bits_scale = 1.0 / (double)(1 << 15/*SCALE_BITS*/);
|
||||
|
||||
static int alf_input_bit_depth[2] = { 8, 8 };
|
||||
static int g_input_bit_depth[2] = { 8, 8 };
|
||||
static const int g_alf_num_clipping_values[MAX_NUM_CHANNEL_TYPE] = { 4,4 };
|
||||
static const int g_max_alf_num_clipping_values = 4;
|
||||
short g_alf_clipping_values[MAX_NUM_CHANNEL_TYPE][MAX_ALF_NUM_CLIPPING_VALUES];
|
||||
short g_clip_default[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
|
||||
|
||||
static int num_ctus_in_pic;
|
||||
static int g_num_ctus_in_pic;
|
||||
int g_num_ctus_in_width;
|
||||
int g_num_ctus_in_height;
|
||||
int g_pic_height;
|
||||
int g_alf_vb_luma_ctu_height;
|
||||
int g_alf_vb_chma_ctu_height;
|
||||
int g_alf_vb_luma_pos;
|
||||
int g_alf_vb_chma_pos;
|
||||
|
||||
typedef struct alf_covariance {
|
||||
int num_coeff;
|
||||
double *y;
|
||||
double **ee;
|
||||
int num_bins;
|
||||
double y[MAX_NUM_ALF_LUMA_COEFF][MAX_ALF_NUM_CLIPPING_VALUES];
|
||||
double ee[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF][MAX_ALF_NUM_CLIPPING_VALUES][MAX_ALF_NUM_CLIPPING_VALUES];
|
||||
double pix_acc;
|
||||
} alf_covariance;
|
||||
|
||||
alf_covariance*** g_alf_covariance[MAX_NUM_COMPONENT]; //[component_id][filter_type][ctu_idx][class_idx]
|
||||
alf_covariance** g_alf_covariance_frame[MAX_NUM_CHANNEL_TYPE]; //[channel][filter_type][class_idx]
|
||||
alf_covariance g_alf_covariance_merged[ALF_NUM_OF_FILTER_TYPES][MAX_NUM_ALF_CLASSES + 2];
|
||||
int g_alf_clip_merged[ALF_NUM_OF_FILTER_TYPES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF];
|
||||
uint8_t* g_ctu_enable_flag_tmp[MAX_NUM_COMPONENT];
|
||||
uint8_t* g_ctu_enable_flag[MAX_NUM_COMPONENT];
|
||||
//uint8_t g_alf_slice_param_temp[MAX_NUM_COMPONENT];
|
||||
|
@ -346,25 +309,32 @@ typedef struct alf_info_t {
|
|||
|
||||
typedef struct alf_aps {
|
||||
int aps_id;
|
||||
int aps_type;
|
||||
|
||||
//sliceparam
|
||||
bool enabled_flag[MAX_NUM_COMPONENT]; // alf_slice_enable_flag, alf_chroma_idc
|
||||
bool enabled_flag[MAX_NUM_COMPONENT]; // alf_slice_enable_flag, alf_chroma_idc
|
||||
bool non_linear_flag[MAX_NUM_CHANNEL_TYPE]; // alf_nonlinear_enable_flag[Luma/Chroma]
|
||||
short luma_coeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_coeff_luma_delta[i][j]
|
||||
short luma_clipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
|
||||
short chroma_coeff[MAX_NUM_ALF_CHROMA_COEFF]; // alf_coeff_chroma[i]
|
||||
short filter_coeff_delta_idx[MAX_NUM_ALF_CLASSES]; // filter_coeff_delta[i]
|
||||
bool alf_luma_coeff_flag[MAX_NUM_ALF_CLASSES]; // alf_luma_coeff_flag[i]
|
||||
int num_luma_filters; // number_of_filters_minus1 + 1
|
||||
bool alf_luma_coeff_delta_flag; // alf_luma_coeff_delta_flag
|
||||
bool alf_luma_coeff_delta_prediction_flag; // alf_luma_coeff_delta_prediction_flag
|
||||
//std::vector<AlfFilterShape>* filterShapes;
|
||||
int t_layer;
|
||||
bool new_filter_flag[MAX_NUM_CHANNEL_TYPE];
|
||||
short chroma_clipp[MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
|
||||
short filter_coeff_delta_idx[MAX_NUM_ALF_CLASSES]; // filter_coeff_delta[i]
|
||||
bool alf_luma_coeff_flag[MAX_NUM_ALF_CLASSES]; // alf_luma_coeff_flag[i]
|
||||
int num_luma_filters; // number_of_filters_minus1 + 1
|
||||
bool alf_luma_coeff_delta_flag; // alf_luma_coeff_delta_flag
|
||||
/*#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
|
||||
bool alf_luma_coeff_delta_prediction_flag; // alf_luma_coeff_delta_prediction_flag
|
||||
int fixed_filter_pattern;
|
||||
int fixed_filter_idx[MAX_NUM_ALF_CLASSES];
|
||||
int fixed_filter_set_index;
|
||||
#endif*/
|
||||
//std::vector<AlfFilterShape>* filterShapes;
|
||||
int t_layer;
|
||||
bool new_filter_flag[MAX_NUM_CHANNEL_TYPE];
|
||||
} alf_aps;
|
||||
|
||||
static alf_aps g_alf_slice_aps_temp;
|
||||
static alf_aps g_alf_aps_temp;
|
||||
static alf_aps g_alf_aps_temp_nl;
|
||||
|
||||
typedef struct param_set_map {
|
||||
bool b_changed;
|
||||
|
@ -377,64 +347,91 @@ void kvz_alf_init(encoder_state_t *const state,
|
|||
alf_info_t *alf);
|
||||
|
||||
//-------------------------help functions---------------------------
|
||||
int alf_clip_pixel(const int a, const clp_rng clp_rng);
|
||||
int alf_clip3(const int minVal, const int maxVal, const int a);
|
||||
void gns_backsubstitution(double R[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* z, int size, double* A);
|
||||
void gns_transpose_backsubstitution(double U[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* rhs, double* x, int order);
|
||||
int gns_cholesky_dec(double **inpMatr, double outMatr[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], int numEq);
|
||||
int gns_solve_by_chol(double **LHS, double *rhs, double *x, int numEq);
|
||||
double calc_error_for_coeffs(double **ee, double *y, const int *coeff, const int numCoeff, const int bitDepth);
|
||||
int get_golomb_k_min(channel_type channel, const int numFilters, int kMinTab[MAX_NUM_ALF_LUMA_COEFF], int bitsCoeffScan[11/*m_MAX_SCAN_VAL*/][16/*m_MAX_EXP_GOLOMB*/]);
|
||||
int length_golomb(int coeffVal, int k);
|
||||
double get_dist_force_0(channel_type channel, const int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], bool* codedVarBins);
|
||||
int get_cost_filter_coeff_force_0(channel_type channel, int **pDiffQFilterCoeffIntPP, const int numFilters, bool* codedVarBins);
|
||||
int get_cost_filter_coeff(channel_type channel, int **pDiffQFilterCoeffIntPP, const int numFilters);
|
||||
int get_tb_length(int uiSymbol, const int uiMaxSymbol);
|
||||
int get_non_filter_coeff_rate(alf_aps *aps);
|
||||
double calculate_error(alf_covariance cov);
|
||||
int get_coeff_rate(alf_aps *aps, bool isChroma);
|
||||
int length_truncated_unary(int symbol, int max_symbol);
|
||||
double get_unfiltered_distortion_cov_channel(alf_covariance* cov, channel_type channel);
|
||||
double get_unfiltered_distortion_cov_classes(alf_covariance* cov, const int numClasses);
|
||||
void get_frame_stats(channel_type channel, int iShapeIdx, int m_ctuEnableFlag);
|
||||
void get_frame_stat(alf_covariance* frameCov, alf_covariance** ctbCov, int ctbEnableFlags, const int numClasses);
|
||||
void reset_alf_covariance(alf_covariance *alf, int num_bins);
|
||||
//TODO
|
||||
bool is_crossed_by_virtual_boundaries(const int x_pos, const int y_pos, const int width, const int height, bool* clip_top, bool* clip_bottom, bool* clip_left,
|
||||
bool* clip_right, int* num_hor_vir_bndry, int* num_ver_vir_bndry, int hor_vir_bndry_pos[], int ver_vir_bndry_pos[], encoder_state_t *const state);
|
||||
int clip_alf(const int clip, const short ref, const short val0, const short val1);//
|
||||
int alf_clip_pixel(const int a, const clp_rng clp_rng);//
|
||||
int alf_clip3(const int min_val, const int max_val, const int a);//
|
||||
void get_clip_max(alf_covariance *cov, int *clip_max);//
|
||||
void reduce_clip_cost(alf_covariance *cov, int *clip);//
|
||||
void set_ey_from_clip(alf_covariance *cov, const int* clip, double ee[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], double y[MAX_NUM_ALF_LUMA_COEFF], int siz);//
|
||||
double optimize_filter(alf_covariance *cov, int* clip, double *f, bool optimize_clip);//
|
||||
double optimize_filter_clip(alf_covariance *cov, int* clip);//
|
||||
double optimize_filter_gns_calc(alf_covariance *cov, const int* clip, double *f, int size);//
|
||||
void gns_backsubstitution(double r[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], double* z, int size, double* A);//
|
||||
void gns_transpose_backsubstitution(double u[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], double* rhs, double* x, int order);//
|
||||
int gns_cholesky_dec(double inp_matr[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], double out_matr[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], int num_eq);//
|
||||
int gns_solve_by_chol(double lhs[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF], double rhs[MAX_NUM_ALF_LUMA_COEFF], double *x, int num_eq);//
|
||||
int gns_solve_by_chol_clip_gns(alf_covariance *cov, const int *clip, double *x, int num_eq);//
|
||||
double calc_error_for_coeffs(alf_covariance *cov, const int *clip, const int *coeff, const int num_coeff, const int bit_depth);//
|
||||
//int get_golomb_k_min(channel_type channel, const int numFilters, int kMinTab[MAX_NUM_ALF_LUMA_COEFF], int bitsCoeffScan[11/*m_MAX_SCAN_VAL*/][16/*m_MAX_EXP_GOLOMB*/]);
|
||||
int length_golomb(int coeff_val, int k, bool signed_coeff);//
|
||||
double get_dist_coeff_force_0(bool* coded_var_bins, double error_force_0_coeff_tab[MAX_NUM_ALF_CLASSES][2], int* bits_var_bin, const int num_filters);//
|
||||
double get_dist_force_0(channel_type channel, const int num_filters, double error_tab_force_0_coeff[MAX_NUM_ALF_CLASSES][2], bool* coded_var_bins);//
|
||||
int get_cost_filter_coeff_force_0(channel_type channel, int **p_diff_q_filter_coeff_int_pp, const int num_filters, bool* coded_var_bins);//
|
||||
int get_cost_filter_coeff(channel_type channel, int **p_diff_q_filter_coeff_int_pp, const int num_filters);//
|
||||
int get_cost_filter_clipp(channel_type channel, int **p_diff_q_filter_coeff_int_pp, const int num_filters);//
|
||||
int get_tb_length(int ui_symbol, const int ui_max_symbol);//
|
||||
int get_non_filter_coeff_rate(alf_aps *aps);//
|
||||
int length_filter_coeffs(channel_type channel, const int num_filters, int **filter_coeff);//
|
||||
double calculate_error(alf_covariance *cov, const int *clip, const double *coeff);//
|
||||
double calculate_error_opt_filt(alf_covariance *cov, const int *clip);//
|
||||
int get_coeff_rate(alf_aps *aps, bool is_chroma);//
|
||||
int length_truncated_unary(int symbol, int max_symbol);//
|
||||
double get_filtered_distortion(alf_covariance* cov, const int num_classes, const int num_filters_minus1, const int num_coeff);//
|
||||
double get_unfiltered_distortion_cov_channel(alf_covariance* cov, channel_type channel);//
|
||||
double get_unfiltered_distortion_cov_classes(alf_covariance* cov, const int num_classes);//
|
||||
void get_frame_stats(channel_type channel, int i_shape_idx);//
|
||||
void get_frame_stat(alf_covariance* frame_cov, alf_covariance** ctb_cov, uint8_t* ctb_enable_flags, const int num_classes);//
|
||||
void copy_alf_param(alf_aps *dst, alf_aps *src);
|
||||
void reset_alf_param(alf_aps *src);
|
||||
void add_alf_cov(alf_covariance *dst, alf_covariance *src);
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------encoding functions------------------------
|
||||
//
|
||||
|
||||
//VTM6.0
|
||||
void kvz_alf_enc_process(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu);
|
||||
|
||||
//OK
|
||||
//VTM6.0
|
||||
//cabac contextit
|
||||
double kvz_alf_derive_ctb_alf_enable_flags(encoder_state_t * const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
channel_type channel,
|
||||
const int i_shape_idx,
|
||||
double *dist_unfilter,
|
||||
const int num_classes);
|
||||
|
||||
//VTM6.0
|
||||
void kvz_alf_enc_create(encoder_state_t const *state,
|
||||
const lcu_order_element_t *lcu);
|
||||
|
||||
//VTM6.0
|
||||
void kvz_alf_enc_destroy(encoder_state_t const *state);
|
||||
|
||||
//Pitäisi olla OK
|
||||
//VTM6.0
|
||||
void kvz_alf_encoder(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
alf_aps *aps,
|
||||
channel_type channel);
|
||||
|
||||
void kvz_alf_encoder_ctb(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
alf_aps *aps);
|
||||
//VTM6.0
|
||||
//isIntra, PendingRasInit, IDRorBLA <--- ? selvitä nämä
|
||||
void kvz_alf_get_avai_aps_ids_luma(encoder_state_t *const state,
|
||||
int *newApsId,
|
||||
int aps_ids[ALF_CTB_MAX_NUM_APS],
|
||||
int *size_of_aps_ids);
|
||||
|
||||
//päivitä
|
||||
void kvz_alf_reconstructor(encoder_state_t const *state,
|
||||
const lcu_order_element_t *const lcu);
|
||||
|
||||
//OK
|
||||
//g_alf_covariance_frame arvot riippuvat g_alf_covariance: arvoista
|
||||
//eli funktiosta kvz_alf_get_blk_stats
|
||||
//päivitä
|
||||
//VTM6.0
|
||||
void kvz_alf_derive_stats_for_filtering(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu);
|
||||
|
||||
//Onko lumalle ja chromalle sama stride?
|
||||
//alf_covariace arvot riippuvat funktiosta kvz_alf_calc_covariance ja org- sekä reg-arvoista
|
||||
//Muuten pitäisi olla OK
|
||||
//VTM6.0
|
||||
//muuttuuko 'e_local' niin kuin pitää funktiokutsuissa?
|
||||
//mikä on alf_WSSD?
|
||||
void kvz_alf_get_blk_stats(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
channel_type channel,
|
||||
|
@ -446,17 +443,22 @@ void kvz_alf_get_blk_stats(encoder_state_t *const state,
|
|||
int32_t rec_stride,
|
||||
const int x_pos,
|
||||
const int y_pos,
|
||||
const int x_dst,
|
||||
const int y_dst,
|
||||
const int width,
|
||||
const int height);
|
||||
const int height,
|
||||
int vb_ctu_height,
|
||||
int vb_pos);
|
||||
|
||||
//OK
|
||||
void kvz_alf_calc_covariance(int *ELocal,
|
||||
//VTM6.0
|
||||
void kvz_alf_calc_covariance(int e_local[MAX_NUM_ALF_LUMA_COEFF][MAX_ALF_NUM_CLIPPING_VALUES],
|
||||
const kvz_pixel *rec,
|
||||
const int stride,
|
||||
const int *filterPattern,
|
||||
const int halfFilterLength,
|
||||
const int transposeIdx);
|
||||
const channel_type channel,
|
||||
const int transpose_idx,
|
||||
int vb_distance);
|
||||
|
||||
//VTM6.0
|
||||
double kvz_alf_get_filter_coeff_and_cost(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
channel_type channel,
|
||||
|
@ -466,55 +468,70 @@ double kvz_alf_get_filter_coeff_and_cost(encoder_state_t *const state,
|
|||
bool b_re_collect_stat,
|
||||
bool only_filter_cost);
|
||||
|
||||
//VTM6.0
|
||||
int kvz_alf_derive_filter_coefficients_prediction_mode(channel_type channel,
|
||||
int **filter_set,
|
||||
int** filter_coeff_diff,
|
||||
const int num_filters,
|
||||
int *pred_mode);
|
||||
const int num_filters);
|
||||
|
||||
//Ongelmia alf_classifierin kanssa aka ongelma funktiossa kvz_alf_derive_classification_blk
|
||||
//VTM6.0
|
||||
void kvz_alf_merge_classes(channel_type channel,
|
||||
alf_covariance* cov,
|
||||
alf_covariance* cov_merged,
|
||||
int clip_merged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF],
|
||||
const int num_classes,
|
||||
short filter_indices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES]);
|
||||
|
||||
//VTM6.0
|
||||
double kvz_alf_merge_filters_and_cost(encoder_state_t *const state,
|
||||
alf_aps *alf_aps,
|
||||
const lcu_order_element_t *const lcu,
|
||||
channel_type channel,
|
||||
int *ui_coeff_bits,
|
||||
alf_covariance *cov_frame,
|
||||
alf_covariance *cov_merged);
|
||||
alf_covariance *cov_merged,
|
||||
int clip_merged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF]);
|
||||
|
||||
//tarkista
|
||||
//VTM6.0
|
||||
double kvz_alf_derive_filter_coeffs(alf_aps *aps,
|
||||
channel_type channel,
|
||||
alf_covariance *cov,
|
||||
alf_covariance *covMerged,
|
||||
short* filter_indices,
|
||||
int numFilters,
|
||||
double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2]);
|
||||
double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2],
|
||||
int clip_merged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF]);
|
||||
|
||||
//VTM6.0
|
||||
double kvz_alf_derive_coeff_quant(channel_type channel,
|
||||
int *filterCoeffQuant,
|
||||
double **ee,
|
||||
double *y);
|
||||
int *filter_clipp,
|
||||
int *filter_coeff_quant,
|
||||
const alf_covariance* cov,
|
||||
const int bit_depth,
|
||||
const bool oprimize_clip);
|
||||
|
||||
double kvz_alf_derive_ctb_alf_enable_flags(encoder_state_t * const state,
|
||||
//VTM6.0
|
||||
//Muutama asia pitää vielä päivittää
|
||||
//bookmarks
|
||||
void kvz_alf_encoder_ctb(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
channel_type channel,
|
||||
const int i_shape_idx,
|
||||
double *distUnfilter,
|
||||
const int numClasses);
|
||||
alf_aps *aps);
|
||||
|
||||
void kvz_alf_get_avai_aps_ids_luma(encoder_state_t *const state,
|
||||
int *newApsId,
|
||||
int aps_ids[6],
|
||||
int *size_of_aps_ids);
|
||||
//VTM6.0
|
||||
//Funktion kvz_alf_filter_block kutsut; w, h, x, y, x_dst, y_dst, buf(s)?
|
||||
void kvz_alf_reconstructor(encoder_state_t const *state,
|
||||
const lcu_order_element_t *const lcu);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//-------------------------cabac writer functions------------------------
|
||||
//VTM6.0
|
||||
void code_alf_ctu_enable_flags(encoder_state_t * const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
int8_t component_id,
|
||||
alf_aps *aps);
|
||||
|
||||
//VTM6.0
|
||||
void code_alf_ctu_enable_flag(encoder_state_t * const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
uint32_t ctu_rs_addr,
|
||||
|
@ -528,49 +545,49 @@ void code_alf_ctu_filter_index(encoder_state_t * const state,
|
|||
//---------------------------------------------------------------------
|
||||
|
||||
//-------------------------CTU functions--------------------------------
|
||||
//Ei kutsuta koskaan?
|
||||
//En pääse VTM:llä kyseiseen funktioon
|
||||
//VTM6.0
|
||||
//Funktion kvz_alf_filter_block kutsut; w, h, x, y, x_dst, y_dst, buf(s)?
|
||||
//Ei kutsuta koskaan? -> En pääse VTM:llä kyseiseen funktioon
|
||||
void kvz_alf_process(encoder_state_t const *state,
|
||||
const lcu_order_element_t *lcu);
|
||||
|
||||
//Pitäisi luoda APS ( adaptive parameter set )
|
||||
//kvz_alf_process
|
||||
//kvz_alf_encoder_ctb
|
||||
//kvz_alf_reconstructor
|
||||
//VTM6.0
|
||||
//ei varmuutta miten alf_param_tmp pitäisi toimia tässä tilanteessa
|
||||
void kvz_alf_reconstruct_coeff_aps(encoder_state_t *const state,
|
||||
bool luma,
|
||||
bool chroma,
|
||||
bool is_rdo);
|
||||
|
||||
//OK, kun joitakin hardcoded arvoja käytetty
|
||||
//g_num_luma_filters??
|
||||
//g_luma_coeff??
|
||||
//g_filter_coeff_delta_idx??
|
||||
//g_fixed_filter_set_index??
|
||||
//g_fixed_filter_idx??
|
||||
//Ongelmat kantautuu funktiosta kvz_alf_derive_classification_blk
|
||||
//VTM6.0
|
||||
//OK
|
||||
void kvz_alf_reconstruct_coeff(encoder_state_t *const state,
|
||||
alf_aps *aps,
|
||||
channel_type channel,
|
||||
const bool is_rdo,
|
||||
const bool is_redo);
|
||||
|
||||
//VTM6.0
|
||||
//OK
|
||||
void kvz_alf_create(encoder_state_t const *state,
|
||||
const lcu_order_element_t *lcu);
|
||||
|
||||
//VTM6.0
|
||||
//OK
|
||||
void kvz_alf_destroy(encoder_state_t const *state);
|
||||
|
||||
//OK
|
||||
//VTM6.0
|
||||
//toimiiko x,y ja bufferit oikein? haetaanko oikeita pixeleitä?
|
||||
//alf_input_bit_depth = 10 VTM:ssä
|
||||
void kvz_alf_derive_classification(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
const int width,
|
||||
const int height,
|
||||
int x_pos,
|
||||
int y_pos);
|
||||
int y_pos,
|
||||
const int blk_dst_x,
|
||||
const int blk_dst_y);
|
||||
|
||||
//VTM6.0 (ei muuttunut)
|
||||
//OK
|
||||
//Turha jos PCM on pois päältä.
|
||||
//cu->ipcm?
|
||||
|
@ -581,30 +598,40 @@ void kvz_alf_reset_pcm_blk_class_info(encoder_state_t *const state,
|
|||
int x_pos,
|
||||
int y_pos);
|
||||
|
||||
//VTM6.0
|
||||
//OK
|
||||
void kvz_alf_derive_classification_blk(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
const lcu_order_element_t * const lcu,
|
||||
alf_classifier** classifier,
|
||||
const int shift,
|
||||
const int n_height,
|
||||
const int n_width,
|
||||
const int x,
|
||||
const int y);
|
||||
const int blk_pos_x,
|
||||
const int blk_pos_y,
|
||||
const int blk_dst_x,
|
||||
const int blk_dst_y,
|
||||
const int vbCTUHeight,
|
||||
int vbPos);
|
||||
|
||||
//VTM6.0
|
||||
//OK
|
||||
//resetPCMBlkClassInfo-funktiossa VTM:ssä return, pois jotta
|
||||
//pääsee tähän funktioon
|
||||
void kvz_alf_filter_block(encoder_state_t *const state,
|
||||
const lcu_order_element_t *const lcu,
|
||||
short* filter_set,
|
||||
const lcu_order_element_t * const lcu,
|
||||
const short* filter_set,
|
||||
const short *fClipSet,
|
||||
clp_rng clp_rng,
|
||||
alf_component_id component_id,
|
||||
const int width,
|
||||
const int height,
|
||||
int x_pos,
|
||||
int y_pos);
|
||||
int y_pos,
|
||||
int blk_dst_x,
|
||||
int blk_dst_y,
|
||||
int vbPos,
|
||||
const int vbCTUHeight);
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
//kvz_alf_filter_block funktion dst?
|
||||
//chroman stride puolet luman stridestä?
|
||||
#endif //ALF_H_
|
|
@ -50,6 +50,7 @@ int kvz_config_init(kvz_config *cfg)
|
|||
cfg->deblock_tc = 0;
|
||||
cfg->sao_type = 3;
|
||||
cfg->alf_enable = 1;
|
||||
cfg->alf_non_linear_luma = 0;
|
||||
cfg->rdoq_enable = 1;
|
||||
cfg->rdoq_skip = 1;
|
||||
cfg->signhide_enable = true;
|
||||
|
|
|
@ -196,17 +196,18 @@ static int encoder_state_config_slice_init(encoder_state_t * const state,
|
|||
state->slice->start_in_rs = state->encoder_control->tiles_ctb_addr_ts_to_rs[start_address_in_ts];
|
||||
state->slice->end_in_rs = state->encoder_control->tiles_ctb_addr_ts_to_rs[end_address_in_ts];
|
||||
|
||||
state->slice->aps = malloc(MAX_NUM_APS * sizeof(alf_aps));
|
||||
state->slice->param_set_map = malloc(sizeof(param_set_map) * MAX_NUM_APS);
|
||||
for (int aps_idx = 0; aps_idx < MAX_NUM_APS; aps_idx++) {
|
||||
state->slice->aps[aps_idx].aps_id = -1;
|
||||
state->slice->aps[aps_idx].num_luma_filters = -1;
|
||||
state->slice->aps[aps_idx].alf_luma_coeff_delta_flag = 0;
|
||||
state->slice->aps[aps_idx].alf_luma_coeff_delta_prediction_flag = 0;
|
||||
state->slice->aps[aps_idx].t_layer = -1;
|
||||
state->slice->aps[aps_idx].fixed_filter_pattern = -1;
|
||||
state->slice->aps[aps_idx].fixed_filter_set_index = -1;
|
||||
|
||||
//state->slice->apss = malloc(ALF_CTB_MAX_NUM_APS * sizeof(alf_aps));
|
||||
state->slice->apss = malloc(sizeof(alf_aps) * ALF_CTB_MAX_NUM_APS);
|
||||
state->slice->param_set_map = malloc(sizeof(param_set_map) * ALF_CTB_MAX_NUM_APS);
|
||||
for (int aps_idx = 0; aps_idx < ALF_CTB_MAX_NUM_APS; aps_idx++) {
|
||||
/*state->slice->apss[aps_idx].aps_id = -1;
|
||||
state->slice->apss[aps_idx].num_luma_filters = -1;
|
||||
state->slice->apss[aps_idx].alf_luma_coeff_delta_flag = 0;
|
||||
state->slice->apss[aps_idx].alf_luma_coeff_delta_prediction_flag = 0;
|
||||
state->slice->apss[aps_idx].t_layer = -1;
|
||||
state->slice->apss[aps_idx].fixed_filter_pattern = -1;
|
||||
state->slice->apss[aps_idx].fixed_filter_set_index = -1;*/
|
||||
|
||||
state->slice->param_set_map[aps_idx].b_changed = 0;
|
||||
//state->slice->param_set_map[aps_idx].p_nalu_data = malloc(sizeof(uint8_t));
|
||||
//state->slice->param_set_map[aps_idx].parameter_set = malloc(sizeof(alf_aps));
|
||||
|
@ -754,8 +755,13 @@ void kvz_encoder_state_finalize(encoder_state_t * const state) {
|
|||
if (state->slice->param_set_map && state->slice->param_set_map != NULL) {
|
||||
FREE_POINTER(state->slice->param_set_map);
|
||||
}
|
||||
if (state->slice->aps != NULL) {
|
||||
FREE_POINTER(state->slice->aps);
|
||||
if (state->slice->apss != NULL) {
|
||||
/*for (int i = 0; i < ALF_CTB_MAX_NUM_APS; i++) {
|
||||
if (state->slice->apss[i] != NULL) {
|
||||
FREE_POINTER(state->slice->apss[i]);
|
||||
}
|
||||
}*/
|
||||
FREE_POINTER(state->slice->apss);
|
||||
}
|
||||
if (state->slice->tile_group_luma_aps_id != NULL) {
|
||||
FREE_POINTER(state->slice->tile_group_luma_aps_id);
|
||||
|
|
|
@ -236,7 +236,7 @@ typedef struct encoder_state_config_slice_t {
|
|||
int32_t end_in_rs;
|
||||
|
||||
//ALF adaptation parameter set
|
||||
struct alf_aps *aps; // [MAX_NUM_APS];
|
||||
struct alf_aps *apss; //[ALF_CTB_MAX_NUM_APS];
|
||||
int tile_group_num_aps;
|
||||
int *tile_group_luma_aps_id;
|
||||
int tile_group_chroma_aps_id;
|
||||
|
|
|
@ -69,7 +69,6 @@ kvz_picture * kvz_image_alloc(enum kvz_chroma_format chroma_format, const int32_
|
|||
im->fulldata = im->fulldata_buf + simd_padding_width / sizeof(kvz_pixel);
|
||||
|
||||
//Shift the image to allow ALF filtering
|
||||
im->realfulldata = im->fulldata;
|
||||
im->fulldata = &im->fulldata[4 * (width + 8) + 4];
|
||||
im->base_image = im;
|
||||
im->refcount = 1; //We give a reference to caller
|
||||
|
@ -120,16 +119,11 @@ void kvz_image_free(kvz_picture *const im)
|
|||
} else {
|
||||
free(im->fulldata_buf);
|
||||
}
|
||||
else {
|
||||
// Was free(im->fulldata) before.
|
||||
free(im->realfulldata);
|
||||
}
|
||||
|
||||
// Make sure freed data won't be used.
|
||||
im->base_image = NULL;
|
||||
im->fulldata_buf = NULL;
|
||||
im->fulldata = NULL;
|
||||
im->realfulldata = NULL;
|
||||
im->y = im->u = im->v = NULL;
|
||||
im->data[COLOR_Y] = im->data[COLOR_U] = im->data[COLOR_V] = NULL;
|
||||
free(im);
|
||||
|
|
|
@ -287,9 +287,9 @@ typedef struct kvz_config
|
|||
int32_t deblock_enable; /*!< \brief Flag to enable deblocking filter */
|
||||
enum kvz_sao sao_type; /*!< \brief Flag to enable sample adaptive offset filter */
|
||||
int8_t alf_enable; /*!< \brief Flag to enable adaptive loop filter */
|
||||
//int32_t alf_ctu_enable_flag[3/*MAX_NUM_COMPONENT*/];
|
||||
//int32_t alf_tile_group_enable_flag[3/*MAX_NUM_COMPONENT*/];
|
||||
int32_t alf_slice_enable_flag[3/*MAX_NUM_COMPONENT*/];
|
||||
int8_t alf_non_linear_luma; /*!< \brief Flag to enable non linear alf for luma */
|
||||
int8_t alf_non_linear_chroma; /*!< \brief Flag to enable non linear alf for chroma */
|
||||
int32_t rdoq_enable; /*!< \brief Flag to enable RD optimized quantization. */
|
||||
int32_t signhide_enable; /*!< \brief Flag to enable sign hiding. */
|
||||
int32_t smp_enable; /*!< \brief Flag to enable SMP blocks. */
|
||||
|
|
Loading…
Reference in a new issue