mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
[ibc] Add --ibc
parameter and config values for Intra Block Copy
This commit is contained in:
parent
cd2d4066d5
commit
20d0a9b65e
11
src/cfg.c
11
src/cfg.c
|
@ -221,6 +221,9 @@ int uvg_config_init(uvg_config *cfg)
|
|||
cfg->cabac_debug_file_name = NULL;
|
||||
|
||||
cfg->dual_tree = 0;
|
||||
|
||||
cfg->ibc = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1475,6 +1478,14 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value)
|
|||
else if OPT("dual-tree") {
|
||||
cfg->dual_tree = atobool(value);
|
||||
}
|
||||
else if OPT ("ibc") {
|
||||
int ibc_value = atoi(value);
|
||||
if (ibc_value < 0 || ibc_value > 2) {
|
||||
fprintf(stderr, "ibc supports only range from 0 to 2\n");
|
||||
return 0;
|
||||
}
|
||||
cfg->ibc = (uint8_t)ibc_value;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -191,6 +191,7 @@ static const struct option long_options[] = {
|
|||
{ "dual-tree", no_argument, NULL, 0 },
|
||||
{ "no-dual-tree", no_argument, NULL, 0 },
|
||||
{ "cabac-debug-file", required_argument, NULL, 0 },
|
||||
{ "ibc", required_argument, NULL, 0 },
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
|
1
src/cu.h
1
src/cu.h
|
@ -52,6 +52,7 @@ typedef enum {
|
|||
CU_INTRA = 1,
|
||||
CU_INTER = 2,
|
||||
CU_PCM = 3,
|
||||
CU_IBC = 4,
|
||||
} cu_type_t;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -694,7 +694,11 @@ static void encoder_state_write_bitstream_seq_parameter_set(bitstream_t* stream,
|
|||
WRITE_UE(stream, 0, "sps_internal_bit_depth_minus_input_bit_depth");
|
||||
}
|
||||
|
||||
WRITE_U(stream, 0, 1, "sps_ibc_enabled_flag");
|
||||
WRITE_U(stream, encoder->cfg.ibc > 0 ? 1 : 0, 1, "sps_ibc_enabled_flag");
|
||||
|
||||
if (encoder->cfg.ibc) {
|
||||
WRITE_UE(stream,6 - IBC_MRG_MAX_NUM_CANDS, "sps_six_minus_max_num_ibc_merge_cand");
|
||||
}
|
||||
|
||||
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
|
||||
// if(!no_ladf_constraint_flag)
|
||||
|
|
|
@ -254,6 +254,12 @@ typedef int32_t mv_t;
|
|||
#define AMVP_MAX_NUM_CANDS 2
|
||||
#define AMVP_MAX_NUM_CANDS_MEM 3
|
||||
#define MRG_MAX_NUM_CANDS 6
|
||||
/**
|
||||
* \brief Max number of merge candidates in Intra Block Copy
|
||||
*
|
||||
*/
|
||||
#define IBC_MRG_MAX_NUM_CANDS 6
|
||||
|
||||
|
||||
#define MAX_NUM_HMVP_CANDS 5
|
||||
|
||||
|
|
|
@ -541,6 +541,9 @@ typedef struct uvg_config
|
|||
char* cabac_debug_file_name;
|
||||
|
||||
uint8_t dual_tree;
|
||||
|
||||
uint8_t ibc; /* \brief Intra Block Copy parameter */
|
||||
|
||||
} uvg_config;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue