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 EAB0D44204 for ; Fri, 2 Dec 2022 01:52:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1716268BA81; Fri, 2 Dec 2022 03:52:24 +0200 (EET) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E42868A407 for ; Fri, 2 Dec 2022 03:52:17 +0200 (EET) Received: by mail-ot1-f54.google.com with SMTP id p24-20020a0568301d5800b0066e6dc09be5so2115596oth.8 for ; Thu, 01 Dec 2022 17:52:17 -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:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=sHl6YITZsJhrECNo5LWJSksYVI7rsaI6aVc2Uw17fGo=; b=b/44GuLMjUG0OkItfig2yKJA7nCUp2Yj4zqKnstatH8gfYT3ADSadUnt+zmOrDmDdv dKOh/zmErn3GWzcpsDlVS7uU7Zf7rl7KYkT/hmingguPMJdeyQHzRWM/uWNniiqhXm8I yuchO9CjqinCk9lmMEAmXyQ/AR3719bD06SxLMFTIEeylGu1Mq8DI8qtJ84DVYPwTmwt kFnne4ayONkcJgk/9WpasmgszeyLWD+cN/aklStxNxCgvI4x9NnxvexI7hBsKrcvwjHL ekvgVpZh2ne8RmNJCdhrR0ndei+oK/txezDiSp4RBhZjbmS1UjixrTg66EjCOgf0ItfH oipQ== 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:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sHl6YITZsJhrECNo5LWJSksYVI7rsaI6aVc2Uw17fGo=; b=7650r/vJn0rESyyM/dzeWBpfMCjoDbcW7puGclyUI9j/8SnD9mLt/CqTFZfPjZOOru oxo+8JohzDaEcrvz9xmT2jmLHvSZ9hML2Ktl8VDjwGhvaRscBQNiiMjxzI2f0HTzM1jo 4QFgEuQMeoHfhPOdOmmFXeP/LtoCPaG2JuImG4xq6g2loXj8yGo+bseWHLgdIjv7nV57 Yc/BnXYQTwYbLrxETbzJOD8TET/iAyTQ9e14TZb21JdsOI4QuyvBB/eDL0A7AzZs0zPG V5ACvgNl4e3pYCdwMCaH1HAWNk2OBMqVk7U5SJaqbS4AhqEiEsaPZMrGyS725joX+ucd YSYA== X-Gm-Message-State: ANoB5pm8d+aNsW9LNqyaq/CC2RrgiH4eZKFcjyVBQzxKhIqb6gyONRM1 2vCzqnq+cWQW359vgrSQLxhPyH0aK8Y= X-Google-Smtp-Source: AA0mqf4dQfLjD9jzCnkSsa4hJX3MC0CEYqKQjXQaLweAgEsG0LWmzXoCztCWp5zsF6D1501JqILV7A== X-Received: by 2002:a05:6830:1d94:b0:655:cda4:b46a with SMTP id y20-20020a0568301d9400b00655cda4b46amr33240910oti.262.1669945935648; Thu, 01 Dec 2022 17:52:15 -0800 (PST) Received: from [192.168.0.15] ([181.85.72.69]) by smtp.gmail.com with ESMTPSA id q23-20020a4adc57000000b0049fda92594asm2429168oov.23.2022.12.01.17.52.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 17:52:15 -0800 (PST) Message-ID: <53dede11-325c-9b58-e447-420c6b470044@gmail.com> Date: Thu, 1 Dec 2022 22:52:15 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20221201081408.2194579-1-fei.w.wang@intel.com> <20221201081408.2194579-3-fei.w.wang@intel.com> From: James Almer In-Reply-To: <20221201081408.2194579-3-fei.w.wang@intel.com> Subject: Re: [FFmpeg-devel] [PATCH v1 03/13] lavc/hevc_ps: Add SPS/PPS parse support for HEVC extension syntax 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 12/1/2022 5:13 AM, Fei Wang wrote: > +static void colour_mapping_octants(GetBitContext *gb, HEVCPPS *pps, int inp_depth, > + int idx_y, int idx_cb, int idx_cr, int inp_length) > +{ > + uint8_t split_octant_flag, coded_res_flag; > + uint16_t part_num_y, res_coeff_q, res_coeff_r; Use int or unsigned for scalar values in stack. > + int bit_depth_cm_input_y, bit_depth_cm_output_y, cm_res_bits; > + int k, m, n, c, i, j; You can reduce the scope of almost all the above variables. > + > + part_num_y = 1 << pps->cm_y_part_num_log2; > + > + if (inp_depth < pps->cm_octant_depth) > + split_octant_flag = get_bits1(gb); > + > + if (split_octant_flag) split_octant_flag may be undefined here. It should be initialized to 0. This is probably the source of the issue Michael reported. > + for (k = 0; k < 2; k++) for (int k = 0...) Same for the rest. > + for (m = 0; m < 2; m++) > + for (n = 0; n < 2; n++) > + colour_mapping_octants(gb, pps, inp_depth + 1, > + idx_y + part_num_y * k * inp_length / 2, > + idx_cb + m * inp_length / 2, > + idx_cr + n * inp_length / 2, > + inp_length / 2); > + else > + for (i = 0; i < part_num_y; i++) { > + for (j = 0; j < 4; j++) { > + coded_res_flag = get_bits1(gb); > + if (coded_res_flag) > + for (c = 0; c < 3; c++) { > + res_coeff_q = get_ue_golomb_long(gb); > + bit_depth_cm_input_y = 8 + pps->luma_bit_depth_cm_input_minus8; > + bit_depth_cm_output_y = 8 + pps->luma_bit_depth_cm_output_minus8; > + cm_res_bits = FFMAX(0, 10 + bit_depth_cm_input_y - bit_depth_cm_output_y - > + pps->cm_res_quant_bits - (pps->cm_delta_flc_bits_minus1 + 1)); > + res_coeff_r = get_bits(gb, cm_res_bits); > + if (res_coeff_q || res_coeff_r) > + skip_bits1(gb); > + } > + } > + } > +} _______________________________________________ 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".