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 ESMTP id 5AD7245882 for ; Fri, 24 Feb 2023 13:33:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8E5E568C12F; Fri, 24 Feb 2023 15:33:49 +0200 (EET) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D514D68BFC6 for ; Fri, 24 Feb 2023 15:33:42 +0200 (EET) Received: by mail-ot1-f41.google.com with SMTP id cc12-20020a05683061cc00b00693daa9016fso1429112otb.2 for ; Fri, 24 Feb 2023 05:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=ES0hxJH5b7TGkYw5cr3atZeMDxma247uRK08nJfUwcs=; b=L+1RTYKCyvVv4jVAMtCdwbVHgJoblvg35E34vA0pvCBe3zYpviVF+sV9VGXHNNklgv BANCb8xc7M1zYVXUPyP12jgqNZbDe/dJGO2w9NCPx3K6IYlhr74DTmiqFpdsberEi8eA bNUMEktWmEWuLDt4P4yGq9bc2M7zhTL/vHkrOI4MoWsHE8GkuB8j2+O2HbeLVuVt4YQe hQLpVD5fdSllMFL8DLANAv3KsJDMJZfyGWTxiX1MO86GqK5Y3urrKbk5AuHH1wsnxam5 gv8yvgUB701OY47j7CPFSKV4U3HdkFGx0aWk7OPZD/0mjYoQ2+TtJuBFDQBvTjPjaThq RB2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ES0hxJH5b7TGkYw5cr3atZeMDxma247uRK08nJfUwcs=; b=WfBPfhp4IzKl8//Cxt2nDhPsgU4+mKedVjFm8nHSZoSAXhM2cYtBULRglLh56HIJFJ feKJUSlKXvqBUecqS2CzSV+Xs6K19ZSGwXVWOyhula+5HYA5XqRlwj5/Iqvduxdq6JV6 CulDV4KZjxejt3gRpqf9E+9ELrcfQsnazfMICQUReQc4SK8ExSsNPeH/ZedzXLQup+rs 5WvZ/VLv7Nm2i6wzwKI56bPpygPHvtGuEAt3prnXze3jaIbA4CikZNNANpN6/JLgsLQT f6nerZfgSZbcqJqEEMzEulgNqiSxOkV2cKM71wQ+0yUYKdIMSDJp+b31yFWcdDqkFYCi AxFQ== X-Gm-Message-State: AO0yUKX4JNYbY3MU5UHnQOrlvza5ai0XicmB79K+nAlgfMpL1nZGR3hJ H3HL6cmd/j7M0FcOyaLV9b2bm1WAZsA= X-Google-Smtp-Source: AK7set9aycTNPywzfSoFdtL3CIOkOjz0P4QSxPzjl1XeWkuP0cIIZAYEH6CF/HM/C66YKnHgAw8weQ== X-Received: by 2002:a9d:62f:0:b0:68b:cb5c:8e1 with SMTP id 44-20020a9d062f000000b0068bcb5c08e1mr7619071otn.13.1677245620795; Fri, 24 Feb 2023 05:33:40 -0800 (PST) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id l19-20020a9d7093000000b0068663820588sm4509844otj.44.2023.02.24.05.33.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 05:33:39 -0800 (PST) Message-ID: <8bf59545-b8a1-bd88-f83c-ba0db7ee6f04@gmail.com> Date: Fri, 24 Feb 2023 10:33:38 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: ffmpeg-devel@ffmpeg.org References: <20230224210848.535436-1-quinkblack@foxmail.com> Content-Language: en-US From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 2/9] avcodec/dynamic_hdr_vivid: fix three spline params 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2/24/2023 6:08 PM, Zhao Zhili wrote: > From: Zhao Zhili > > Signed-off-by: Zhao Zhili > --- > libavcodec/dynamic_hdr_vivid.c | 34 +++++++++++++++++++++++----------- > 1 file changed, 23 insertions(+), 11 deletions(-) > > diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c > index d689669dec..35be6f5e2b 100644 > --- a/libavcodec/dynamic_hdr_vivid.c > +++ b/libavcodec/dynamic_hdr_vivid.c > @@ -98,26 +98,38 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t > return AVERROR_INVALIDDATA; > tm_params->three_Spline_enable_flag = get_bits(gb, 1); > if (tm_params->three_Spline_enable_flag) { > + AVHDRVivid3SplineParams *three_spline; > + > if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1)) > return AVERROR_INVALIDDATA; > tm_params->three_Spline_num = get_bits(gb, 1) + 1; > + if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_spline)) > + return AVERROR_INVALIDDATA; > for (int j = 0; j < tm_params->three_Spline_num; j++) { > - tm_params->three_Spline_TH_mode = get_bits(gb, 2); > - if (tm_params->three_Spline_TH_mode == 0 || tm_params->three_Spline_TH_mode == 2) { > + three_spline = tm_params->three_spline + j; Preferably do: three_spline = &tm_params->three_spline[j]; > + three_spline->th_mode = get_bits(gb, 2); > + if (three_spline->th_mode == 0 || three_spline->th_mode == 2) { > if (get_bits_left(gb) < 8) > return AVERROR_INVALIDDATA; > - tm_params->three_Spline_TH_enable_MB = (AVRational){get_bits(gb, 8), 255}; > + three_spline->th_enable_mb = (AVRational){get_bits(gb, 8), 255}; > } > - tm_params->three_Spline_TH_enable = (AVRational){get_bits(gb, 12), 4095}; > - tm_params->three_Spline_TH_Delta1 = (AVRational){get_bits(gb, 10), 1023}; > - tm_params->three_Spline_TH_Delta2 = (AVRational){get_bits(gb, 10), 1023}; > - tm_params->three_Spline_enable_Strength = (AVRational){get_bits(gb, 8), 255}; > + three_spline->th_enable = (AVRational){get_bits(gb, 12), 4095}; > + three_spline->th_delta1 = (AVRational){get_bits(gb, 10), 1023}; > + three_spline->th_delta2 = (AVRational){get_bits(gb, 10), 1023}; > + three_spline->enable_strength = (AVRational){get_bits(gb, 8), 255}; > } > - } else { > - tm_params->three_Spline_num = 1; > - tm_params->three_Spline_TH_mode = 0; > +#if FF_API_HDR_VIVID_THREE_SPLINE > + three_spline = tm_params->three_spline; Also here: three_spline = &tm_params->three_spline[0]; Same in every other case in this patchset. > + AV_NOWARN_DEPRECATED( This is an internal file, so use the FF_DISABLE_DEPRECATION_WARNINGS and FF_ENABLE_DEPRECATION_WARNINGS wrappers instead of the public one. > + tm_params->three_Spline_TH_mode = three_spline->th_mode; > + tm_params->three_Spline_TH_enable_MB = three_spline->th_enable_mb; > + tm_params->three_Spline_TH_enable = three_spline->th_enable; > + tm_params->three_Spline_TH_Delta1 = three_spline->th_delta1; > + tm_params->three_Spline_TH_Delta2 = three_spline->th_delta2; > + tm_params->three_Spline_enable_Strength = three_spline->enable_strength; > + ) > +#endif > } > - > } > } > } _______________________________________________ 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".