[isp] Add height to idct getter function. Check block dimensions in transform 2d functions.

This commit is contained in:
siivonek 2022-08-11 14:30:04 +03:00
parent c982ed837a
commit 45e76eae63
5 changed files with 12 additions and 8 deletions

View file

@ -1634,7 +1634,7 @@ static void mts_idct_avx2(
if (type_hor == DCT2 && type_ver == DCT2 && width == height) if (type_hor == DCT2 && type_ver == DCT2 && width == height)
{ {
dct_func* idct_func = uvg_get_idct_func(width, color, tu->type); dct_func* idct_func = uvg_get_idct_func(width, height, color, tu->type);
idct_func(bitdepth, input, output); idct_func(bitdepth, input, output);
} }
else else

View file

@ -2560,7 +2560,7 @@ static void mts_idct_generic(
if (type_hor == DCT2 && type_ver == DCT2 && !tu->lfnst_idx && !tu->cr_lfnst_idx && width == height) if (type_hor == DCT2 && type_ver == DCT2 && !tu->lfnst_idx && !tu->cr_lfnst_idx && width == height)
{ {
dct_func *idct_func = uvg_get_idct_func(width, color, tu->type); dct_func *idct_func = uvg_get_idct_func(width, height, color, tu->type);
idct_func(bitdepth, input, output); idct_func(bitdepth, input, output);
} }
else else

View file

@ -99,7 +99,7 @@ dct_func * uvg_get_dct_func(int8_t width, int8_t height, color_t color, cu_type_
if (width != height) { if (width != height) {
// Non-square block. Return generic dct for non-square blokcs. // Non-square block. Return generic dct for non-square blokcs.
assert(false && "This should never be called at this point. Non-square stuff is done inside mts_dct function."); assert(false && "This should never be called at this point. Non-square stuff is done inside mts_dct function.");
return uvg_dct_non_square; //return uvg_dct_non_square;
} }
switch (width) { switch (width) {
case 4: case 4:
@ -128,8 +128,13 @@ dct_func * uvg_get_dct_func(int8_t width, int8_t height, color_t color, cu_type_
* *
* \returns Pointer to the function. * \returns Pointer to the function.
*/ */
dct_func * uvg_get_idct_func(int8_t width, color_t color, cu_type_t type) dct_func * uvg_get_idct_func(int8_t width, int8_t height, color_t color, cu_type_t type)
{ {
if (width != height) {
// Non-square block. Return generic dct for non-square blokcs.
assert(false && "This should never be called at this point. Non-square stuff is done inside mts_idct function.");
//return uvg_idct_non_square;
}
switch (width) { switch (width) {
case 4: case 4:
//if (color == COLOR_Y && type == CU_INTRA) { //if (color == COLOR_Y && type == CU_INTRA) {

View file

@ -86,7 +86,7 @@ extern mts_idct_func* uvg_mts_idct;
int uvg_strategy_register_dct(void* opaque, uint8_t bitdepth); int uvg_strategy_register_dct(void* opaque, uint8_t bitdepth);
dct_func * uvg_get_dct_func(int8_t width, int8_t height, color_t color, cu_type_t type); dct_func * uvg_get_dct_func(int8_t width, int8_t height, color_t color, cu_type_t type);
dct_func * uvg_get_idct_func(int8_t width, color_t color, cu_type_t type); dct_func * uvg_get_idct_func(int8_t width, int8_t height, color_t color, cu_type_t type);

View file

@ -271,14 +271,13 @@ void uvg_itransform2d(const encoder_control_t * const encoder,
color_t color, color_t color,
const cu_info_t *tu) const cu_info_t *tu)
{ {
if (encoder->cfg.mts) if (encoder->cfg.mts || block_width != block_height)
{ {
uvg_mts_idct(encoder->bitdepth, color, tu, block_width, block_height, coeff, block, encoder->cfg.mts); uvg_mts_idct(encoder->bitdepth, color, tu, block_width, block_height, coeff, block, encoder->cfg.mts);
} }
else else
{ {
// ISP_TODO: block height dct_func *idct_func = uvg_get_idct_func(block_width, block_height, color, tu->type);
dct_func *idct_func = uvg_get_idct_func(block_width, color, tu->type);
idct_func(encoder->bitdepth, coeff, block); idct_func(encoder->bitdepth, coeff, block);
} }
} }