From patchwork Mon Feb 7 00:58:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34152 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp5361780iov; Sun, 6 Feb 2022 16:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlqkZybvknlZlpnpBxmHoi2rgc5H8ZDt8U7sL/JqvipMiKenXlgc4z6rcG09fIhhk3CMN8 X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr11186805eda.162.1644195519922; Sun, 06 Feb 2022 16:58:39 -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 5si5907722ejh.208.2022.02.06.16.58.38; Sun, 06 Feb 2022 16:58:39 -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=RIiMRP1v; 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 5C54968B1E9; Mon, 7 Feb 2022 02:58:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075106.outbound.protection.outlook.com [40.92.75.106]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD7C268B0D5 for ; Mon, 7 Feb 2022 02:58:23 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XwzDeoJfHMi+zxatb4qHggDd1dSQ94uB5gcfbHAO6UpXl5kCUGY1WAPbAcBd/8jWDVXphGGYR5oDQsJHh4sHZxBy4K82zA/gzmfr1CATuetIBapFo7hXu9sZs850SXo8M2XJVEyCCNOjkDuJ7AYi4qb5BugKelRGmCQ542BhtnnH2TOo1WByrhGQB5UMZxINGLQ3GNzudS+odmKh2QhZzf7nZGpKhf15GKdCXkMpfEYXGA3DYS2I3e2y8J/RFp7yiDbe7Ujs9BRzkX66cfcSm72CNn7WZZJ2cg/lbiUYMON7WV3f7dm22nx0dG2afr0I0N8mBcOTYMk/bsUJ6X+/UQ== 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=I28zXyAAwcQpX/7jklfUMPnpIVXOekfRic7ACUV0lzw=; b=DWDu+KlTFbcNR/4uvb6EGztlnuc/hlUlAG+OlrN9CKGMVlyIc8+AMIFYRmzkVVNtQSVrNqQ8L7aIMLmqU4NBlz4lWIfZ1WHwibCzkH/GhD8GdSsxP1OL7gHvtnD99tJr3yoRFb95Vzo45VE7bkkSHXq0kPJ1b0DHb2RG/wC2HS56upZiyzAe3osmiGfO5D19cUSzkNnaDTiHRAFRVnq9FpaUnidpssoLAmskWM6aH0V6BZ64uNtbi/rrPziRxcbGPEti1iiqibkoBUAUyGV2vhIWK2FAdTLY0cnKujn4eFS+O3jcg/XS3SIG21EqHVHbgyP/EfCEGHALP8S2jpkylw== 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=I28zXyAAwcQpX/7jklfUMPnpIVXOekfRic7ACUV0lzw=; b=RIiMRP1veou9Mr3UaeQcT4dS/pbR4PS00XhzpGNl7M42+ag9LQNM119VfPEFv96Y8w3mlX4gMi4X8FzBUNH4FLbNsSlLAh2VEGKMWxAJ53mOs+skiaG9AD0NAJB6J5csnhEqdPmBoFmnl+WQMAv4GkW3xFHKV5ifnOfoeuVoVbd+M1jF6jb0Wz3Azu9Sz4RjkrIBBKrV8EZNzPMHPpP4YFE9LxFXwMvYhLMc34ImvNSmF6IilO/ZT8lDxDbJXTG1FD16nf4JedeiLKjtjVO3DLQoLVUW6i6QMDy4fYCoCIrbTxltie22iffIQOFXtFm7kCSFQNtyBOnElpAXp1Dfcg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5559.eurprd03.prod.outlook.com (2603:10a6:20b:f3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Mon, 7 Feb 2022 00:58:20 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%6]) with mapi id 15.20.4951.018; Mon, 7 Feb 2022 00:58:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Feb 2022 01:58:05 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [LEHr2AKwuuishOFKXLROGEX1jj2KqCe0] X-ClientProxiedBy: AM5PR0502CA0002.eurprd05.prod.outlook.com (2603:10a6:203:91::12) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220207005808.635200-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df9d2ba8-8d92-47ad-d0c3-08d9e9d4ef41 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UK5ZiRUPg1K1tIn8lmq4wyh4YAyKZmhA9QIB7UxU9Rp/P1Rjx0CW6JqnBD/V7Ff9RPP9YSalU5jBOFwdUh5fPrfOWNrlyL7iz9R3uCTlwm5nzaTYf9qD7yCiWY/dVFl7pQzjS+UjyP7LHelPCSThP6ETt8mHaoqYjDtvbEhoX1ZBW5PxnwWM2C7wQoRUJRESbFhNLwIN+r+DvHi4xEFzzNJNcTwAzm/y2YQHH57cy8GI5g60AkZTi9CTn9KhdLvB2CxYKLxO+Tg4G5+av1hI+kzjT0jjdF5qb4hrxgCnZSOjca7B4SfoIC7UwHMaSZcblyA0pITkUkd3C0JHAiHbkdJ5l/n+AB8Urk2Mc8gOR1oJnSJjAbN+K2gxSwA9U8a4GFlJa1f0Wc+crsHMo4orylTChY8aSsk/fsbDpNDbhyznW1nHZvna+pI5w1U8clhd8++Klj2WPoS6c6CwdPkrYwnoiBZmq0fwvj4vahUd5sqAZm7p6JazvNpFEM+UFiT58MXtZc2mx1NyAP4GuAjHVW4ZGeT9IFlfjcaT7m7ycJK/0MVPVIpRePY8uIO5l9cCUBwJxohCVreOhB7ymOArAfw7tfmtzx03hpVm0howYiNKnq97DDcgRYTMACYTCcQOZe8PKkO9B7LonPN970r7X7vw9CeBa4mEn0MNvKDfRsPCR7Bx9QVrZliggwCl0dbSpQ9U7axIKq8KQ== X-MS-TrafficTypeDiagnostic: AM6PR03MB5559:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UpooNLciWbfpV0KZTKk7I4aGWgI1LI85XQoSS0/u1jx/nJcYmJO6XNqK0CN9ccP0yK7H0BoYFwa/H3p0Psu+UuLxFVjHMRUjnFjPGMsDfL8Xv6/2OMjKhW+Ctft/rrT2hJ+MWxfS4q3sX5H8tdx0d//8RT09DkepD/+K3Ba8VaKLdvYUHKCPZIegLYqsEJwxeR849qXWLlHehnmd9d1t5S8h3YR02KRrk/7fyvQk+WfVgxtbV7S6wt35hJVsmtuKlh1Zju/R/gzKVKbjI21XJYJ9gtI6b+brXM2/e/haUWbhtaNLS23YU3qBz8BpIpYQfFnt5cJU03+EkSDCz43swB1dNJjXRYybN+BOlLhkcQVlPbxJ72d1zPKxO+jy2s0rJAVysnuWZulDYxfBdSpoRH4WB0nCq3S6y9CUS9D+iGEsOxjRipLg+GnbPbS1AywvraKYDaETSJby4I2DYn775AkO6FSBZ9J1bejb6ZDfJwgtO0lrnyX1tAOOGGhS8/PRcvZ/fCP/L6+nGor2Lj+cj3Q0ofKzjnydDmALNqletpePTIWCeQJEHwPnk7BmQJzN0oIcuLWq3aKm6v6wfEqUDg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C03jWf3fNYy03zpvH6IBHIdVdWg6ZwDOAq2HoBjuCEs7c8Fzimi7nCPERhZeJ3kWZb43EXpVghih9WttHL9Bg4dZT3Dn9qDLI1bnlxaU71FEPzgE8qi01yfuYFMx8wzJwXj8QH5UOGtTVZAlMaFcXJgHCN6tBLtNKMlsyJQUO0hjaHtGFk4mlbe6/63Fk3aFsC0FVYeMtbI3Hia68Z6bzoRdm/fRV2lSh8H8E5QxEziCbdqUAWKeKKn4w8ulc+cDmyLVan5DSodPYA4N9Ans7ZJd9aY07MykZbSAKZspJFDsmnHVLGADgVc9tlRF52TEeQK86c8yl2TKEjBix9Z/T0N7eTGdDFt6Ud6TjZKW3csn0+bG8hyLQgheDPClLkShV1KHTuTY7Pom9BG7rCnvuAJ96RkZv757ZHsalAfuYswgmcCmwmd3COV0MAy6fcQd7a4tkwwL6nL6osL/JT9t2RyOKsQrsfVTK5ZWzEBXMiqQR6WpDDGVnFcULfjD/lcz6/2EkKmndjZqM0DyxW2yEOxfAdNLWOqTJEdO/0iIa5rJWkPWDfv8DrBoK7knWqyEegf3jCZA124sannX4dc2glvpRvOLumF+0738dCdoUXAFwYNdq3acx+hXJk1v19XEp4WuAG3+vjiXXd3eHC+QRjsaSvtLGd9xVm4VzLikmE6jWOFPb1Qiva5kDOdNEPljE3R+ItDZUFOTsZEytl+E9iod+GnJI3eqRAaHFaTqQgZRAdqooH2zAlcAMOdWgUdY4sgsx2186UYXmmfrNfebr5NDqLxYi2ImfAKRxYBaxeroLa/RbU06Hp39Yc7V9cmyYZPGRPGzSlI+dwcCiRtAHUQkvZxYNjfLgTE2ROsTvRz7NNhrjGkN7yRmZhwzBnMz84kSJXEXfQnnwwE0Qx5Yx4G0E21HuD9szJUYa/9FSR/8ZB2wgiKfGjSk6n/5Ntfq1Z599sWGlUvrsCq/kOtzKw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df9d2ba8-8d92-47ad-d0c3-08d9e9d4ef41 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2022 00:58:20.7760 (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: AM6PR03MB5559 Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/thread: Move ff_thread_(await|report)_progress to new header 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: JMu/u3sWzssD This is in preparation for further commits that will stop using ThreadFrame for frame-threaded codecs that don't use ff_thread_(await|report)_progress(); the API for those codecs having inter-frame dependencies will live in threadframe.h. Signed-off-by: Andreas Rheinhardt --- libavcodec/error_resilience.c | 2 +- libavcodec/ffv1dec.c | 1 + libavcodec/h264_direct.c | 2 +- libavcodec/h264_mb.c | 2 +- libavcodec/h264_picture.c | 2 +- libavcodec/h264_slice.c | 2 +- libavcodec/h264dec.c | 2 +- libavcodec/hevc_filter.c | 1 + libavcodec/hevc_mvs.c | 1 + libavcodec/hevc_refs.c | 1 + libavcodec/hevcdec.c | 1 + libavcodec/mimic.c | 1 + libavcodec/mpeg4videodec.c | 2 +- libavcodec/mpegvideo.c | 2 +- libavcodec/mpegvideo_dec.c | 2 +- libavcodec/pngdec.c | 1 + libavcodec/pthread_frame.c | 1 + libavcodec/rv34.c | 2 +- libavcodec/thread.h | 26 ----------------- libavcodec/threadframe.h | 53 +++++++++++++++++++++++++++++++++++ libavcodec/utils.c | 1 + libavcodec/vp3.c | 1 + libavcodec/vp8.c | 1 + libavcodec/vp9.c | 1 + libavcodec/vp9block.c | 1 + libavcodec/vp9mvs.c | 1 + libavcodec/vp9recon.c | 1 + libavcodec/wavpack.c | 1 + 28 files changed, 79 insertions(+), 36 deletions(-) create mode 100644 libavcodec/threadframe.h diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 91cd8a4444..551ef914ce 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -34,7 +34,7 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "rectangle.h" -#include "thread.h" +#include "threadframe.h" /** * @param stride the number of MVs to get to the next row diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 810b2e18f0..3f90a8fb55 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -37,6 +37,7 @@ #include "golomb.h" #include "mathops.h" #include "ffv1.h" +#include "threadframe.h" static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed) diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index 93c2e1e438..014491e29b 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -30,7 +30,7 @@ #include "h264_ps.h" #include "mpegutils.h" #include "rectangle.h" -#include "thread.h" +#include "threadframe.h" #include diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c index 3cd17b7e4b..0b31774556 100644 --- a/libavcodec/h264_mb.c +++ b/libavcodec/h264_mb.c @@ -34,7 +34,7 @@ #include "h264dec.h" #include "h264_ps.h" #include "qpeldsp.h" -#include "thread.h" +#include "threadframe.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, int n, int height, int y_offset, int list) diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index dcd5874c2e..50a21c260f 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -30,7 +30,7 @@ #include "avcodec.h" #include "h264dec.h" #include "mpegutils.h" -#include "thread.h" +#include "threadframe.h" void ff_h264_unref_picture(H264Context *h, H264Picture *pic) { diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index dc636c5e78..600a109889 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -45,7 +45,7 @@ #include "mathops.h" #include "mpegutils.h" #include "rectangle.h" -#include "thread.h" +#include "threadframe.h" static const uint8_t field_scan[16+1] = { 0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4, diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index a47caa95e8..1d648f04b7 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -46,7 +46,7 @@ #include "mpegutils.h" #include "profiles.h" #include "rectangle.h" -#include "thread.h" +#include "threadframe.h" const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 }; diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c index 3c45b5a39e..1ef214b0ff 100644 --- a/libavcodec/hevc_filter.c +++ b/libavcodec/hevc_filter.c @@ -26,6 +26,7 @@ #include "libavutil/internal.h" #include "hevcdec.h" +#include "threadframe.h" #define LUMA 0 #define CB 1 diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c index 1f6ca5a314..7477efcf52 100644 --- a/libavcodec/hevc_mvs.c +++ b/libavcodec/hevc_mvs.c @@ -23,6 +23,7 @@ #include "hevc.h" #include "hevcdec.h" +#include "threadframe.h" static const uint8_t l0_l1_cand_idx[12][2] = { { 0, 1, }, diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c index 06e42d9c53..d0a7888e21 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -28,6 +28,7 @@ #include "thread.h" #include "hevc.h" #include "hevcdec.h" +#include "threadframe.h" void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags) { diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 8d7a4f7147..6d86a5bfdb 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -45,6 +45,7 @@ #include "hevcdec.h" #include "hwconfig.h" #include "profiles.h" +#include "threadframe.h" const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 }; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index ade973d860..6a51da5748 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -35,6 +35,7 @@ #include "hpeldsp.h" #include "idctdsp.h" #include "thread.h" +#include "threadframe.h" #define MIMIC_HEADER_SIZE 20 #define MIMIC_VLC_BITS 11 diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 2aea845580..655be5697d 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -38,7 +38,7 @@ #include "h263.h" #include "h263dec.h" #include "profiles.h" -#include "thread.h" +#include "threadframe.h" #include "xvididct.h" #include "unary.h" diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index bbcf00b014..14768ca8e8 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -43,7 +43,7 @@ #include "mpeg4video.h" #include "mpegvideodata.h" #include "qpeldsp.h" -#include "thread.h" +#include "threadframe.h" #include "wmv2.h" #include diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 1e238bd1e1..57465e41a0 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -31,7 +31,7 @@ #include "internal.h" #include "mpegutils.h" #include "mpegvideo.h" -#include "thread.h" +#include "threadframe.h" void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) { diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 3c00007907..3b12f4057a 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -36,6 +36,7 @@ #include "png.h" #include "pngdsp.h" #include "thread.h" +#include "threadframe.h" #include diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 43e097ff06..73dc4d3669 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -32,6 +32,7 @@ #include "internal.h" #include "pthread_internal.h" #include "thread.h" +#include "threadframe.h" #include "version.h" #include "libavutil/avassert.h" diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index e68072de06..febd41f577 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -41,7 +41,7 @@ #include "mpeg_er.h" #include "qpeldsp.h" #include "rectangle.h" -#include "thread.h" +#include "threadframe.h" #include "rv34vlc.h" #include "rv34data.h" diff --git a/libavcodec/thread.h b/libavcodec/thread.h index d7d2ddd8f1..091dc8a35e 100644 --- a/libavcodec/thread.h +++ b/libavcodec/thread.h @@ -70,32 +70,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, */ void ff_thread_finish_setup(AVCodecContext *avctx); -/** - * Notify later decoding threads when part of their reference picture is ready. - * Call this when some part of the picture is finished decoding. - * Later calls with lower values of progress have no effect. - * - * @param f The picture being decoded. - * @param progress Value, in arbitrary units, of how much of the picture has decoded. - * @param field The field being decoded, for field-picture codecs. - * 0 for top field or frame pictures, 1 for bottom field. - */ -void ff_thread_report_progress(ThreadFrame *f, int progress, int field); - -/** - * Wait for earlier decoding threads to finish reference pictures. - * Call this before accessing some part of a picture, with a given - * value for progress, and it will return after the responsible decoding - * thread calls ff_thread_report_progress() with the same or - * higher value for progress. - * - * @param f The picture being referenced. - * @param progress Value, in arbitrary units, to wait for. - * @param field The field being referenced, for field-picture codecs. - * 0 for top field or frame pictures, 1 for bottom field. - */ -void ff_thread_await_progress(ThreadFrame *f, int progress, int field); - #if FF_API_THREAD_SAFE_CALLBACKS /** * Wrapper around get_format() for frame-multithreaded codecs. diff --git a/libavcodec/threadframe.h b/libavcodec/threadframe.h new file mode 100644 index 0000000000..c2caf511b9 --- /dev/null +++ b/libavcodec/threadframe.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022 Andreas Rheinhardt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_THREADFRAME_H +#define AVCODEC_THREADFRAME_H + +#include "avcodec.h" +#include "thread.h" + +/** + * Notify later decoding threads when part of their reference picture is ready. + * Call this when some part of the picture is finished decoding. + * Later calls with lower values of progress have no effect. + * + * @param f The picture being decoded. + * @param progress Value, in arbitrary units, of how much of the picture has decoded. + * @param field The field being decoded, for field-picture codecs. + * 0 for top field or frame pictures, 1 for bottom field. + */ +void ff_thread_report_progress(ThreadFrame *f, int progress, int field); + +/** + * Wait for earlier decoding threads to finish reference pictures. + * Call this before accessing some part of a picture, with a given + * value for progress, and it will return after the responsible decoding + * thread calls ff_thread_report_progress() with the same or + * higher value for progress. + * + * @param f The picture being referenced. + * @param progress Value, in arbitrary units, to wait for. + * @param field The field being referenced, for field-picture codecs. + * 0 for top field or frame pictures, 1 for bottom field. + */ +void ff_thread_await_progress(ThreadFrame *f, int progress, int field); + +#endif diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b19befef21..0fd4469a74 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -38,6 +38,7 @@ #include "codec.h" #include "hwconfig.h" #include "thread.h" +#include "threadframe.h" #include "internal.h" #include "put_bits.h" #include "raw.h" diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 791e531862..06b0e873b6 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -43,6 +43,7 @@ #include "internal.h" #include "mathops.h" #include "thread.h" +#include "threadframe.h" #include "videodsp.h" #include "vp3data.h" #include "vp4data.h" diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index a70d94bd82..6aba0c5feb 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -33,6 +33,7 @@ #include "mathops.h" #include "rectangle.h" #include "thread.h" +#include "threadframe.h" #include "vp8.h" #include "vp8data.h" diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 24841c5b9f..1250425dce 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -27,6 +27,7 @@ #include "internal.h" #include "profiles.h" #include "thread.h" +#include "threadframe.h" #include "pthread_internal.h" #include "videodsp.h" diff --git a/libavcodec/vp9block.c b/libavcodec/vp9block.c index 5e6cded2bc..5fdda63545 100644 --- a/libavcodec/vp9block.c +++ b/libavcodec/vp9block.c @@ -23,6 +23,7 @@ #include "libavutil/avassert.h" +#include "threadframe.h" #include "vp56.h" #include "vp9.h" #include "vp9data.h" diff --git a/libavcodec/vp9mvs.c b/libavcodec/vp9mvs.c index 88db1c341c..3c4491f407 100644 --- a/libavcodec/vp9mvs.c +++ b/libavcodec/vp9mvs.c @@ -22,6 +22,7 @@ */ #include "internal.h" +#include "threadframe.h" #include "vp56.h" #include "vp9.h" #include "vp9data.h" diff --git a/libavcodec/vp9recon.c b/libavcodec/vp9recon.c index 503091e545..bfafde8c9c 100644 --- a/libavcodec/vp9recon.c +++ b/libavcodec/vp9recon.c @@ -24,6 +24,7 @@ #include "libavutil/avassert.h" #include "libavutil/mem_internal.h" +#include "threadframe.h" #include "videodsp.h" #include "vp9data.h" #include "vp9dec.h" diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 6b2ec19bf1..5a338d7658 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -29,6 +29,7 @@ #include "get_bits.h" #include "internal.h" #include "thread.h" +#include "threadframe.h" #include "unary.h" #include "wavpack.h" #include "dsd.h"