From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id DBE094D3F0
	for <ffmpegdev@gitmailbox.com>; Thu, 17 Apr 2025 23:56:22 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E000687DE9;
	Fri, 18 Apr 2025 02:56:03 +0300 (EEST)
Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com
 [209.85.218.45])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 07183687DD1
 for <ffmpeg-devel@ffmpeg.org>; Fri, 18 Apr 2025 02:55:57 +0300 (EEST)
Received: by mail-ej1-f45.google.com with SMTP id
 a640c23a62f3a-ac3fcf5ab0dso215170366b.3
 for <ffmpeg-devel@ffmpeg.org>; Thu, 17 Apr 2025 16:55:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744934156; x=1745538956; 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=NIFZmXlNyFJLMSmub8atsr/pItEwGCeG1sPnNFiEPvQ=;
 b=aBlzl1grmGcAUUpp8PxsxCjL1BEMdXmATpR3lWJZl7RLUaehMGKzj4KXvZltQLZFfP
 C5z6rimCTQHYNeHZjqR4NW4Anpaj5tKG8bgVv08K/xAL2mUWIYnz9KpL+Tsj3f6dfTiZ
 KWtG2EjctPjTE01Qzg78XAIQOo7WxSdkti6sDQFfRqPNRoC24px/FoBADPrY+McXtvbQ
 0lzeVMvGeP8tFTDhv8jnFPFTSOPqFGO9cL0jPDTVpp+3CeXElWm156IRDujYSbF0uov2
 88E3yAiOKw9Cp7duVhWaE0h4ywZTTo/FttDyXVGHUeSKvvIXIkzzUJbOl9/5zMfKsc2M
 xMIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744934156; x=1745538956;
 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=NIFZmXlNyFJLMSmub8atsr/pItEwGCeG1sPnNFiEPvQ=;
 b=jjbyVxyVJR8wWNaM5mgv9Nzd7I/HkKxPHkqirqDxPdc19pPX1ITmTjLrMG+bqgMnNa
 EFgJRbRCdsEblTy2Ha5T8xj7tBUSS7Os+DQ3ZZyJhchttMGyWFA+Tux3v42xr4JRcEJx
 ul+uEtNBCuKjPqfH3ngUZzdYY/ZZCR0sxHSRbBer/d4pOZ5mspagKdJKaP4ye3m6kOXt
 nEjRCaN52GDVj7mBhd9WERiTsLRzJ1Acls+NYFKJONKcpMlIiWsqFwMOx0EpKPG7NkGR
 ZpzWiP03m4NtMHuZeyoPgLVDMHcXLwy+xhIqtZM6DObaM7qAEaEk+UF3J0ati9lSELSh
 rwYg==
X-Gm-Message-State: AOJu0YxOHMeJ8tz7PQnoxyBPoaXyw6Lrdj+WouXPj4zeStdfjpOAUG66
 oG+wDxVnDI0sfBTqW4ciJ8c6naJHfB64bJBwlglEWLyStV1DhAbFzX0fXB8c
X-Gm-Gg: ASbGncsLycddsaQgisDGSHS3dScrpLyZpnHJagQ015GTJhVRMO8GbMk3GptdA8M9XHZ
 6BIdVFWHowEQ6o17FGU4NVVB0W0zhOcD2cSDKIr8tGGT5oxrD5LaBMBgqiF3nX/vXXmewnzPg/g
 BBqpbD6RN7SMHJYFh3UD+XAiuV+DAZ4bnMO/GR8c8LoHEDuXdTKVW2xw/cU1qcq8lL8hx8e5Rg4
 C3YnCabWtGXfYge2YT+/pYuN/O28xSmhAYHq58FSs21w+6pkgX6qjJOuMRgtigX3vNQZ+odAH/j
 DGQNnOK3LcwIjJDce9qD0XEJPxrnxyanCWHUIR0LSj1dTdeEIALliBMehFS3QEV2/ZzxWJaTBX3
 8xymybjetTSznnl8UKV0HOQScXLmTbF8wd709wTKiAOil7Q==
X-Google-Smtp-Source: AGHT+IHIcIut0AwvN5f3dKFTOBXVdGI48r9RD79LhpO9SOTu17fuLLmV+RUhxS6vdw2rB+fETRZp7w==
X-Received: by 2002:a17:907:1ca0:b0:ac7:150b:57b2 with SMTP id
 a640c23a62f3a-acb74db61d8mr52458266b.41.1744934155804; 
 Thu, 17 Apr 2025 16:55:55 -0700 (PDT)
