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 1F83E4EE77 for ; Wed, 14 May 2025 13:44:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2E83B68C7D0; Wed, 14 May 2025 16:41:23 +0300 (EEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D25FA68C726 for ; Wed, 14 May 2025 16:41:15 +0300 (EEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7390d21bb1cso6824125b3a.2 for ; Wed, 14 May 2025 06:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747230074; x=1747834874; 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=Pjk38CXFmw4oEgvojNMGqznUfYR42Mf9laJlqqRrYSK3T5++yoFQqvVzEAXI5Qp9F2 ke3gOxwYXKJvyyRT94S3GKp6meVFxbzVe7jmwIhQ92f4YCB4HY7x8px3yuB2pgMe0enO 1Y7LbsEhyml9nGjsg37qwH2XYpBeOCwhs7joUt/p3zIa5BFmWBjBWZU82u/wTGxhtv2r vvHX15yqDlL4H/YcdQ8i7oz6tR+xY1Ybpil6P1ybH3AhKdk3EXaqHWuQyLIGNQvN1hcC dNXo/3Vcc0m2MkjYouUkrRKYI7chMyakWMAhZZN+bOQTHB3UgmHQknjdZBUcF1+rNU2y ad1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747230074; x=1747834874; 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=cmz+myrLJ0opMjlXhZx6kdtmhTWbWo6I2emKFlApRZc0mnWlL1ZjBTc6Q/SMHRriWJ XLZV+8C5oUyygaAs1yKZaAcxe3ZmYeS/5gwPbH9iokDG+9yaPTlSQMuwmiMbGk3eGuZW ZLX7MeBZbvUwsx7wNuMMSLoQsU5JKzhWZPGMiG7GAxy04bX0W3B4PpVhu0dH3JOh/GzT iR+zcj6+0RFClJlGsnvwrQl0aZIi2+psUMlogPz2nniF3Ep8mYZ/R9TDMi3IOPcqDhie 5++kaLfP/+bgAo+fNorngp4Ory0dxjUNy+WLlxQdukBSexh8GXYY9drgjE3NPLWvgjWR bYKg== X-Gm-Message-State: AOJu0Yxk9Z2BlbFA3BQI3LJnqkZOKZZzY2yOulXxsfJhSTQOEYAXfz8r jb/KEDuq5pjngsKSgNSFXNu6yP2hV1lSA1gVrRX8WllrP49o4Ua6KqUXkKri X-Gm-Gg: ASbGncubtvApM3bnzNcNT/3CuJ3G6W+kr/jw3CzYljRRK/yWsUTY4eyh4uBWlWCC91F JnMfw6q2qXfNv/wFoXfPwomI61CbwiKc8jSV+jTQZGC3QVwhDY+ia6lH44hRGqdexE0u3Qk7yrU NBuvTWUFz4+Xk30VddeZ+yMKZ58i10qF+LEUxT1fzaOAwtsj3d3NQiaw2/8Pn7e7hjlyHZTvK2T H0miAs1jieyek3f7mSTMFsbfiTqSre1iVgfS44XJNl6UJnzLoRMFGzUmGvBmqM8b6/naQ7rJSoh HnAASaJS+3YgKsdlmIKDB1AM41ZPGDwJeNi84dTlenm2WQO8wXvkhGdLeZHLZWbU+7xs23yg X-Google-Smtp-Source: AGHT+IGojgxf8g0v8JOMtaRTDb7VFMZLDtdEfo7fxdzOETmIbhNMMeSQbTcS2yBGJLym4humNVuQhw== X-Received: by 2002:a05:6a20:4393:b0:215:e9ec:81d2 with SMTP id adf61e73a8af0-215ff19ea8emr5836730637.32.1747230073843; Wed, 14 May 2025 06:41:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 May 2025 06:41:13 -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:27 +0800 Message-ID: <20250514134031.1584-20-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 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".