From 3dad57bdf68b27554a4d635ab32356219a984090 Mon Sep 17 00:00:00 2001 From: Jamaika1 Date: Tue, 28 May 2024 17:54:10 +0200 Subject: [PATCH 1/4] embed adaptive Quantization method --- ffmpeg-subtree/libavcodec/libxeve.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ffmpeg-subtree/libavcodec/libxeve.c b/ffmpeg-subtree/libavcodec/libxeve.c index c10b7de023..055ab4cd62 100644 --- a/ffmpeg-subtree/libavcodec/libxeve.c +++ b/ffmpeg-subtree/libavcodec/libxeve.c @@ -87,6 +87,9 @@ typedef struct XeveContext { int hash; // embed picture signature (HASH) for conformance checking in decoding int sei_info; // embed Supplemental enhancement information while encoding + int aq_mode; // embed adaptive Quantization method + int cutree; // embed cutree for Adaptive Quantization + int color_format; // input data color format: currently only XEVE_CF_YCBCR420 is supported AVDictionary *xeve_params; @@ -218,6 +221,12 @@ static int get_conf(AVCodecContext *avctx, XEVE_CDSC *cdsc) cdsc->param.rc_type = xectx->rc_mode; + if (xectx->aq_mode >= 0) + cdsc->param.aq_mode = xectx->aq_mode; + + if (xectx->cutree >= 0) + cdsc->param.cutree = xectx->cutree; + if (xectx->rc_mode == XEVE_RC_CQP) cdsc->param.qp = xectx->qp; else if (xectx->rc_mode == XEVE_RC_ABR) { @@ -574,6 +583,8 @@ static const AVOption libxeve_options[] = { { "crf", "Constant rate factor value for CRF rate control mode", OFFSET(crf), AV_OPT_TYPE_INT, { .i64 = 32 }, 10, 49, VE }, { "hash", "Embed picture signature (HASH) for conformance checking in decoding", OFFSET(hash), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "sei_info", "Embed SEI messages identifying encoder parameters and command line arguments", OFFSET(sei_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { "aq-mode", "Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "aq_mode"}, + { "cutree", "Enable cutree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "cutree"}, { "xeve-params", "Override the xeve configuration using a :-separated list of key=value parameters", OFFSET(xeve_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } }; From 23d0b5eb6c58986a75bd903bea0b9195cd53009d Mon Sep 17 00:00:00 2001 From: Jamaika1 Date: Tue, 28 May 2024 18:10:14 +0200 Subject: [PATCH 2/4] embed adaptive Quantization method --- ffmpeg-subtree/libavcodec/libxeve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg-subtree/libavcodec/libxeve.c b/ffmpeg-subtree/libavcodec/libxeve.c index 055ab4cd62..5319b0c679 100644 --- a/ffmpeg-subtree/libavcodec/libxeve.c +++ b/ffmpeg-subtree/libavcodec/libxeve.c @@ -584,7 +584,7 @@ static const AVOption libxeve_options[] = { { "hash", "Embed picture signature (HASH) for conformance checking in decoding", OFFSET(hash), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "sei_info", "Embed SEI messages identifying encoder parameters and command line arguments", OFFSET(sei_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "aq-mode", "Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "aq_mode"}, - { "cutree", "Enable cutree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "cutree"}, + { "cu-tree", "Enable cutree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "cu-tree"}, { "xeve-params", "Override the xeve configuration using a :-separated list of key=value parameters", OFFSET(xeve_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } }; From 416b85788f2abeaf7321b4420c2c09191145a474 Mon Sep 17 00:00:00 2001 From: Jamaika1 Date: Tue, 28 May 2024 18:11:38 +0200 Subject: [PATCH 3/4] embed adaptive Quantization method --- ffmpeg-subtree/libavcodec/libxeve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg-subtree/libavcodec/libxeve.c b/ffmpeg-subtree/libavcodec/libxeve.c index 5319b0c679..477f244ff9 100644 --- a/ffmpeg-subtree/libavcodec/libxeve.c +++ b/ffmpeg-subtree/libavcodec/libxeve.c @@ -583,7 +583,7 @@ static const AVOption libxeve_options[] = { { "crf", "Constant rate factor value for CRF rate control mode", OFFSET(crf), AV_OPT_TYPE_INT, { .i64 = 32 }, 10, 49, VE }, { "hash", "Embed picture signature (HASH) for conformance checking in decoding", OFFSET(hash), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "sei_info", "Embed SEI messages identifying encoder parameters and command line arguments", OFFSET(sei_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, - { "aq-mode", "Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "aq_mode"}, + { "aq-mode", "Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "aq-mode"}, { "cu-tree", "Enable cutree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "cu-tree"}, { "xeve-params", "Override the xeve configuration using a :-separated list of key=value parameters", OFFSET(xeve_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } From 9c57ac4908d092d31c7bf0da40655cf8a455dac0 Mon Sep 17 00:00:00 2001 From: Jamaika1 Date: Tue, 28 May 2024 20:02:03 +0200 Subject: [PATCH 4/4] embed adaptive Quantization method --- ffmpeg-subtree/libavcodec/libxeve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg-subtree/libavcodec/libxeve.c b/ffmpeg-subtree/libavcodec/libxeve.c index 477f244ff9..2850774d77 100644 --- a/ffmpeg-subtree/libavcodec/libxeve.c +++ b/ffmpeg-subtree/libavcodec/libxeve.c @@ -583,8 +583,8 @@ static const AVOption libxeve_options[] = { { "crf", "Constant rate factor value for CRF rate control mode", OFFSET(crf), AV_OPT_TYPE_INT, { .i64 = 32 }, 10, 49, VE }, { "hash", "Embed picture signature (HASH) for conformance checking in decoding", OFFSET(hash), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "sei_info", "Embed SEI messages identifying encoder parameters and command line arguments", OFFSET(sei_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, - { "aq-mode", "Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "aq-mode"}, - { "cu-tree", "Enable cutree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "cu-tree"}, + { "aq-mode", "Embed Adaptive Quantization method", OFFSET(aq_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { "cu-tree", "Embed cu-tree for Adaptive Quantization", OFFSET(cutree), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "xeve-params", "Override the xeve configuration using a :-separated list of key=value parameters", OFFSET(xeve_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } };