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 887D64EE8F for ; Wed, 14 May 2025 13:45:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4026968C85A; Wed, 14 May 2025 16:41:28 +0300 (EEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D54F68C7C8 for ; Wed, 14 May 2025 16:41:22 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-74237a74f15so7625276b3a.0 for ; Wed, 14 May 2025 06:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747230081; x=1747834881; 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=kV3OpOPFpNPr+6mKb85pJQIBsXrXPhwvPsOzV4FyUE90Ad4J+J4E/HFvhSMb35T6Jr jG6LXBKoA/4V2yCsLN7HePQkxHEC/yXRydW8ikxAeyyVtVfy3Ya17kaU0s5g/kBsUED9 sV7qhNxZkWuvnqy4VG0961rylEgQQzmWN4rJqB6n/WB5K1r/8losgU2BTEJGDdd2Eg5J 5hXAccc1wI9RJE1eSm96CCScBblAg2uM4FLyOKXngNFxy7U3Ch6VCeZxGvsropH2jbQo ODY2gNrWeR6lqjbMovXfr1Gg7BIMlE1uMO7RH+k250l1hnYlev5ZnMI/NUNKJ5FWYb/k PiiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747230081; x=1747834881; 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=YkGZTgjCU14A/S6SrGL8uNTYN9KGaIBj22Nvvm49dfGcWbqJ2ppcFd7lwGL1q971fv P0yoUV4c3u8UD8/Xhb3QSux23EtKDTxeMRYiK3/vkZLv2nQli/SqKotsAuABPK3WIwuc GB95c+GsawNZDawmiIhvQ0tsDs+2adV/1ftysRQHaA+zJ8CQ0X+Hcj5R5xQXI9NOFaRc PnsvSGo1a5HxYE16BDx0UINZS2pYVwi9sixYglIsmbmwHZyPxWuxwzqF8CJIQssfc1NA 5S2DT8O94Uf8Py0RhHg91qxzPreJnBk40brKiSphzBqtw614EKH68cdR5rMYfoL2RFsP P7mA== X-Gm-Message-State: AOJu0YyRgtnnmRuF0EHpajWnEWJ0SiKGo5drJmNxaho1l0pnJPegbHjd 914ScmHRpnffVRyzIuoHtvjw6KKoKq790Fmq9rFwfVcvUJ/9YxS0RbtkKcBC X-Gm-Gg: ASbGncvKQ+qJc1rUrEYQVUj9dxCu8A9pOMRKyRg/cMWAj/rZaT0801PCPEIL4WHBgir wuJxYHuEeNflwYCny/+HNJs8+Qr0GICmrRdPS0Fwf13BNi4wYGiZchuZVyR5gqx7sQTemdjvDRC yY8Vi5+qgTc5mKDMeSIa8QkJTUE4x8ESAWLI5adRDLD6IDrM4XIDeTwRuLN1LHZ1Rp26N1c84/I AV7k143nX0UJ/K5J3DvCYLokGU4IvoIE8piPx4Mvk+rp1UHPOqjg3dKBWXqIHCOVUmk7a/p2ICE XCh1Bml7Ran6M/ryGFWdeZrfFH1e06ijMCi3Gcp1h7owgC36/iPzoOE3OR2rI7uZZypiag9o X-Google-Smtp-Source: AGHT+IFPooMKgH37Hxaj9+wb7XJFEf7dRBPu9gfvsrJvRF4QmWUBWVXiwuM7F3aGbGYzjU77W2zGjg== X-Received: by 2002:a05:6a00:92a8:b0:740:67ce:1d8b with SMTP id d2e1a72fcca58-74289289c70mr4717895b3a.7.1747230080974; Wed, 14 May 2025 06:41:20 -0700 (PDT) Received: from localhost.localdomain ([124.79.129.75]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74237a8f7edsm9310669b3a.167.2025.05.14.06.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 May 2025 06:41:20 -0700 (PDT) From: toqsxw@gmail.com X-Google-Original-From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 May 2025 21:40:29 +0800 Message-ID: <20250514134031.1584-22-toqsxw@outlook.com> X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20250514134031.1584-1-toqsxw@outlook.com> References: <20250514134031.1584-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".