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 20D354BA0B for ; Thu, 1 May 2025 14:46:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E58D068B92B; Thu, 1 May 2025 17:44:05 +0300 (EEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E6ECF68B5E2 for ; Thu, 1 May 2025 17:43:59 +0300 (EEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-7376dd56f8fso1474999b3a.2 for ; Thu, 01 May 2025 07:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746110638; x=1746715438; 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=F8mj20yjW99yAHtu8SG9rsz+E1pGv42ZmjOpZ9xByOo=; b=Nt0/9EouCOKCmzwaQwOx8zz0prqzrKK9DzGVg9HidTep76g2vYNbpNGjJQk1wS6eEv lRfTJrdN5dizS+MeovE1LN61Ig/yB42BnuIHbSFK4cw/ugSCwFiTIW5OSmMZ4RpgaGoG Ol+OePhlN6Ier6AhMgyszwDv9yT+JjwADzGblzUe4AochGCvnofcGqmZEH2iDUe7gULP 7FY+3cszOppJO0AyMTxrkAvo9kragOo+76vHqcpLjjaNRdJpWGx4+6L3tNmgBYBnnujH imXPfWkdjDGc+jZ8gunVap2s2DZeJ3J04Ch3KK7OvbS2sSE9EnMzVtspGpiYu0o1oq7/ 6vJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746110638; x=1746715438; 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=F8mj20yjW99yAHtu8SG9rsz+E1pGv42ZmjOpZ9xByOo=; b=mvDcujhrKc0ELEY4F+RakgmC9Ug25nOueKCMypaLMQbUe3xUiGBOWcb2ED/19cpLrq u/MOq8yxHCRYx9OT393ZPalirW7uYIq2CAZF0GHCsi10q5Rflz1NlS0p8qd1QKy4lA1n Z6nIGZhBOiBZL0xreUDP5ZXtfZUKjp8chvF6xQq5VwDOelFMU+/1n5FLcxFv6vxGk7Zi kHjXqHqENdvcxyfVu39QGA3WgpcsQ+abPjs8aYJkCWcZkyCO5/ITgwVrLpm+Rr2FgfHX HpU+TtuyD9XbufXn30V4g9uanpsjyYKCszJRrvHNzHgeTd9HVHlGZl2HtKZZ4ME1k3hl Ajfg== X-Gm-Message-State: AOJu0Yzbt5qCOByghfVBFKYVNJs5+pMd9mXo2oeJPf1qZZ1ulqXe96cE xOwhQyG4wsXXMYIz/953dfgsibtOyMg4fK9O3B9tLLZ+czHRHr70Qo+OHg== X-Gm-Gg: ASbGnctqz6pc3/CAgZ98CBKF7VlMP9NsDxTIEXumSeiukv4S9Ejpl8i+Cabc0QorKDN m93aahSvH/FhoqumbR4JLj6d02ROPeEOrf7kkoc8D9KPn8U93DhgZT4h03cTXY1daqkCfhBX0k7 J5me+wgSm69WqSATrTO6a84xQo9biyBEPuGiVpHEXgWsM2S64kuK0MjGTUHPddRtSrauACinaWA 4Cjr+9yQAHmT6cbqYrmvWWTRt3PrIiMQJk7i/RYA5Tf84X6PXZ5WxAKPxnG30w9Oz5fane6kkL1 psXLTFEYBkLi+LKMN6I8bDi13fYJweCJEqCW2SSS6gbJuyUD0vcVBuCdm140j7snWko1ng83 X-Google-Smtp-Source: AGHT+IE6H65nXXepYfsP8qaTUK2C/cYN7o9TdYzNAzAJa/vTS5Tdz3BG3P8MQSnRk2LZ+LpZ8+21rw== X-Received: by 2002:a05:6a00:3c96:b0:736:a8db:93b8 with SMTP id d2e1a72fcca58-7404775cdc7mr5141289b3a.3.1746110638010; Thu, 01 May 2025 07:43:58 -0700 (PDT) Received: from localhost.localdomain ([124.79.129.75]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b1f9d4b68e8sm807271a12.27.2025.05.01.07.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 07:43:57 -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:10 +0800 Message-ID: <20250501144324.958-12-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 12/23] avcodec/vvc/intra: add palette coding decoder 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 Introduction at https://ieeexplore.ieee.org/document/9408666 passed files: 10b422_G_Sony_5.bit 10b422_H_Sony_5.bit 10b422_I_Sony_5.bit 10b422_J_Sony_5.bit 10b422_K_Sony_5.bit 10b422_L_Sony_5.bit 8b422_G_Sony_5.bit 8b422_H_Sony_5.bit 8b422_I_Sony_5.bit 8b422_J_Sony_5.bit 8b422_K_Sony_5.bit 8b422_L_Sony_5.bit 8b444_A_Kwai_2.bit 8b444_B_Kwai_2.bit PALETTE_A_Alibaba_2.bit PALETTE_B_Alibaba_2.bit PALETTE_C_Alibaba_2.bit PALETTE_D_Alibaba_2.bit PALETTE_E_Alibaba_2.bit Signed-off-by: Wu Jianhua --- libavcodec/vvc/intra.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libavcodec/vvc/intra.c b/libavcodec/vvc/intra.c index 2e1703e234..7f772fa4ae 100644 --- a/libavcodec/vvc/intra.c +++ b/libavcodec/vvc/intra.c @@ -670,6 +670,27 @@ int ff_vvc_palette_derive_scale(VVCLocalContext *lc, const TransformUnit *tu, Tr return level_scale[0][rem6[qp]] << div6[qp]; } +// 8.4.5.3 Decoding process for palette mode +static void vvc_predict_palette(VVCLocalContext *lc) +{ + const VVCFrameContext *fc = lc->fc; + const CodingUnit *cu = lc->cu; + TransformUnit *tu = cu->tus.head; + const VVCSPS *sps = fc->ps.sps; + const int ps = sps->pixel_shift; + + for (int i = 0; i < tu->nb_tbs; i++) { + TransformBlock *tb = &tu->tbs[i]; + const int c_idx = tb->c_idx; + const int w = tb->tb_width; + const int h = tb->tb_height; + const ptrdiff_t stride = fc->frame->linesize[c_idx]; + uint8_t *dst = POS(c_idx, cu->x0, cu->y0); + + av_image_copy_plane(dst, stride, (uint8_t*)tb->coeffs, w << ps, w << ps, h); + } +} + int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const int ry) { const VVCFrameContext *fc = lc->fc; @@ -690,6 +711,8 @@ int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const in ff_vvc_predict_ciip(lc); else if (cu->pred_mode == MODE_IBC) vvc_predict_ibc(lc); + else if (cu->pred_mode == MODE_PLT) + vvc_predict_palette(lc); if (cu->coded_flag) { ret = reconstruct(lc); } else { -- 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".