mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
[isp] Use TR_MAX_WIDTH in ISP checks instead of parameter.
This commit is contained in:
parent
c4bc2d6b10
commit
89db34d4e0
|
@ -1103,7 +1103,7 @@ void uvg_encode_intra_luma_coding_unit(const encoder_state_t * const state,
|
||||||
|
|
||||||
bool enable_isp = state->encoder_control->cfg.isp;
|
bool enable_isp = state->encoder_control->cfg.isp;
|
||||||
// Need at least 16 samples in sub blocks to use isp. If both dimensions are 4, not enough samples. Blocks of size 2 do not exist yet (not for luma at least)
|
// Need at least 16 samples in sub blocks to use isp. If both dimensions are 4, not enough samples. Blocks of size 2 do not exist yet (not for luma at least)
|
||||||
bool allow_isp = enable_isp ? uvg_can_use_isp(width, height, 64 /*MAX_TR_SIZE*/) : false;
|
bool allow_isp = enable_isp ? uvg_can_use_isp(width, height) : false;
|
||||||
uint8_t isp_mode = allow_isp ? cur_cu->intra.isp_mode : 0;
|
uint8_t isp_mode = allow_isp ? cur_cu->intra.isp_mode : 0;
|
||||||
|
|
||||||
if (allow_isp && !multi_ref_idx /*&& !bdpcm && !color_transform*/) {
|
if (allow_isp && !multi_ref_idx /*&& !bdpcm && !color_transform*/) {
|
||||||
|
|
|
@ -1851,7 +1851,7 @@ void uvg_intra_recon_cu(
|
||||||
* \param height Block height.
|
* \param height Block height.
|
||||||
* \param max_tr_size Maximum supported transform block size (64).
|
* \param max_tr_size Maximum supported transform block size (64).
|
||||||
*/
|
*/
|
||||||
bool uvg_can_use_isp(const int width, const int height, const int max_tr_size)
|
bool uvg_can_use_isp(const int width, const int height)
|
||||||
{
|
{
|
||||||
assert(!(width > LCU_WIDTH || height > LCU_WIDTH) && "Block size larger than max LCU size.");
|
assert(!(width > LCU_WIDTH || height > LCU_WIDTH) && "Block size larger than max LCU size.");
|
||||||
assert(!(width < TR_MIN_WIDTH || height < TR_MIN_WIDTH) && "Block size smaller than min TR_WIDTH.");
|
assert(!(width < TR_MIN_WIDTH || height < TR_MIN_WIDTH) && "Block size smaller than min TR_WIDTH.");
|
||||||
|
@ -1861,7 +1861,7 @@ bool uvg_can_use_isp(const int width, const int height, const int max_tr_size)
|
||||||
|
|
||||||
// Each split block must have at least 16 samples.
|
// Each split block must have at least 16 samples.
|
||||||
bool not_enough_samples = (log2_width + log2_height <= 4);
|
bool not_enough_samples = (log2_width + log2_height <= 4);
|
||||||
bool cu_size_larger_than_max_tr_size = width > max_tr_size || height > max_tr_size;
|
bool cu_size_larger_than_max_tr_size = width > TR_MAX_WIDTH || height > TR_MAX_WIDTH;
|
||||||
if (not_enough_samples || cu_size_larger_than_max_tr_size) {
|
if (not_enough_samples || cu_size_larger_than_max_tr_size) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,5 +174,5 @@ int uvg_get_mip_flag_context(int x, int y, int width, int height, const lcu_t* l
|
||||||
int uvg_get_isp_split_dim(const int width, const int height, const int split_type, const bool is_transform_block);
|
int uvg_get_isp_split_dim(const int width, const int height, const int split_type, const bool is_transform_block);
|
||||||
int uvg_get_isp_split_num(const int width, const int height, const int split_type, const bool is_transform_block);
|
int uvg_get_isp_split_num(const int width, const int height, const int split_type, const bool is_transform_block);
|
||||||
void uvg_get_isp_split_loc(cu_loc_t *loc, const int x, const int y, const int block_w, const int block_h, int split_idx, const int split_type, const bool is_transform_block);
|
void uvg_get_isp_split_loc(cu_loc_t *loc, const int x, const int y, const int block_w, const int block_h, int split_idx, const int split_type, const bool is_transform_block);
|
||||||
bool uvg_can_use_isp(const int width, const int height, const int max_tr_size);
|
bool uvg_can_use_isp(const int width, const int height);
|
||||||
bool uvg_can_use_isp_with_lfnst(const int width, const int height, const int isp_mode, const enum uvg_tree_type tree_type);
|
bool uvg_can_use_isp_with_lfnst(const int width, const int height, const int isp_mode, const enum uvg_tree_type tree_type);
|
||||||
|
|
|
@ -1392,7 +1392,7 @@ static int8_t search_intra_rdo(
|
||||||
double best_isp_cost = MAX_DOUBLE;
|
double best_isp_cost = MAX_DOUBLE;
|
||||||
double best_bits = MAX_DOUBLE;
|
double best_bits = MAX_DOUBLE;
|
||||||
int8_t best_isp_mode = -1;
|
int8_t best_isp_mode = -1;
|
||||||
int max_isp_modes = can_do_isp_search && uvg_can_use_isp(width, height, TR_MAX_WIDTH) && state->encoder_control->cfg.isp ? NUM_ISP_MODES : 1;
|
int max_isp_modes = can_do_isp_search && uvg_can_use_isp(width, height) && state->encoder_control->cfg.isp ? NUM_ISP_MODES : 1;
|
||||||
|
|
||||||
for (int isp_mode = 0; isp_mode < max_isp_modes; ++isp_mode) {
|
for (int isp_mode = 0; isp_mode < max_isp_modes; ++isp_mode) {
|
||||||
search_data[mode].pred_cu.intra.isp_mode = isp_mode;
|
search_data[mode].pred_cu.intra.isp_mode = isp_mode;
|
||||||
|
|
Loading…
Reference in a new issue