From patchwork Thu Mar 24 20:20:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34953 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp1216190uaj; Thu, 24 Mar 2022 13:20:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEaGbdZY/654/iZr7wXQ43Zo0LJ+rWiuSmjgeKH7kBR3bGW1RJBI8RRLdBPyiQlZF5+1KW X-Received: by 2002:aa7:d70e:0:b0:419:1e2c:e1ea with SMTP id t14-20020aa7d70e000000b004191e2ce1eamr8850755edq.202.1648153230879; Thu, 24 Mar 2022 13:20:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id jl22-20020a17090775d600b006dfbc3ceb1asi382676ejc.157.2022.03.24.13.20.29; Thu, 24 Mar 2022 13:20:30 -0700 (PDT) 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="Rp0bCa/o"; 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 C75E968B1AC; Thu, 24 Mar 2022 22:20:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2064.outbound.protection.outlook.com [40.92.90.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD996680AC0 for ; Thu, 24 Mar 2022 22:20:19 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QYtk2oTa57nUTokrNGiIFjojkQpWSETHdwjBZzrHsR6LyZNEQPpo0Not0USMlLdFVE5Erk0mOc3vD4icejRx0rHMbFQMfirZGlxM7Iq3dQzDJKao5L+Vn5aJBQUh/GY6CtL7zVPUj1A61BRCzyreG2RccNbht2Xdv9X3tjTVpdZJatEhsG3nNGTF2AUhFV2iRUyx4Yf4ZCCLPGdMy++GsZ+eRfI8hsdBhab3TW8qjv/mjGBde+B7nKRIHEcvlWxh063B3ZcraofSoViB2eeQ0DFBJmp2y8HDM39SPlqy/7vD1PZzVmyQ7HpnsZ2LiSw264pOt0vq5+pOWnmvRl9YCw== 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=qajpU0ZQ+i/qWIgqAWYkc3/SCwwHDSyqYhThuM5uOlI=; b=C3UvVQOtvxWoGDkzpGqR8AtGWkPjy9exAe0o4GzvzkR3f15MGTMNyHLfWykDo+mcFMxTvIyjpY7pUsFXIHrxSYGh4wU8psb5BFlPuljK7q7rzApbfx87nEggATBFCPKEbG8zuAkOPpUrmDBkHaGBhJWNFvUWlJNLanuyDOaxWx+HhtpiIFlBszZlLZx1g0KK9q3kMklfqpSHZOkjTgaYVpDRenQaEslJwqi5xaqSXl6YaOPLVbRB7RmVfZ4mTASAoWBhkozfWUCx0aVmncSP2rKHQNypbz377MYUFjSKwEQCjqPlpLpXXf66O/a9rR80DZNJlcw3lqGswlq9C5TLkQ== 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=qajpU0ZQ+i/qWIgqAWYkc3/SCwwHDSyqYhThuM5uOlI=; b=Rp0bCa/oEYO3DUj0D36fGOZOX1YV4IspRnKGTd+cA8MoQpGvgpiDARHxu2ucKphZoWV0rwpjuD0nrWblfBDNhPt1OQn5/y3P2Cd8lxSTSfiKIiw9yqjLZ+MK+AozOZTDXUN9A8mom88j+38YQtvSrr5Qe9x16z4KUVI4GSnpQGptOUiJrTI0vk3Hs8J9rI3mPH6XrBCm4Z00gUHxafYunpQ5ahejN9TwyRUzM6iAspy+PAUu+0qbcmCqWh2nyrrKMReyrnRSdvBinteX0Qzb+zIafKYKWSuoY9l9jiDtLhbgAJAqbtHpHOol8TDYeyLLfjMki/TKu3YMwJu21yYKdw== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AS8PR01MB8586.eurprd01.prod.exchangelabs.com (2603:10a6:20b:449::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Thu, 24 Mar 2022 20:20:17 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5081.022; Thu, 24 Mar 2022 20:20:17 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Mar 2022 21:20:06 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 X-TMN: [1cSLbTl2D6kzF0tdaZ5IU1/cxs7FKz5r] X-ClientProxiedBy: AM6P192CA0074.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::15) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220324202008.943418-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f54676f0-929f-41da-facd-08da0dd3b5f0 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRPXK2pYrYpBDVwwV2vfGTGxF6ojaLpdJ7OdOAfQqx/xUEy0Eq0Mri1HRPSYF5+kJ1zZyPACTiDl0OMXQtVRcTWujG8YWY9Oz1wiik/EAvAnvOeK4Iua0B7jWmCTNZx6I/9CyMOIhKam5s2FSBOdiU22J+zZTKdQg3jvubpHrBLe5zZXo2ebVQ9irYqKQQ2pdvimkKvI5IXLjTEuirkKeyOGpYzc35B7eEM/yOgcp+/EQGJ+Xv+DlMDX7LF1CF9mLvWt4lczrHAfBbz+FsFJUiJaw/l1/uGx7+9k9evDbcgmTy6sQYkQ/NvuY+Zg5mpRAVzGs9jeqxVjyWkXp8FEEcI6xIu4F4WEO4Fk2bq4zD7Np2sZ8o9JzAfARs422+kNB/yczJ0GFlUSS31uylWcIbTh6PQ2tJlIq2d9hQDA9y99sJOgXhiRi9jnmXWwgtml/HHkCY7xfiAqKxm+MoR1o4smNO0u7I11zL7HfCqw3QshB6R6nJEmDT/BeUrCVOGdRT6HKfPGL0MMdfwR10TA2JXB4VBQweFUvxMzIVh9EFscbbsNN1iXFPJwunMSj2MWk3kX6ZPlH//1nQWbHKK7OvBd13mZk1tVgI4W+0LcbcyqUtMdrRb1n6mBTLmVIunWvjXFR4IXb74Dr1Lyb19LYUf/Pdd8t0F28ZkJqxeNMh5QRGK7/ioUM/+rigAY9NjKjTspBLyzpEpFsRZ/yLWu72dbm3J3TdgvSPaH5QRysuzs4vHYqbQTIms2ufi9u9IH4c= X-MS-TrafficTypeDiagnostic: AS8PR01MB8586:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-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riginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f54676f0-929f-41da-facd-08da0dd3b5f0 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 20:20:17.3856 (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: AS8PR01MB8586 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/h264_slice: Fix decoding undamaged input with slices 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HntRFVW0ckAs ff_er_frame_start() initializes ERContext.error_count to three times the number of macroblocks to decode. Later ff_er_add_slice() reduces this number by the amount of macroblocks whose AC resp. DC resp. MV have been finished (so every correctly decoded MB counts three times). So the frame has been decoded correctly if error_count is zero at the end. The H.264 decoder uses multiple ERContexts when using slice threading and therefore combines these error counts: The first slice's ERContext is intended to be initialized by ff_er_frame_start(), error_count of all the other slice contexts is intended to be zeroed initially and all afterwards all the error_counts are summed. Yet commit 43b434210e597d484aef57c4139c3126d22b7e2b (probably unintentionally) changed the code to set the first slice's error_count to zero as well. This leads to bogus error messages in case one decodes an input video using multiple slices with slice threading with error concealment enabled (which is not the default) ("concealing 0 DC, 0 AC, 0 MV errors in [IPB] frame"); furthermore the returned frame is marked as corrupt as well (ffmpeg reports "corrupt decoded frame in stream %d" for this). This can be fixed easily given that only the first ERContext is really used since 7be2d2a70cd20d88fd826a83f87037d14681a579: Don't reset the error_count; and don't sum the error counts as well. Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_slice.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index ee84b3764d..f6104dde89 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -2931,9 +2931,6 @@ int ff_h264_execute_decode_slices(H264Context *h) int slice_idx; sl = &h->slice_ctx[i]; - if (CONFIG_ERROR_RESILIENCE) { - sl->er.error_count = 0; - } /* make sure none of those slices overlap */ slice_idx = sl->mb_y * h->mb_width + sl->mb_x; @@ -2954,10 +2951,6 @@ int ff_h264_execute_decode_slices(H264Context *h) /* pull back stuff from slices to master context */ sl = &h->slice_ctx[context_count - 1]; h->mb_y = sl->mb_y; - if (CONFIG_ERROR_RESILIENCE) { - for (i = 1; i < context_count; i++) - h->slice_ctx[0].er.error_count += h->slice_ctx[i].er.error_count; - } if (h->postpone_filter) { h->postpone_filter = 0; From patchwork Thu Mar 24 20:21:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34954 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp1216568uaj; Thu, 24 Mar 2022 13:22:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJlh+WGImE3haEaMve6kYaLbQjPwP4PfwXLIONW8VT6uJWdKrpDsQQKihTrznh8E8trAlX X-Received: by 2002:a05:6402:1912:b0:418:cd23:3742 with SMTP id e18-20020a056402191200b00418cd233742mr8918871edz.412.1648153335809; Thu, 24 Mar 2022 13:22:15 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hs32-20020a1709073ea000b006df838687e7si455282ejc.20.2022.03.24.13.22.15; Thu, 24 Mar 2022 13:22:15 -0700 (PDT) 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=AQkUzl5T; 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 265D768B1D9; Thu, 24 Mar 2022 22:22:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073088.outbound.protection.outlook.com [40.92.73.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E19D8680AC0 for ; Thu, 24 Mar 2022 22:22:06 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvpKxrMVCahzacXBV56oAvHISZsq8Z4VBrssDVXHhz0p+YjbeQw5FuPLVoGRssIz4ZjzxpsT2NrH9eFJtlQijRznRVkjKaUa/awu5NCAvmFuh50JnL6nFf3CU5ul3z1ZWlJosBZ+G1UTmIffEBJxbtU9dCGnBYTJ9ksZXFLZGSGF2Qp7j9viMrclaTwXhjztXL2YzFYerd/8mTEQoCQftylC7UoPDgXkfLrNW4hL/euiX5hacbktK10kTKyhdT7rGVQnn7K4Phrl7Maygl47fdAcIWBT0JSmH6c9H1h/kTHhfgcxB2Fo96JQD2W5vf/fo1UX3XpodE0rGbz1NliD2g== 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=P8QqH4DWvhFkdJm2F8kpHbhc4JWR9ZF/Xf56mMpo/KE=; b=ALmO4OeZCLZStIEw7vQZmhrM5eFT8jm50nV3JfzYH9mvjT+SFMNAA0HuseG+jSyo++DsS8kAtfPRVe9bPRCVPYTasyrONOI7xTRk0h7DpbJ6adSuw8RZULHo9cQ1ZyOHMFVL7s5IElNgm2rS/aBi1r+26rxe+OwXuK3tLypD8GWlbU/dy3vpnk+mmkv/JKAHHBvSrQGs/AZ1iOZ7G/V8gwa7Gqh6dPG5KaQX7VMHyZ/ClBddTElJpXntOW+009mioyOkprq76JQeHSz1mNH4AlQe6Vq8B6nF1JI+/EuHYvsQmcV800/5qp3ID3/pdhGKwfQG+dkE/D7CKSU0gqv2YQ== 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=P8QqH4DWvhFkdJm2F8kpHbhc4JWR9ZF/Xf56mMpo/KE=; b=AQkUzl5T675mzwNyhEF34XTpOBlR9kmaGo9/u7pUAS1Z3vvCRmgbPSNRbczjEfcoH+dpwftroA9KgGqX1ok1RSQne+Ea6byRPeXeguaumHpY2MsD1RbP6HsrX4GsUO413G3yXdQ46P6aPsO7ydXJ/gJYNn7yPNb0/Grlg24pKdCtZ6zRq4sOXRhBMRq/2YHecCaGanAzhDLcXUADfTWGPL3kae04/fnQUAGT9GaPT0NN2FllapYqs+knV+zSYB0LZt0gT8/uPh19QZ/5XMCAH4fmT77GvvkPTys3xSd7JA8hGWqaBC210os7lREZt+jVUXOl0bleloaRDl8wLan8rg== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AS4PR01MB9375.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Thu, 24 Mar 2022 20:22:05 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5081.022; Thu, 24 Mar 2022 20:22:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Mar 2022 21:21:50 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [qNhHqFNKxDFNYQ+TXGoHXr3cNhuUzjUg] X-ClientProxiedBy: AS9PR06CA0286.eurprd06.prod.outlook.com (2603:10a6:20b:45a::32) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220324202151.1016018-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9a4fc91-891f-4c4a-83c7-08da0dd3f685 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRPXK2pYrYpBDVwwV2vfGTGKRxCxdmgz/iY5b/2l5k4B8Iiv4PMdpEU5pBaR3Zl1Y6HPWu4AdPUynv9dsHthwodq3foqTiK+NmFspNrZ98/7aOHnOj1HBdmU41uAYMOjwl3iYnrhDlvLax4t6osTMgC58BjteSbhKs39cKk0/1TGFqYYAiEgDvNsSioXkgIEM/Q0O7zYXAw8IBOVOeXeIm8fDo2lXtGZnAXUK85zEj31CFh+7Qjy9PjJ77hOx1jixvBHMBk1g65F/YzXduLQwZRKUIgnNoditx0IbHHW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AUdimsTEfxnBQs7KKM2iwzcWPSueb44g6sUfTwiSx6rahd4cQiLm0Gl5nIz9UWLUt9jrWGN6QO7KJFyF8h8Mj0WUGCgfNxyxGUJM+qg79DKr+HPS8885re18kWKNJcvbdAoB9yZpKtGK89QuxkLMxvbxI3uAyT18+sacYvvfXED3vsO+qvZFz5u7/wEgyirO3NJ4489IseURJSMRTSqW2Nd4zjE9M9s2THNtpLdmTCeYcQIw= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9a4fc91-891f-4c4a-83c7-08da0dd3f685 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 20:22:05.3583 (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: AS4PR01MB9375 Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/h264dec: Move ERContext to H264Context 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UEWz9WSGPOC7 Since 7be2d2a70cd20d88fd826a83f87037d14681a579 only one context is used. Moving it to H264Context from H264SliceContext is natural. One could access the ERContext from H264SliceContext via H264SliceContext.h264->er; yet H264SliceContext.h264 should naturally be const-qualified, because slice threads should not modify the main context. The ERContext is an exception to this, as ff_er_add_slice() is intended to be called simultaneously by multiple threads. And for this one needs a pointer whose pointed-to-type is not const-qualified. Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_slice.c | 31 ++++++--------- libavcodec/h264dec.c | 86 ++++++++++++++++++++--------------------- libavcodec/h264dec.h | 7 ++-- 3 files changed, 56 insertions(+), 68 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index f6104dde89..d56722a5c2 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -537,7 +537,7 @@ static int h264_frame_start(H264Context *h) h->cur_pic_ptr = pic; ff_h264_unref_picture(h, &h->cur_pic); if (CONFIG_ERROR_RESILIENCE) { - ff_h264_set_erpic(&h->slice_ctx[0].er.cur_pic, NULL); + ff_h264_set_erpic(&h->er.cur_pic, NULL); } if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) @@ -549,9 +549,9 @@ static int h264_frame_start(H264Context *h) } if (CONFIG_ERROR_RESILIENCE && h->enable_er) { - ff_er_frame_start(&h->slice_ctx[0].er); - ff_h264_set_erpic(&h->slice_ctx[0].er.last_pic, NULL); - ff_h264_set_erpic(&h->slice_ctx[0].er.next_pic, NULL); + ff_er_frame_start(&h->er); + ff_h264_set_erpic(&h->er.last_pic, NULL); + ff_h264_set_erpic(&h->er.next_pic, NULL); } for (i = 0; i < 16; i++) { @@ -1004,11 +1004,7 @@ static int h264_slice_header_init(H264Context *h) ff_videodsp_init(&h->vdsp, sps->bit_depth_luma); if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) { - ret = ff_h264_slice_context_init(h, &h->slice_ctx[0]); - if (ret < 0) { - av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n"); - goto fail; - } + ff_h264_slice_context_init(h, &h->slice_ctx[0]); } else { for (i = 0; i < h->nb_slice_ctx; i++) { H264SliceContext *sl = &h->slice_ctx[i]; @@ -1018,10 +1014,7 @@ static int h264_slice_header_init(H264Context *h) sl->mvd_table[0] = h->mvd_table[0] + i * 8 * 2 * h->mb_stride; sl->mvd_table[1] = h->mvd_table[1] + i * 8 * 2 * h->mb_stride; - if ((ret = ff_h264_slice_context_init(h, sl)) < 0) { - av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n"); - goto fail; - } + ff_h264_slice_context_init(h, sl); } } @@ -2667,7 +2660,7 @@ static void decode_finish_row(const H264Context *h, H264SliceContext *sl) ff_h264_draw_horiz_band(h, sl, top, height); - if (h->droppable || sl->h264->slice_ctx[0].er.error_occurred) + if (h->droppable || h->er.error_occurred) return; ff_thread_report_progress(&h->cur_pic_ptr->tf, top + height - 1, @@ -2682,9 +2675,7 @@ static void er_add_slice(H264SliceContext *sl, return; if (CONFIG_ERROR_RESILIENCE) { - ERContext *er = &sl->h264->slice_ctx[0].er; - - ff_er_add_slice(er, startx, starty, endx, endy, status); + ff_er_add_slice(sl->er, startx, starty, endx, endy, status); } } @@ -2713,13 +2704,13 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg) sl->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME || (CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY)); - if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && h->slice_ctx[0].er.error_status_table) { + if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && sl->er->error_status_table) { const int start_i = av_clip(sl->resync_mb_x + sl->resync_mb_y * h->mb_width, 0, h->mb_num - 1); if (start_i) { - int prev_status = h->slice_ctx[0].er.error_status_table[h->slice_ctx[0].er.mb_index2xy[start_i - 1]]; + int prev_status = sl->er->error_status_table[sl->er->mb_index2xy[start_i - 1]]; prev_status &= ~ VP_START; if (prev_status != (ER_MV_END | ER_DC_END | ER_AC_END)) - h->slice_ctx[0].er.error_occurred = 1; + sl->er->error_occurred = 1; } } diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 2a510b0a01..f438376431 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -154,14 +154,16 @@ void ff_h264_free_tables(H264Context *h) av_buffer_pool_uninit(&h->motion_val_pool); av_buffer_pool_uninit(&h->ref_index_pool); +#if CONFIG_ERROR_RESILIENCE + av_freep(&h->er.mb_index2xy); + av_freep(&h->er.error_status_table); + av_freep(&h->er.er_temp_buffer); + av_freep(&h->dc_val_base); +#endif + for (i = 0; i < h->nb_slice_ctx; i++) { H264SliceContext *sl = &h->slice_ctx[i]; - av_freep(&sl->dc_val_base); - av_freep(&sl->er.mb_index2xy); - av_freep(&sl->er.error_status_table); - av_freep(&sl->er.er_temp_buffer); - av_freep(&sl->bipred_scratchpad); av_freep(&sl->edge_emu_buffer); av_freep(&sl->top_borders[0]); @@ -176,6 +178,7 @@ void ff_h264_free_tables(H264Context *h) int ff_h264_alloc_tables(H264Context *h) { + ERContext *const er = &h->er; const int big_mb_num = h->mb_stride * (h->mb_height + 1); const int row_mb_num = 2*h->mb_stride*FFMAX(h->nb_slice_ctx, 1); const int st_size = big_mb_num + h->mb_stride; @@ -208,33 +211,11 @@ int ff_h264_alloc_tables(H264Context *h) h->mb2br_xy[mb_xy] = 8 * (FMO ? mb_xy : (mb_xy % (2 * h->mb_stride))); } - return 0; -} - -/** - * Init context - * Allocate buffers which are not shared amongst multiple threads. - */ -int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl) -{ - ERContext *er = &sl->er; - int mb_array_size = h->mb_height * h->mb_stride; - int y_size = (2 * h->mb_width + 1) * (2 * h->mb_height + 1); - int c_size = h->mb_stride * (h->mb_height + 1); - int yc_size = y_size + 2 * c_size; - int x, y, i; - - sl->ref_cache[0][scan8[5] + 1] = - sl->ref_cache[0][scan8[7] + 1] = - sl->ref_cache[0][scan8[13] + 1] = - sl->ref_cache[1][scan8[5] + 1] = - sl->ref_cache[1][scan8[7] + 1] = - sl->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE; - - if (sl != h->slice_ctx) { - memset(er, 0, sizeof(*er)); - } else if (CONFIG_ERROR_RESILIENCE) { + if (CONFIG_ERROR_RESILIENCE) { const int er_size = h->mb_height * h->mb_stride * (4*sizeof(int) + 1); + int mb_array_size = h->mb_height * h->mb_stride; + int y_size = (2 * h->mb_width + 1) * (2 * h->mb_height + 1); + int yc_size = y_size + 2 * big_mb_num; /* init ER */ er->avctx = h->avctx; @@ -252,7 +233,7 @@ int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl) if (!FF_ALLOCZ_TYPED_ARRAY(er->mb_index2xy, h->mb_num + 1) || !FF_ALLOCZ_TYPED_ARRAY(er->error_status_table, mb_array_size) || !FF_ALLOCZ_TYPED_ARRAY(er->er_temp_buffer, er_size) || - !FF_ALLOCZ_TYPED_ARRAY(sl->dc_val_base, yc_size)) + !FF_ALLOCZ_TYPED_ARRAY(h->dc_val_base, yc_size)) return AVERROR(ENOMEM); // ff_h264_free_tables will clean up for us for (y = 0; y < h->mb_height; y++) @@ -261,16 +242,31 @@ int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl) er->mb_index2xy[h->mb_height * h->mb_width] = (h->mb_height - 1) * h->mb_stride + h->mb_width; - er->dc_val[0] = sl->dc_val_base + h->mb_width * 2 + 2; - er->dc_val[1] = sl->dc_val_base + y_size + h->mb_stride + 1; - er->dc_val[2] = er->dc_val[1] + c_size; - for (i = 0; i < yc_size; i++) - sl->dc_val_base[i] = 1024; + er->dc_val[0] = h->dc_val_base + h->mb_width * 2 + 2; + er->dc_val[1] = h->dc_val_base + y_size + h->mb_stride + 1; + er->dc_val[2] = er->dc_val[1] + big_mb_num; + for (int i = 0; i < yc_size; i++) + h->dc_val_base[i] = 1024; } return 0; } +/** + * Init slice context + */ +void ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl) +{ + sl->ref_cache[0][scan8[5] + 1] = + sl->ref_cache[0][scan8[7] + 1] = + sl->ref_cache[0][scan8[13] + 1] = + sl->ref_cache[1][scan8[5] + 1] = + sl->ref_cache[1][scan8[7] + 1] = + sl->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE; + + sl->er = &h->er; +} + static int h264_init_pic(H264Picture *pic) { pic->f = av_frame_alloc(); @@ -739,7 +735,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) goto end; // set decode_error_flags to allow users to detect concealed decoding errors - if ((ret < 0 || h->slice_ctx->er.error_occurred) && h->cur_pic_ptr) { + if ((ret < 0 || h->er.error_occurred) && h->cur_pic_ptr) { h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; } @@ -764,25 +760,25 @@ end: H264SliceContext *sl = h->slice_ctx; int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; - ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr); + ff_h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr); if (use_last_pic) { - ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec); + ff_h264_set_erpic(&h->er.last_pic, &h->last_pic_for_ec); sl->ref_list[0][0].parent = &h->last_pic_for_ec; memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data)); memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize)); sl->ref_list[0][0].reference = h->last_pic_for_ec.reference; } else if (sl->ref_count[0]) { - ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent); + ff_h264_set_erpic(&h->er.last_pic, sl->ref_list[0][0].parent); } else - ff_h264_set_erpic(&sl->er.last_pic, NULL); + ff_h264_set_erpic(&h->er.last_pic, NULL); if (sl->ref_count[1]) - ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent); + ff_h264_set_erpic(&h->er.next_pic, sl->ref_list[1][0].parent); - sl->er.ref_count = sl->ref_count[0]; + h->er.ref_count = sl->ref_count[0]; - ff_er_frame_end(&sl->er); + ff_er_frame_end(&h->er); if (use_last_pic) memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); } diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 6ad2333419..0b9c5784a2 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -170,7 +170,7 @@ typedef struct H264Ref { typedef struct H264SliceContext { struct H264Context *h264; GetBitContext gb; - ERContext er; + ERContext *er; int slice_num; int slice_type; @@ -271,7 +271,6 @@ typedef struct H264SliceContext { unsigned int pps_id; const uint8_t *intra_pcm_ptr; - int16_t *dc_val_base; uint8_t *bipred_scratchpad; uint8_t *edge_emu_buffer; @@ -543,6 +542,8 @@ typedef struct H264Context { int height_from_caller; int enable_er; + ERContext er; + int16_t *dc_val_base; H264SEIContext sei; @@ -784,7 +785,7 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture *src); void ff_h264_unref_picture(H264Context *h, H264Picture *pic); -int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); +void ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height); From patchwork Thu Mar 24 20:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34955 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp1216595uaj; Thu, 24 Mar 2022 13:22:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaw47GcMxKpvWKuJzFhwS9yc6TFPunNKihSY+UrPJgka1fJGVOztImhAJrhizyj/aT834G X-Received: by 2002:aa7:c789:0:b0:413:605d:8d17 with SMTP id n9-20020aa7c789000000b00413605d8d17mr8747669eds.100.1648153347417; Thu, 24 Mar 2022 13:22:27 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id vl12-20020a17090730cc00b006df76385c54si405684ejb.244.2022.03.24.13.22.27; Thu, 24 Mar 2022 13:22:27 -0700 (PDT) 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=u0JYIS1v; 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 35AF368B1CB; Thu, 24 Mar 2022 22:22:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073072.outbound.protection.outlook.com [40.92.73.72]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 52C3068B1A3 for ; Thu, 24 Mar 2022 22:22:17 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=An4iie8uXyH27vD2QdwTRFA7BfWl4FFAeg7RIllLR8g/g1fO56jzryYLUJupNlTF7SYjJ2wPquA+hbX6H1k76C0Leuhvz8PEt64EaZ8oEKWFxsuO1BXEqcKpUUFPrweybqS36bvIsf83ylEM1hPP8EGMD3WjCyWouSEjmeneV3MI7Ly4vB47XV2wJp874+2wW3dwIPoRFse+sQTmvDMtLD9v1UK6XxNnNNsgF09JwejxLOPOdiJWY5jHtLgarfi9LGiHZ2/7cPiwd7Tjry1QocdCjomGNp+eX+qEQzOQzR3Iax483WvddB0qi4Tf106IqTNNyZmu4n6S/Oi/LiTnMQ== 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=a1pSDI4oAmmuCdAw6AHYMoxD9+AfagtzRcNsuveVA78=; b=HSiWt8Xl33zuRTdWiEiRbErXUShVyBstsY4cOC6a/YfitBTKqTs8Go9SaH0/zZqB+EUPzHjVpvyeMivWTplbaphqqsIroPl9WZ2fO8p9h0wOQ74V69ci/zqjKJoUgxLwNGYAHqZKrKnJ5+/HJiCDNshwJCvfUrJmqt8djgkzqCg86uvd1KDGwqgufq0J6yUWwK9H8PqUcejabUk4M1vRI6EWXSg1egY6sTpYPlUFtURyp15WrzzSxlUcq+V4CfjKCay4UAC9CYZQcaaxfgEhlcdxes5eIYbZnAD2BwBanCYUJUtyu1lAAB0q8EVHePWFExAwGiX/XbD3pzkCrHBrug== 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=a1pSDI4oAmmuCdAw6AHYMoxD9+AfagtzRcNsuveVA78=; b=u0JYIS1vqB8Oeaqo6Vc+K8vJZxnr7+X0qGJDuoM1Ffmvm3yQInVDjGjxQtsNgTis8WLARripY0SQjEOjbWGemgV3SxJMGPyKV73BYukfyheAH6BCxzEB+Tgej9kJGPdxcB8nNPBYaLx6S2Oxgbr5/Dh9eUlQ+dWKDWSqmUqCQOYfBVZQqxy0r1EfgnbcZEnCVtrgKUE4C3IykExYAv58idzJMQT5CkWcSU/zAREVUq2CSrFBcrmrVRrEO4T/Usd8fEg/+7I4kR92q68pO5mMPV4hWblmGmnuzIACgumDZeCDyqcceNIQoXMVK/nIaWgm8+LOGfVFa3D/kUwagguz7g== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AS4PR01MB9375.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Thu, 24 Mar 2022 20:22:15 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5081.022; Thu, 24 Mar 2022 20:22:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Mar 2022 21:21:51 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [iUvgzAuOiThvaNc3i5BxABE6b08HNjAf] X-ClientProxiedBy: AS9PR06CA0286.eurprd06.prod.outlook.com (2603:10a6:20b:45a::32) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220324202151.1016018-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9384b7b9-670f-4e48-c462-08da0dd3fcb6 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UL9NwZueSqCZLZof+kQi0VWb4FPftGvZRtT7NTAMEYhbyNIXeQz5ectNe5enElaIJMs0SL8hKw0BOfuZQsgIY/KIy0kg/IE6W9uC6ywKcYEJDTOFVIWU7GbftMn6TFnnU5Z/d8j36OCS5VnI2TQHWNovQvrvl3X7tsDt0pjIj+SjzNCWygPmZErA3J6u2XZBo3VBEVJ4WWDVUUXPGqikOvLbLId08kdYhhKMWBxzAJfcwjjr9Q/6H62l7Arf0QEHuz5NNbC3+2Cr51szgrTbhuH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aAGisPozwW3Y1zMbrBvdz+8Wi8Z+K6mMPUCQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bLJqRBCvVMxk83p4zWUR19c32kXEIX7J6DH3oOyReRfKVhVed+jLNHY7Scwt4vKzspo3ew8stWftuz3D6ReLnD0DSF2uCiQ8zCdud+D/vJC8pb7cYkXJGA8qZ2ZVorHYVq/5m3GMKHLmbdmvomqmKouiCbLiIItAtILOfIZhdsQdMO/8+m+cErcfUnfkGLe2jURAoYEzzs071iT7qEbzyFy+uUaK+z5b1Y/QQbHqbfo/TfqkKWcT8Z9MTf05J90b4svnowMHGAwn/x1CIC21Wt73R4u2zHT5FuX02Nkb5q3TMgmvyUsfRQeBckZ1OgCeYt7vWcR6bikugfZREe7mcYRlH+VH4s56Q0kwHflW9CUCDR2Yvm43h0xZewAC20kn4rWNzF7YKepLl145+TXZ1dtmLYzJ9a921KPXIg6dBv80H1R/kq3kwh40Y74TJFN+6XzcWHqdnlEkbRItSqUc48MYqYzSe9b/yMmfjLke64/TjwUXV5PFUGYjxRE6p7Zj4aqvBBexu9P77yG9W29t9BdSq/iAUnWSgcQxQHoSWYePnDXlC9zRh1yVMtEAu5f9inWoWn15ZhMXI87e7YQWnRfOVBAe8pfnogvGs7SeN3Xip/NZoNm0ETxjQVVjGMmO12Fet3hGnSJIzizQrgeK33KauYASdf2H3fD/soazXRyPb73NhPATn7vURvAr1bml/RWG9BPu/Vaf00e9apMgUBlAEevUMBZ6ah8oirhy9usn64q/nVvssGp8AWbxaB3RAWUCzBGVgzzviWucwpFc8ege3hIMlQCa90bVt8AkiUlFsAol62qgkpry+JYjMHwbPrJQHaDt6wXErAg9jxyfMzABtk41EkFI83GMfbQ10GOvfnOu3PbX3VlsEifCC/Rh9MnYAG5q9AXGZHUYm1W//IFucqQZvzLqL6rAdRfFYh8rrffJr5v/ynmby75cnJH8+k2RU+EoBBo5IWP2/i7aXN7YSFe75VaiE531T/0psHqz/IrGOsIciGSidpcjPhj0ucmkJN+4tFeQ2moY4dGCnTAdkDsklT1VTtFVPOhKy/4H4LDd1MwDVicyIADqA0e+iu7TBcJK+u0ytY+UueYKeS62r0ZYTkA8oxpqMn8PLW/YdF5xYabmh2iLA09NAgeqBOdkkdM+SOT4K4EMwAwRSwYZJkO+bPWpAD5EfoB/IVc= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9384b7b9-670f-4e48-c462-08da0dd3fcb6 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 20:22:15.7317 (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: AS4PR01MB9375 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/h264dec: Constify slices' pointer to the parent context 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: aq3HS/O1KxAs Modifying the main context by a slice thread is racy; so constify the pointer to it in H264SliceContext. The code itself was already compatible with this change. Signed-off-by: Andreas Rheinhardt --- libavcodec/h264dec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 0b9c5784a2..9a1ec1bace 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -168,7 +168,7 @@ typedef struct H264Ref { } H264Ref; typedef struct H264SliceContext { - struct H264Context *h264; + const struct H264Context *h264; GetBitContext gb; ERContext *er; From patchwork Thu Mar 24 22:27:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34956 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp1237443uaj; Thu, 24 Mar 2022 15:27:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGBiBi3FuGQcyTrzLmo+GTsXBqQHjsbR1738sluNAfP1BON5BXdkIJwC6kBg5w6Xb6jGyS X-Received: by 2002:a17:906:1ece:b0:6ce:e14:6d92 with SMTP id m14-20020a1709061ece00b006ce0e146d92mr8241431ejj.408.1648160868791; Thu, 24 Mar 2022 15:27:48 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e21-20020a1709061e9500b006df76385c2dsi722730ejj.205.2022.03.24.15.27.48; Thu, 24 Mar 2022 15:27:48 -0700 (PDT) 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="ugWpAX/G"; 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 E3FEE68B1AC; Fri, 25 Mar 2022 00:27:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074086.outbound.protection.outlook.com [40.92.74.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B29368A141 for ; Fri, 25 Mar 2022 00:27:37 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OpqUo9K2b3MfbEa3RDnXx/qdgec+TkpDvx3a/SbmUaw3jN8BvbSPQHkVjsfuoWdvzQIVE7IsnCTFaLUcrNHuHJics1eMFsAZVubIRhxYh63bdvVJ9y5oeepEqvHEOf9/L6jm0RDA1WGPNcnRnynm0zKuQiB8KwejMUbnenSz/Vnbr0v29Dp2UBQeX9XNVWDw38/ke+9sw5rpG1QPil/88c+IeM3enF8mYVHk8SHqB/cF7Y9ydVFjM8LUPfnAkShUGFnbl0DgVnDKrrBd3uzGepYWCrNUO/XVQnBoUQ/nMa/VCUhx4RFxrSfgLtOrRhPUf1390vXwRKWPYzNnhUNE5w== 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=5PZTH6Z5RxdbeuIZg2v/Bi46c0a9mNEe5vMm3O3aIhs=; b=S/fZGfa/oVTORgU+wnwMuVfpWd3Z/Gh/wvAJmxkZcjxTl0AhBaIFAG6zGR1fJBsfn9vYUBu7u8HVoTJlx6xkTsq4dxoYE89p1ajdlklQxpvHO2WwgkgHmzcU13kxkbEGoHNgBuHZb1Ud92VECsv9idLVPm9ArY2pk16yoBprv/yJ5jvDewJE/os1BCP6Z1N2SLgxh8M5EJxnoRa3sr/nckAG+rg1hLcjC5Wh+pEoQT+RyjEbfBT8HKIjaMCsQp7IiPQmlLnZ1phKPt9rfSkcaMpQWWkvcWGo7beZ4/r6bfwEQTdlZgoORYOfqZN33K6EmjwKAczy+BNoOIZWAbr7CA== 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=5PZTH6Z5RxdbeuIZg2v/Bi46c0a9mNEe5vMm3O3aIhs=; b=ugWpAX/G2yKChNm9UCFcBleypnAu2z5zUYjdWDJpelQxAgP7QD3XaOBfKnpTDTKs8E7tefmOgdNSaw982IiZncyxg+kTIKPltgQy2sfb82pO2h4hYAzZQOB3pSxtFW9NKcpovSlYRQ3IThyJZ9fdwVIlgOC+XsFj1rHfGaKfysMtDa+XdonAA+Scc7CtrYaT9HKFgUi31dYhz3q2SEpqXS9VCriTyjEbH1EOeFbWwN+GmPmGj2wWbZaeGMvWfpFvP5fPwSq/MjGv5vF69wRf2IlNDAVv/4LU3rUMc2ANJzvu5Sc+gONpDruZY9WtxxzUqpP9zNDkgwHhiiEfhXDnoQ== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM0PR0102MB3492.eurprd01.prod.exchangelabs.com (2603:10a6:208:7::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Thu, 24 Mar 2022 22:27:35 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5081.022; Thu, 24 Mar 2022 22:27:34 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Mar 2022 23:27:23 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [nc5Qtti+f8wLlXhY6tzHe0eGPPIZPbwY] X-ClientProxiedBy: AS9PR06CA0119.eurprd06.prod.outlook.com (2603:10a6:20b:465::15) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220324222723.1050544-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 928fdc04-9d27-4f2a-237b-08da0de57e71 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNWPFoephI4+OqEfLOP/4j2TwB3IEpEldVke6ViS2197MZXzsom8Z351Ug0XB+C1pnrd/pNFmpyM8Cy14oMvzQf0AqzQzBbsdTE+zZWan2OxiIkwoqf1Gh6Nl5/yj4SEcU0u8+tK1Y09iw4pzz5W8Dp/0KMtcy29rpD2cG5wRDsEWyF8BoW+KZclr8C8Z5+n+9MUg5jAB1ur0slU2bfMU6C1tzW7RtczI0hW6wtrKcOgHimHNWCp/SgHECtXiqAbbnzhsrsZW53jmqf0rYRAFtpB/7NCPhGGiYq8wEZbHBCw48cgzJ8oNNkwA+fXbZsfvsvitUVdHfhBp4/1fyfz/gZ1AA0V5Hptwo4QC62PXqoBR93t12yvrsEL7bcL4JlNv6TvvR6bzlSS80QSlB6O9N7x3Jvtz9AekHZdstoYiBdKLRmUWXEvHQ2DGnsFtOiDYZRNPqajL1R9TqZjFKmT00qOSUJOihsDrCD0ydIldtprt3LbDCpAaEg4hF6gB7hSpUG5dxKZdEv1Z/DmJQ++egMLSmO+6wlEKIFNY9SdHMuTDZ0NfyyHO7AuPeICLsbOFDxge38XQv/pOvLvEf9LNgcxmbWhPsuus6t2fRhSaqKA5X64AuluJ6T/6LXdmOKTregMQH4uNyI9aB7BmJg/Pl/MOVJP4kt613CeQMcm7TXa2U/n7x1PJXZtpYEswGpsvMl99JC91yriqX/NLEcjd/bp+hwJusN1jZo= X-MS-TrafficTypeDiagnostic: AM0PR0102MB3492:EE_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XTXLIbytzBYqhWAzw+Oqnec3oksgKmxLYBCxx+NUQ5rmBDFZLKYYmipWU0RcwQDmg6I/9yBPNHVuS91gtY/k72XhoaKvTeosm8vYG2RnD1Lk6DT1KTbkPPL5a/Ly3pomSvojqoxhIkZtDa50oAJD8TJMaVQtmF0NoynHwt2W5LBl9tNoWQ9irSVLD+U9WB3MUfjTcCNTEckIR7ynJGkLEV4bZr1yzp9Z8MdeaX2KDZtEyAAWjltQ+sRxavnKxMKsyWFyrVFXbi+ZgpG4Zmw8gq1ZBfOWPE68hyDk0gmsRps7ghjr/DTW3w6A+jLI90wW40J7OMAU7nsfWU0gpcMqce2Q7fzV/ORl58dZwLm0TZ7xSB4gIew2d8Mb0vqf4rFGrGfd+Y3g2JoGwr4ag4vJ/icuCd7iZXzABt00FlnJxMRabefYvWzTCGV/bH9tqpv8UblpgkKoTF6tf0mfLhNdsWKBu9v0Rs46yBteaZjeX98S644iwlUp8Drz4T966l20775AVHTKAGmIL/Ha86BLKPF3XO//BeDAVB352v+yotQHwDrcy6oM7QeeCD03X4iuEMq9GakeqZ3uVEuJw5fLHBpitRN0x1D085+DbWEazD2SEUW17Q9UcJJ6+t/tMFrnAzPWJdXiOExTA9WSgBDGvpezfsPOKiie5E+HVhq1vx2mf7px+/nQQe4IPs2txdDklIJMtfQggjZeht+5ukehDfxgEKgZ+pnQJ0wvprWvDKr+uOEh/SOx6QMxePioju0HkPzmt0yOmJ9tjgtcCjY4O4UidbcbjvMnJvHy0e/cGWAr+GYVJikbE7k= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 928fdc04-9d27-4f2a-237b-08da0de57e71 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 22:27:34.9330 (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: AM0PR0102MB3492 Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/error_resilience: Remove write only ERContext.ref_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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 5lDfWzqSf2od Signed-off-by: Andreas Rheinhardt --- libavcodec/error_resilience.h | 1 - libavcodec/h264dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/libavcodec/error_resilience.h b/libavcodec/error_resilience.h index bb770ff674..2187586618 100644 --- a/libavcodec/error_resilience.h +++ b/libavcodec/error_resilience.h @@ -81,7 +81,6 @@ typedef struct ERContext { uint16_t pb_time; int quarter_sample; int partitioned_frame; - int ref_count; void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type, int (*mv)[2][4][2], diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index f438376431..9faa35e36d 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -776,8 +776,6 @@ end: if (sl->ref_count[1]) ff_h264_set_erpic(&h->er.next_pic, sl->ref_list[1][0].parent); - h->er.ref_count = sl->ref_count[0]; - ff_er_frame_end(&h->er); if (use_last_pic) memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));