From patchwork Mon Jan 24 20:09:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 33816 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp14874iov; Mon, 24 Jan 2022 12:10:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDKNueXCZ2zcCYhcxXCaxfnFcLcSIYhNlpOh+hEbF7zInyRm49LpCulIEkBs0CUNXxfe2+ X-Received: by 2002:a17:906:b786:: with SMTP id dt6mr13571855ejb.556.1643055002264; Mon, 24 Jan 2022 12:10:02 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z2si11246373edd.605.2022.01.24.12.10.01; Mon, 24 Jan 2022 12:10:02 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=pvQONbJa; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 79E3C68B151; Mon, 24 Jan 2022 22:09:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-oln040092065018.outbound.protection.outlook.com [40.92.65.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06AB668B116 for ; Mon, 24 Jan 2022 22:09:49 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ONLFZ4nlknl+JyrkiQ97LOsX2rBItBCY2TnkcPDHDj2Uq8+qcP6FxHyIfdRYw+NqoWWOYmdDjdt9wdGELx6vXQJl0snHLVRCshQWFa7l2xhE8Fnw7AvZipELkdWeTDZxMJyCwFsieSQicN31yenlSO0D5j1cdtUpkLjxVnXvOj8/7AGMfykw1gQ8CDqLuQgx3wxfslEmBHQ4oYvNK+5z/hYWZ9osy6wU7oQSzMRmmoTxOXxzMI+qqSkPGLJhqKU7X9WcFVk9bSw1DivwNneCe8a20hMmBkDhHuAc0EET1+VK+0TogA+gaHGteecCDP+/XJqWaIL83PCXTKG3DGlHww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=imSfylwGAocJCnAVajs71y+SRD9j4I1swiV/sgW0PG4=; b=Lx+zUs2cjYyv+PHq4H+/iwJnr6O2H3Ow+MyAnMLse9HnEQbdGwNkWPEDziGFfepopKJ7aJJ8NdLxnPoPGgNfqlpG5wQ9BF7O956J/dtnjQt5h8IOUeSod9Ywo+NhLBnHYLhoITwM5n6sNlEWF69hCix5FNcgNV99IIW0P/6nk93Jq3Jz795NUJwXpP9AWSJtmIYHCBKMEBRbOwNTdxtm42KIQlHi/oEE3GL4Wvgzb741n1HhHwnksg6EyYTdIN4o7laDtiNod05sdf50RGuaCNhjqGRKGxXJxo4zKwcEVkuJ00gTbNSZ1cRqiwD96PMhyfkxpjQKldWUtyGHCgxJ4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=imSfylwGAocJCnAVajs71y+SRD9j4I1swiV/sgW0PG4=; b=pvQONbJafK0RB/BJbP+IkWwTxWXryKULzkIKzUKBgjVIcAQSwBdMIdDnzagzFZGH32c0p4T0ycp6JQbjqZmenp8c6Jwcl8TKiJ2nINQJYIfAYJsDgNHS+Al5BaEpjuBe+J1cZjHJj+y7NToe/qCwkYdusrLwcJtk86IrQRCPb+Vp92Dkx8rccbT/v2CiaIGLfstaSqOjjwu0nWeu6YSgpzIRh1nsfDZlvL53Is05oZDX76USRkmD+Xhq7SFSca5ulN/p4oE5CG75JNJ8PJ/XafrLG6TMJ5HUjM89iXOO6Ndso2COme59sLuCSSQW1zny/BZ+HMWn9uHXQsGiL37U1g== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by VI1PR0301MB2557.eurprd03.prod.outlook.com (2603:10a6:800:64::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Mon, 24 Jan 2022 20:09:43 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%4]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 20:09:43 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jan 2022 21:09:16 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220124200931.593079-1-andreas.rheinhardt@outlook.com> References: <20220124200931.593079-1-andreas.rheinhardt@outlook.com> X-TMN: [CQQOoUGdBGN++RiPfPKH9tyLtzfmxcPQ] X-ClientProxiedBy: AS8PR04CA0012.eurprd04.prod.outlook.com (2603:10a6:20b:310::17) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220124200931.593079-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a5e9d5e-b4cc-4239-bf91-08d9df7575d6 X-MS-TrafficTypeDiagnostic: VI1PR0301MB2557:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WlQqSnmGTNR4+IgJNmgTB37ggqGRfID2aIeJBuyfzAMyIClkzFbT+5tIbskBAf2HYlvE3Z7tscOk+WjTn1+01XqZKbCDKcrvwkjqwmC91u7T3s3LWTUpOSHdCXz6MdDLKPvN2BnaPHKXE9tNsslrd+UoY14sR0TE9QDAtbxsW0pmF0agQ3b7k0ugIZDdy+c3fIUO4F+NT2itinezZtNlDWEq3W7nEUjakcsnBmohovF7zh/jbUtZzJQFiD4mPWmiibv5WJIK0Tql++AxjrYRbHC808rx1aWONsQNjwRCjoDOzePpFqPJWwJTWf/ZcNLtOfOY/xY1ixzph4CzGL70iUzW0JAfaWvP2JS4vPpZyn1vzXGFvB6WfIWCjr+A2I31fUf5ZQyK+P+1Hn8aL0C8ccsdpokl7aiYieHEnpYUpbhV7Sm8vI34OhiJHt2JpoukdzcduBTknJ8eqbonyR8JxlgWPAWe/Nl55zvwZ7HW1drEwXkMeoMCuF97GOXfZyOxUTVYrJc2rbSVj867hLxyK1s+I3NWI1z8vz5oLutCeaANyD5i1HLMuEHg+xa2q3gMB+FbUpEz/c0w0BFZZ7WqAQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ntn6014eaYBOxYv3+LqrYJ4T4+I1ni2gFGmEoKlyEBG2hTnpJ8oScpXJ1yRiI06kZOa93kARpzlUh9YK1g32lf+zQxsjTI0FbgIBVSpx3ws5YdSXEynPvcfknnZau136yhcWr7RB7Y8O52JHo4Im2O/4g3cIpZw5eopY+UuxeRaT4tDkBbG4meW6j2uU/ly1+TzT78ROL1wjJ6E2bptvdIwh/158QoByffQ1pn/PH/zeKVf1F+KCOD2pDGhgAilgHgu5puEF+CvXV8qJQHeJKxbQuZDSfGu47ra0gaJ+iazt6IzT8v7tyedKuY7FFZIlojFu+9r3Clpfnc1sxbQOTqdQoMi4wCdDIK+nakqFdgneKPY87wKElShk/lmwxZrU46NsR8GfnEalt4muxvE8NW5h+Ga6KwDpEU377ZfJHpIB5MHW6TOv+0710ey6mcgMGBQfoz7geQORwnSd8K5ZuiQ/qWCn/cZEOAAy3TiImegQJ2ojJvMvpRtVZxLd3gQx47FK3u3nh/8/85UdBs+rinzT0+YpZ/yWi1BEXZw7pJ/QpwfIlV1xFJN6zn70jbVV4GTjSTLM4x6VVCZpKD02XW7o9pmPB5pQZdKSJkhjPg5OH3z9eWnODj4yGqlaK9QrxCseNF10aXMPZbrdKvXr5OjqQJ3N3RZLv9VY44nxoM4HiQY72aViVS+FquptdgTeg3eJ2j4Lw11TMKA+hkweJoDv1vQl03YUJYhXoD3GQ62lxfviwqWxKMJURHM23j2E/T5d4yLsRMO7qOAqzG2znHlNO1Zf7qNvsvrbX72SlLcjHn9dnKY/UaxUySWRCovjLkioKcrThZrcLKt7E0SAOVdFKL/FgIIHyOXi/KRfTSx/OtHeUX9Ia7MOi/jQEUzt2YRUlDe2OqqVQxnUK++nkK7b3dYaAyWBZ37nVi0zsAjP4H0OJVHGpAIB1c2qC7fUQd+CJWRGfTg/tYbK52jAQw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a5e9d5e-b4cc-4239-bf91-08d9df7575d6 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 20:09:43.2842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2557 Subject: [FFmpeg-devel] [PATCH v2 03/18] lavc/h264: replace MAX_MMCO_COUNT with H264_MAX_MMCO_COUNT 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: Anton Khirnov Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: kkU14PqNoNHK From: Anton Khirnov They apparently serve the same purpose; the latter is one larger and has a comment explaining how the value is derived, so seems more trustworthy. --- libavcodec/h264_parser.c | 2 +- libavcodec/h264_refs.c | 2 +- libavcodec/h264dec.h | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 881cab7536..aee7cdb934 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -219,7 +219,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag int i; - for (i = 0; i < MAX_MMCO_COUNT; i++) { + for (i = 0; i < H264_MAX_MMCO_COUNT; i++) { MMCOOpcode opcode = get_ue_golomb_31(gb); if (opcode > (unsigned) MMCO_LONG) { av_log(logctx, AV_LOG_ERROR, diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index dae8bd278a..93526b11e2 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -849,7 +849,7 @@ int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb, } else { sl->explicit_ref_marking = get_bits1(gb); if (sl->explicit_ref_marking) { - for (i = 0; i < MAX_MMCO_COUNT; i++) { + for (i = 0; i < FF_ARRAY_ELEMS(sl->mmco); i++) { MMCOOpcode opcode = get_ue_golomb_31(gb); mmco[i].opcode = opcode; diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index dffd723ba6..38a4e96e26 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -52,8 +52,6 @@ #define H264_MAX_PICTURE_COUNT 36 -#define MAX_MMCO_COUNT 66 - #define MAX_DELAYED_PIC_COUNT 16 /* Compiling in interlaced support reduces the speed @@ -330,7 +328,7 @@ typedef struct H264SliceContext { uint8_t cabac_state[1024]; int cabac_init_idc; - MMCO mmco[MAX_MMCO_COUNT]; + MMCO mmco[H264_MAX_MMCO_COUNT]; int nb_mmco; int explicit_ref_marking; @@ -489,7 +487,7 @@ typedef struct H264Context { /** * memory management control operations buffer. */ - MMCO mmco[MAX_MMCO_COUNT]; + MMCO mmco[H264_MAX_MMCO_COUNT]; int nb_mmco; int mmco_reset; int explicit_ref_marking;