From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 885D34BA54 for ; Thu, 1 May 2025 14:48:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 501BB68BD47; Thu, 1 May 2025 17:44:24 +0300 (EEST) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 30AEC6802C1 for ; Thu, 1 May 2025 17:44:21 +0300 (EEST) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7fd35b301bdso1287515a12.2 for ; Thu, 01 May 2025 07:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746110659; x=1746715459; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9BnQOmqAJwu+VcVt7kALIgUTdZQHRAnjr7RvKMZfZJo=; b=B/wFQci7BEKN+gj4oj/RTCtBy093BHYo3ltN5XpVmmQzPXVIGdY24ADEoR2Afro03C bOTsMAtaU6/r4N6GNAH9u8I/qI0vrEBublW7cKYPW4FLAwMnAG3+ceXQjodlz1fRgSh5 /pbPq2KAaeCnrC8H/wOiABqRfqQYl75yqLwwdHo7C1CI/2nvGLZo9cnupBVXq8T8TFpx Zyd+Ld1sEUdnhzrVbcKp4q66KPYuMLdz80JQPHNqRG7zutycpSIgT1kLCkEB9aA8vyIN 16MkmGdkYAIzT5Is2TxSpnMHnMQyW5Se4UekIblGjup3SDAXs//n7V1NadFQKG8OYMWK WhBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746110659; x=1746715459; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9BnQOmqAJwu+VcVt7kALIgUTdZQHRAnjr7RvKMZfZJo=; b=MJLXLzUCrXqiv0n4B6rjjI0DDmH0lPcvAnFfOT/a7XMKZZHJ6gN+lDQ2tfaCLyra0b QLsLQEjwTv3OS97EEyDxQROWhvWHaYFVZ/gmQfIZ4Lb+7fSp+APfkrFirK84iZ3xeWtF PtzIakv+WLF1qucyPht5WlYsHi/ZYnTVYAf3jFdJ48enyfvaffpisvQSTFqiB9yk8wrC LM3zf/tT7zr2E3TU6fJg6ZMUyxP4Kx92qLllT/4K/lcw1lcbPLwyO9YucQaybZ5JpnRh VC5My4No/OwV7y1iGAwWNh7OJ9b5kR59BNMVWfmrGxjRpoTveKYaRj8rLk+qN1M4LC+V sjvA== X-Gm-Message-State: AOJu0Yw9sepggeygXdYUvZOZGLvF3MOSSlFJnyelNDSrbc8TQxmDoT/z 1YpBSSO4Baabs9CEAzAlvz2Th8VH3zt2YUJNIghgCUv8JsUnOci8Ru3cRg== X-Gm-Gg: ASbGncujWUoqdXcxOoYr255WTxQbTJGU21Cdxp/xiwLIdallQwNcw+PGeZxTt6yNRtk 43Mzq7l2BbT8+CCSFVWffrGd/UrTDjyB1zvaqVImFLRnLQq43TE0drFu5WnCVX2w45tVJ2/oyR2 3GamCdjP9+gLG0M9nIJY0/yLTEWkvFvELTmOfkCIhcb70i4F3zV35Er88RQ1DQ18oA1nRmdgzQ7 2uphLvEoVgTflqy9qJLDTQt/ehCiDtkxjNV/P/0R4WXnHaYergsZ3IaBETViUZrydCxwQH7C0Ob zUlK/JYHIv41+rHchptBeNJI9g+Tw2O/dHeutGiptj4g3k3ZBQZEjAqAsBf3vQ== X-Google-Smtp-Source: AGHT+IHO4JT7AzWF5k+0r1hEWGrJYUsInE6X6o3X16EgV4FA4rg7FRnxx400GWiunZunnYILzNtdjA== X-Received: by 2002:a05:6a20:9f45:b0:1f5:8e94:2e7f with SMTP id adf61e73a8af0-20aa438048dmr9522730637.33.1746110659335; Thu, 01 May 2025 07:44:19 -0700 (PDT) Received: from localhost.localdomain ([124.79.129.75]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b1f9d4b68e8sm807271a12.27.2025.05.01.07.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 07:44:19 -0700 (PDT) From: toqsxw@gmail.com X-Google-Original-From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 May 2025 22:43:20 +0800 Message-ID: <20250501144324.958-22-toqsxw@outlook.com> X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20250501144324.958-1-toqsxw@outlook.com> References: <20250501144324.958-1-toqsxw@outlook.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1 22/23] avcodec/vvc: add adaptive color transform support X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Wu Jianhua Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wu Jianhua passed files: ACT_A_Kwai_3.bit ACT_B_Kwai_3.bit Signed-off-by: Wu Jianhua --- libavcodec/vvc/ctu.c | 2 ++ libavcodec/vvc/intra.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index e160199580..62c9d4f5c0 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -392,6 +392,8 @@ static int hls_transform_unit(VVCLocalContext *lc, int x0, int y0,int tu_width, if (ret < 0) return ret; set_tb_tab(fc->tab.tu_coded_flag[tb->c_idx], tu->coded_flag[tb->c_idx], fc, tb); + } else if (cu->act_enabled_flag) { + memset(tb->coeffs, 0, tb->tb_width * tb->tb_height * sizeof(*tb->coeffs)); } if (tb->c_idx != CR) set_tb_size(fc, tb); diff --git a/libavcodec/vvc/intra.c b/libavcodec/vvc/intra.c index 0ea33e1e73..f56b43be66 100644 --- a/libavcodec/vvc/intra.c +++ b/libavcodec/vvc/intra.c @@ -523,13 +523,14 @@ static void lmcs_scale_chroma(VVCLocalContext *lc, TransformUnit *tu, TransformB static void add_residual(const VVCLocalContext *lc, TransformUnit *tu, const int target_ch_type) { const VVCFrameContext *fc = lc->fc; + const CodingUnit *cu = lc->cu; for (int i = 0; i < tu->nb_tbs; i++) { TransformBlock *tb = tu->tbs + i; const int c_idx = tb->c_idx; const int ch_type = c_idx > 0; const ptrdiff_t stride = fc->frame->linesize[c_idx]; - const bool has_residual = tb->has_coeffs || + const bool has_residual = tb->has_coeffs || cu->act_enabled_flag || (c_idx && tu->joint_cbcr_residual_flag); uint8_t *dst = POS(c_idx, tb->x0, tb->y0); @@ -543,12 +544,13 @@ static void itransform(VVCLocalContext *lc, TransformUnit *tu, const int target_ const VVCFrameContext *fc = lc->fc; const CodingUnit *cu = lc->cu; TransformBlock *tbs = tu->tbs; + const bool is_act_luma = cu->act_enabled_flag && target_ch_type == LUMA; for (int i = 0; i < tu->nb_tbs; i++) { TransformBlock *tb = tbs + i; const int c_idx = tb->c_idx; const int ch_type = c_idx > 0; - const bool do_itx = ch_type == target_ch_type; + const bool do_itx = is_act_luma || !cu->act_enabled_flag && ch_type == target_ch_type; if (tb->has_coeffs && do_itx) { if (cu->bdpcm_flag[tb->c_idx]) @@ -568,6 +570,13 @@ static void itransform(VVCLocalContext *lc, TransformUnit *tu, const int target_ lmcs_scale_chroma(lc, tu, tb, target_ch_type); } } + + if (is_act_luma) { + fc->vvcdsp.itx.adaptive_color_transform( + tbs[LUMA].coeffs, tbs[CB].coeffs, tbs[CR].coeffs, + tbs[LUMA].tb_width, tbs[LUMA].tb_height); + } + add_residual(lc, tu, target_ch_type); } -- 2.44.0.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".