Received: from localhost.localdomain (adsl-135.91.140.30.tellas.gr.
 [91.140.30.135]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-acb6eefcf97sm50763566b.88.2025.04.17.16.55.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 17 Apr 2025 16:55:55 -0700 (PDT)
From: IndecisiveTurtle <geoster3d@gmail.com>
X-Google-Original-From: IndecisiveTurtle
 <47210458+raphaelthegreat@users.noreply.github.com>
To: ffmpeg-devel@ffmpeg.org
Date: Fri, 18 Apr 2025 02:55:30 +0300
Message-ID: <20250417235543.227108-3-47210458+raphaelthegreat@users.noreply.github.com>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <20250417235543.227108-1-47210458+raphaelthegreat@users.noreply.github.com>
References: <20250417235543.227108-1-47210458+raphaelthegreat@users.noreply.github.com>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH v3 3/5] libavcodec/vc2enc: Pass quant array
 as argument to init function
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: IndecisiveTurtle <geoster3d@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250417235543.227108-3-47210458+raphaelthegreat@users.noreply.github.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: IndecisiveTurtle <geoster3d@gmail.com>

---
 libavcodec/vc2enc.c        |  2 +-
 libavcodec/vc2enc_common.c | 18 +++++++++---------
 libavcodec/vc2enc_common.h |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 2e849eb09e..c0f542e116 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -160,7 +160,7 @@ static int calc_slice_sizes(VC2EncContext *s)
     SliceArgs *enc_args = s->slice_args;
     SliceArgs *top_loc[SLICE_REDIST_TOTAL] = {NULL};
 
-    vc2_init_quant_matrix(s);
+    vc2_init_quant_matrix(s, s->quant);
 
     for (slice_y = 0; slice_y < s->num_y; slice_y++) {
         for (slice_x = 0; slice_x < s->num_x; slice_x++) {
diff --git a/libavcodec/vc2enc_common.c b/libavcodec/vc2enc_common.c
index 7452e9fd8a..fdcb04d8dd 100644
--- a/libavcodec/vc2enc_common.c
+++ b/libavcodec/vc2enc_common.c
@@ -293,17 +293,17 @@ static const uint8_t vc2_qm_flat_tab[][4] = {
     { 0,  0,  0,  0}
 };
 
-void vc2_init_quant_matrix(VC2EncContext *s)
+void vc2_init_quant_matrix(VC2EncContext *s, int quant[MAX_DWT_LEVELS][4])
 {
     int level, orientation;
 
     if (s->wavelet_depth <= 4 && s->quant_matrix == VC2_QM_DEF) {
         s->custom_quant_matrix = 0;
         for (level = 0; level < s->wavelet_depth; level++) {
-            s->quant[level][0] = ff_dirac_default_qmat[s->wavelet_idx][level][0];
-            s->quant[level][1] = ff_dirac_default_qmat[s->wavelet_idx][level][1];
-            s->quant[level][2] = ff_dirac_default_qmat[s->wavelet_idx][level][2];
-            s->quant[level][3] = ff_dirac_default_qmat[s->wavelet_idx][level][3];
+            quant[level][0] = ff_dirac_default_qmat[s->wavelet_idx][level][0];
+            quant[level][1] = ff_dirac_default_qmat[s->wavelet_idx][level][1];
+            quant[level][2] = ff_dirac_default_qmat[s->wavelet_idx][level][2];
+            quant[level][3] = ff_dirac_default_qmat[s->wavelet_idx][level][3];
         }
         return;
     }
@@ -314,21 +314,21 @@ void vc2_init_quant_matrix(VC2EncContext *s)
         for (level = 0; level < s->wavelet_depth; level++) {
             for (orientation = 0; orientation < 4; orientation++) {
                 if (level <= 3)
-                    s->quant[level][orientation] = ff_dirac_default_qmat[s->wavelet_idx][level][orientation];
+                    quant[level][orientation] = ff_dirac_default_qmat[s->wavelet_idx][level][orientation];
                 else
-                    s->quant[level][orientation] = vc2_qm_col_tab[level][orientation];
+                    quant[level][orientation] = vc2_qm_col_tab[level][orientation];
             }
         }
     } else if (s->quant_matrix == VC2_QM_COL) {
         for (level = 0; level < s->wavelet_depth; level++) {
             for (orientation = 0; orientation < 4; orientation++) {
-                s->quant[level][orientation] = vc2_qm_col_tab[level][orientation];
+                quant[level][orientation] = vc2_qm_col_tab[level][orientation];
             }
         }
     } else {
         for (level = 0; level < s->wavelet_depth; level++) {
             for (orientation = 0; orientation < 4; orientation++) {
-                s->quant[level][orientation] = vc2_qm_flat_tab[level][orientation];
+                quant[level][orientation] = vc2_qm_flat_tab[level][orientation];
             }
         }
     }
diff --git a/libavcodec/vc2enc_common.h b/libavcodec/vc2enc_common.h
index 40c9ff85b5..b049fe5974 100644
--- a/libavcodec/vc2enc_common.h
+++ b/libavcodec/vc2enc_common.h
@@ -185,7 +185,7 @@ av_cold void vc2_init_static_data(void);
 
 void put_vc2_ue_uint(PutBitContext *pb, uint32_t val);
 
-void vc2_init_quant_matrix(VC2EncContext *s);
+void vc2_init_quant_matrix(VC2EncContext *s, int quant[MAX_DWT_LEVELS][4]);
 
 void vc2_encode_parse_info(VC2EncContext *s, enum DiracParseCodes pcode);
 
-- 
2.49.0

_______________________________________________
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".