From 8223112cc110b431916ab5d79f7420982eb3de46 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Thu, 5 May 2022 14:28:07 +0300 Subject: [PATCH 1/2] Revert "[intra] Limit intra depth to 3 (8x8) for now" This reverts commit c8539a3701f3b615e9a6015a533c08c0e65177de. --- README.md | 2 +- src/cfg.c | 10 +++++----- src/global.h | 2 +- tests/test_intra.sh | 2 +- tests/test_lmcs.sh | 2 +- tests/test_monochrome.sh | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e9d03119..5027547d 100644 --- a/README.md +++ b/README.md @@ -373,7 +373,7 @@ where the names have been abbreviated to fit the layout in GitHub. | | 0-uf | 1-sf | 2-vf | 3-fr | 4-f | 5-m | 6-s | 7-sr | 8-vs | 9-p | | -------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | | rd | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | -| pu-depth-intra | 2-3 | 2-3 | 2-3 | 2-3 | 1-3 | 1-3 | 1-3 | 1-3 | 1-3 | 1-3 | +| pu-depth-intra | 2-3 | 2-3 | 2-3 | 2-3 | 1-3 | 1-4 | 1-4 | 1-4 | 1-4 | 1-4 | | pu-depth-inter | 1-2 | 1-2 | 1-3 | 1-3 | 1-3 | 0-3 | 0-3 | 0-3 | 0-3 | 0-3 | | me | hexbs | hexbs | hexbs | hexbs | hexbs | hexbs | hexbs | hexbs | tz | tz | | gop | 8 | 8 | 8 | 8 | 8 | 16 | 16 | 16 | 16 | 16 | diff --git a/src/cfg.c b/src/cfg.c index 129d7fbb..8147bcdb 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -699,7 +699,7 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value) { "medium", "rd", "0", - "pu-depth-intra", "1-3", + "pu-depth-intra", "1-4", "pu-depth-inter", "0-3", "me", "hexbs", "gop", "16", @@ -725,7 +725,7 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value) { "slow", "rd", "1", - "pu-depth-intra", "1-3", + "pu-depth-intra", "1-4", "pu-depth-inter", "0-3", "me", "hexbs", "gop", "16", @@ -751,7 +751,7 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value) { "slower", "rd", "2", - "pu-depth-intra", "1-3", + "pu-depth-intra", "1-4", "pu-depth-inter", "0-3", "me", "hexbs", "gop", "16", @@ -777,7 +777,7 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value) { "veryslow", "rd", "2", - "pu-depth-intra", "1-3", + "pu-depth-intra", "1-4", "pu-depth-inter", "0-3", "me", "tz", "gop", "16", @@ -803,7 +803,7 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value) { "placebo", "rd", "2", - "pu-depth-intra", "1-3", + "pu-depth-intra", "1-4", "pu-depth-inter", "0-3", "me", "tz", "gop", "16", diff --git a/src/global.h b/src/global.h index 85f26f71..444cdfac 100644 --- a/src/global.h +++ b/src/global.h @@ -149,7 +149,7 @@ typedef int16_t mv_t; #define PU_DEPTH_INTER_MIN 0 #define PU_DEPTH_INTER_MAX 3 #define PU_DEPTH_INTRA_MIN 0 -#define PU_DEPTH_INTRA_MAX 3 +#define PU_DEPTH_INTRA_MAX 4 //! Maximum number of layers in GOP structure (for allocating structures) #define MAX_GOP_LAYERS 6 diff --git a/tests/test_intra.sh b/tests/test_intra.sh index 2f0ca470..3a560002 100755 --- a/tests/test_intra.sh +++ b/tests/test_intra.sh @@ -6,7 +6,7 @@ set -eu . "${0%/*}/util.sh" -common_args='256x128 10 yuv420p -p1 --preset=ultrafast --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --pu-depth-intra 0-3' +common_args='256x128 10 yuv420p -p1 --preset=ultrafast --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --pu-depth-intra 0-4' valgrind_test $common_args --rd=1 valgrind_test $common_args --rd=2 --no-transform-skip --qp 37 valgrind_test $common_args --rd=2 --no-transform-skip --qp 37 --signhide --rdoq diff --git a/tests/test_lmcs.sh b/tests/test_lmcs.sh index 391fb534..fd3b5dff 100755 --- a/tests/test_lmcs.sh +++ b/tests/test_lmcs.sh @@ -6,6 +6,6 @@ set -eu . "${0%/*}/util.sh" -common_args='256x128 10 yuv420p -p1 --preset=ultrafast --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --cpuid=0 --pu-depth-intra 0-3 --lmcs' +common_args='256x128 10 yuv420p -p1 --preset=ultrafast --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --cpuid=0 --pu-depth-intra 0-4 --lmcs' valgrind_test $common_args --deblock --sao=full --alf=full diff --git a/tests/test_monochrome.sh b/tests/test_monochrome.sh index 7d2ffa6f..928228d4 100755 --- a/tests/test_monochrome.sh +++ b/tests/test_monochrome.sh @@ -6,7 +6,7 @@ set -eu . "${0%/*}/util.sh" -common_args='256x128 10 gray --hash none --preset=ultrafast --input-format P400 --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --cpuid=0 --pu-depth-intra 0-3' +common_args='256x128 10 gray --hash none --preset=ultrafast --input-format P400 --threads=0 --no-wpp --no-tmvp --no-deblock --sao=0 --cpuid=0 --pu-depth-intra 0-4' valgrind_test $common_args --rd=1 -p1 valgrind_test $common_args --rd=2 -p1 valgrind_test $common_args --rd=2 -p1 --deblock 0:0 From d5b6d2771c96d1ca5f33ab6837cc4287f770b6f1 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Thu, 5 May 2022 14:28:50 +0300 Subject: [PATCH 2/2] [deltaqp] Fix delta qp writing for 4x4 for CUs --- src/encode_coding_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index d9bc8cb9..65d7ab24 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -570,7 +570,7 @@ static void encode_transform_coeff(encoder_state_t * const state, } if (cb_flag_y | cb_flag_u | cb_flag_v) { - if (state->must_code_qp_delta) { + if (state->must_code_qp_delta && (only_chroma || cb_flag_y || depth != 4) ) { const int qp_pred = uvg_get_cu_ref_qp(state, x_cu, y_cu, state->last_qp); const int qp_delta = cur_cu->qp - qp_pred; // Possible deltaQP range depends on bit depth as stated in HEVC specification.