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 E2E2F4E35F for ; Thu, 1 May 2025 14:47:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E0D8168BC9D; Thu, 1 May 2025 17:44:20 +0300 (EEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2456568BC3F for ; Thu, 1 May 2025 17:44:18 +0300 (EEST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-af59c920d32so716346a12.0 for ; Thu, 01 May 2025 07:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746110656; x=1746715456; 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=CvYaHstbY2JwEiqc7NB+qe/nnoir1XdkgYx0tLQLQYk=; b=hkKTwmL4e3dxZI78gOZt+a/x0YEZEGu1/vjkRFsq/H0JIyaj2/4Sf0imU0JpUYKHQF 3zg5ggxd5jGUegl/IkR32W7qbJrJqZAkGZ42U8UyTQEiZ6wjVSs/qU3qneufZjBl6YZ/ 6dAfbQLotrqOGkopzLcNXyB07GwzWc09RhvERiTDVbJJc0jHb0hr1fqWTmVdHtl/x7cc Og16GhJGMKI0FjRWO9OcFyLnrZ8JNSAcoCQ4dd/U7ebYPrkDsPu5ElyhHzdwGJDgQamQ 4f8NOuEOgncAnFv+NTn/zi3qCw3vx174jTtvtaKBVOTf/CpBRrQJZvq8EcwhCLPK91Ny 1W8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746110656; x=1746715456; 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=CvYaHstbY2JwEiqc7NB+qe/nnoir1XdkgYx0tLQLQYk=; b=rSLgIKQ4sl08d1uxdMmasmFYV6yk1G2xDtjTUvpRrMfyoBqajPZ91RcWlbQqBF8abi mZRIKUa0B2i2OtOynMTsIQLOceWeYGm+3gNs7ZBqb0jR0LSc0WHo12pJEalVryXLlgaQ VWW7roz6V19TakMGfEa7xIZwv0zRwws0L5AY2zW/NKm28KJculdhTuZBcbdjxXB4Slsi 1ZiZws9UdnlhyYDYp9HaVt8VcMmY4Boo9e5mq5/lNYRnvhOz8LafvbH2HcAMMoTl2p2D pyy+UAdaqKf2vKlMw+kcztWR8lDCrGT4/YmEw/5eJzw7aM8MXBa2ZqKCvZm0FB6ZD6SZ yvjw== X-Gm-Message-State: AOJu0YxgDWH//MUgGfXCZjFLFybDjHmny3d0Y59I2OPZfPYJmd4gBICK oJmrmVBf5lOF1tWqojYCmckNIZRCU/LqYnvYgYVKonII3Uc16/ff/ufZVw== X-Gm-Gg: ASbGncukN6huk8uMjk7qmPbSVYkGsxTwKwBR+Lhw9ertDcA3H+s+T6yPOwcAP6Bu82o 0ukd/6PSgy+zvq5M0qr5SBPb5+DakLVVXbNKsACqRf/oFGYuzcN72c3GE50dMubMFuKHwKFrWiW hCiLCtzGayPuj1ahuepcUVPqrtvn2y00AYdgD5gDdRf66xr48PiRP5Hh5m8oazT5P67WgPyDrNK HlrAYBEbbXIqE8M9/pCv1pJ+5qYHr/klmZBmBuIySkqDn03kVIOb2nXMNwhcPhirSsoMymSg6AG AEpkab+8ZuY6HWOdYc6scb02j25nybcn+soXJHcFhRMxRRpUcDrS+lGyCFtGRw== X-Google-Smtp-Source: AGHT+IGOSDI8Ei+PibZwryNgL66Z3gtz8nE1p7snF3kYYqcrSeTSYOemCLiMBpklMR2eWCqvTFH1TA== X-Received: by 2002:a05:6a20:ce45:b0:1f5:839e:ecdd with SMTP id adf61e73a8af0-20bd6656f39mr3792288637.9.1746110651801; Thu, 01 May 2025 07:44:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 07:44:11 -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:18 +0800 Message-ID: <20250501144324.958-20-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 20/23] avcodec/vvc/intra: make lmcs_scale_chroma inplace 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 prepare for adaptive color transform Signed-off-by: Wu Jianhua --- libavcodec/vvc/dsp.h | 2 +- libavcodec/vvc/intra.c | 5 ++--- libavcodec/vvc/intra_template.c | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libavcodec/vvc/dsp.h b/libavcodec/vvc/dsp.h index fa1387aadd..ae22900931 100644 --- a/libavcodec/vvc/dsp.h +++ b/libavcodec/vvc/dsp.h @@ -106,7 +106,7 @@ struct VVCLocalContext; typedef struct VVCIntraDSPContext { void (*intra_cclm_pred)(const struct VVCLocalContext *lc, int x0, int y0, int w, int h); - void (*lmcs_scale_chroma)(struct VVCLocalContext *lc, int *dst, const int *coeff, int w, int h, int x0_cu, int y0_cu); + void (*lmcs_scale_chroma)(struct VVCLocalContext *lc, int *coeff, int w, int h, int x0_cu, int y0_cu); void (*intra_pred)(const struct VVCLocalContext *lc, int x0, int y0, int w, int h, int c_idx); void (*pred_planar)(uint8_t *src, const uint8_t *top, const uint8_t *left, int w, int h, ptrdiff_t stride); void (*pred_mip)(uint8_t *src, const uint8_t *top, const uint8_t *left, int w, int h, ptrdiff_t stride, diff --git a/libavcodec/vvc/intra.c b/libavcodec/vvc/intra.c index 3db3347d8c..b5842a93d1 100644 --- a/libavcodec/vvc/intra.c +++ b/libavcodec/vvc/intra.c @@ -495,7 +495,6 @@ static void itransform(VVCLocalContext *lc, TransformUnit *tu, const int tu_idx, const VVCSH *sh = &lc->sc->sh; const CodingUnit *cu = lc->cu; const int ps = fc->ps.sps->pixel_shift; - DECLARE_ALIGNED(32, int, temp)[MAX_TB_SIZE * MAX_TB_SIZE]; for (int i = 0; i < tu->nb_tbs; i++) { TransformBlock *tb = &tu->tbs[i]; @@ -540,10 +539,10 @@ static void itransform(VVCLocalContext *lc, TransformUnit *tu, const int tu_idx, fc->vvcdsp.itx.pred_residual_joint(jcbcr->coeffs, tb->coeffs, tb->tb_width, tb->tb_height, c_sign, shift); } if (chroma_scale) - fc->vvcdsp.intra.lmcs_scale_chroma(lc, temp, coeffs, w, h, cu->x0, cu->y0); + fc->vvcdsp.intra.lmcs_scale_chroma(lc, coeffs, w, h, cu->x0, cu->y0); // TODO: Address performance issue here by combining transform, lmcs_scale_chroma, and add_residual into one function. // Complete this task before implementing ASM code. - fc->vvcdsp.itx.add_residual(dst, chroma_scale ? temp : coeffs, w, h, stride); + fc->vvcdsp.itx.add_residual(dst, coeffs, w, h, stride); } } } diff --git a/libavcodec/vvc/intra_template.c b/libavcodec/vvc/intra_template.c index 440ac5b6cc..3ec6c72213 100644 --- a/libavcodec/vvc/intra_template.c +++ b/libavcodec/vvc/intra_template.c @@ -428,7 +428,7 @@ static int FUNC(lmcs_derive_chroma_scale)(VVCLocalContext *lc, const int x0, con } // 8.7.5.3 Picture reconstruction with luma dependent chroma residual scaling process for chroma samples -static void FUNC(lmcs_scale_chroma)(VVCLocalContext *lc, int *dst, const int *coeff, +static void FUNC(lmcs_scale_chroma)(VVCLocalContext *lc, int *coeff, const int width, const int height, const int x0_cu, const int y0_cu) { const int chroma_scale = FUNC(lmcs_derive_chroma_scale)(lc, x0_cu, y0_cu); @@ -438,11 +438,10 @@ static void FUNC(lmcs_scale_chroma)(VVCLocalContext *lc, int *dst, const int *co const int c = av_clip_intp2(*coeff, BIT_DEPTH); if (c > 0) - *dst = (c * chroma_scale + (1 << 10)) >> 11; + *coeff = (c * chroma_scale + (1 << 10)) >> 11; else - *dst = -((-c * chroma_scale + (1 << 10)) >> 11); + *coeff = -((-c * chroma_scale + (1 << 10)) >> 11); coeff++; - dst++; } } } -- 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".