From patchwork Mon Apr 8 20:13:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47953 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3f98:b0:1a7:a0dc:8de5 with SMTP id ay24csp136664pzb; Mon, 8 Apr 2024 13:17:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUe9tNX5lCiOsvJ2BnC5NlSjGG0JJy7SSoz8n2ag8rYazXb9T+C+vdElC7W3mNmfMpg45U8VZnnkPIFnC5V8MLWQOLcgpODFwmpOA== X-Google-Smtp-Source: AGHT+IHin3Qxq8Wy/JvKNEE7+jOLb1abT8A7t+Bj8BYLkr5n7kgN+DQiv9qiOMcihgs4OWF4XSki X-Received: by 2002:a05:6402:4313:b0:56e:3535:9617 with SMTP id m19-20020a056402431300b0056e35359617mr8119648edc.1.1712607423912; Mon, 08 Apr 2024 13:17:03 -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 b17-20020a056402351100b0056e59978b31si1614812edd.589.2024.04.08.13.17.03; Mon, 08 Apr 2024 13:17:03 -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=UB+XH9qd; 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 D4FF068D3F3; Mon, 8 Apr 2024 23:16:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2103.outbound.protection.outlook.com [40.92.59.103]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4EAD268D384 for ; Mon, 8 Apr 2024 23:15:58 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GtUDhr0eqb+xKBUOqvyuX1oHKCebIxVk1TJGvcNCaUi5UN1M3hLKV/nBfIux/ldakSJbJVfyY7TInrorCz4eHzWBxzXVa/IUwYDsOEy8BA/ZAxY5EqjsFFzYHSO13fr1jfoo8uhC942oWl0FqJKqKCkKmvGanNkTJJnKsi3HH/1PuA8kM8TCr6r1yvEktc6uOX+9C/vWIer4DbRr6/Odn2OuG/S6vIE2sXis3H168qXHIwJtfMyI464zCVEGoWXiguYT5eKWHp3sRmXpC15VO5O2Y/L4tGxwrJI/Y1Vpz2ME453kxbyW0Z2ePW8RkOK/jl5x2Ot7c8umyC9bNM7IQg== 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=EsBw+ypXyv+nfPTorNsHythTsZUDLpwBbfwmEahaRbg=; b=VRqBki3kMFwlhsjCNAPPwpo0D42tfWZO3Y4ZZLjFu+/kGKNHoJRHeWW94ILiIgSs5NbQboerjlM8pDCxWfrxSSKtQSSutAsXIXRoaGThO/Cmbjfq92wopksVJk8YdWsol/nN+kPrP59VgMOP6c1PQ3AXXTuYEgQJ44ffTdL6FTnGfULCUbu3atY0yzMN3Xwmh5ULvzXlW3V+ZRRv/lKX2tsK4nIcMrS3hqn3k+BgkmeNdrgnuskWFVP257a6PJ9VItozd9Hq888voyx5Ct6UFyTv6HJ2AG7NIxDO/eYJmDUAbUMCMEH3LBDlFxRmmXB/+0gV0sYbnYEceYWyUX1HoA== 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=EsBw+ypXyv+nfPTorNsHythTsZUDLpwBbfwmEahaRbg=; b=UB+XH9qdOZmTaMrvwVn35RXbroO7HynKZygrTuQcQFHbxMXzkhjuvCDFtQtJCFFqj4J3ud2h25Gpun5reoOwBlWQeADE+Qz4f3GMMHVHAXdjFf/wKKSw7ABAV1VL762CisMc5aj4Q1DQ7qN981F2odQx8vTWPhnhsADyVdirOsTQ/gxvwhHSCzMLSSpw137cuJG1G6b1sFDLpfCaAiHvkuDZdKhvuAQqIlBZphGxV33u6QKe1j874is+EsmikuhJzPZaiuCz9SRpkIusbdNWQRiClSU5PVcz5UXAOK/04KttO2oSam2UAPDdmYHcMdVYwXGrxzJYiMZfqLQJ8hTYoQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0494.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:28d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 8 Apr 2024 20:15:56 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7409.042; Mon, 8 Apr 2024 20:15:56 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 8 Apr 2024 22:13:56 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [SawCXj9wqInyRhWs0gRO0DyumyxeuXPlT98FjhXTZes=] X-ClientProxiedBy: ZR0P278CA0124.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::21) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240408201405.2136840-17-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0494:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bae50ee-7403-48d6-64ed-08dc5808b2d3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rUEYS5qELVsxgdl+5aGzG3p4W6HMOacw4uUv4S8s62dX46rEPEInTWz0bGFuD+sKAXqu2DVYhjkvu97P2pnndnDNO1p8uGJcSKANGZS04AYb3DDpnFmA6TUoRCbsld9h/iLKPwn0KwAPX8s15TReYLiOfSuI/zgk3SJSxoS6M7pjr0bb0+x9lZG2reyV+DICqr+mMKgNWTBoJwFOXjiJm4ploX5Eaxk5oAK30w07bmwwmTfBpwKAfR/+XYtPv4PitDs3nreEzynLNj+gsExAa6CMdclTGHIt+RCdapNyNgizRpKjrfcNtLpbeOS1oNyGZ5/eJ0cfjDvFqfwYuuB6Fer6xMRW8Gt1yhfs9c5f0Eaheeugwuyp13PixVSEQpB41UMagiFQ68Q/cTZUkcdInwmzkqZHGuIDXxAfPA69Ipu8ChW9KON/f8SeV/uW6GixnryRI6HqErR1ldnSGrJWfCNUNNtCHvujDjqeRWVkX1h5BzmJnIQ1So2QZzzhw3REXiyZQLtGz3RwRlq8hl5woh3sd7221U2e1eIozTvne7LIvisU+z/3rR0LcJWF/tct9IRBHw+INBuImcMFxACDUsJHmxPbqGciAqNwa0CPi0BHl/E0TR6iEGTVKooNCYxC X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oD1LigNeOncNXOIY6PSpbePFv3TCpw+uPNbDT8jpxjfPhJj283ImggS6kLDmWbPynnZvOD2IXhopQeYyUF7sexkDmOjMhy8oMswKk1iDGdevpVnoKxAYdsx5r5K6FpZoo8uIYepQrdQZ3TVq0DjPpahbFuLVxQyd6/i7k0lJ/C9DuOf7qTKmjXi47wlAYVzWB2MlkGqCUUUtGoEme3FXkGJUsYezvYQInHw0wjyVh7ZgemElm5O6WSzG6wYXF+/W/KUeRMDtj6P9LkRA8YGJTrk0OG6SI+HaZAXybCTGCdv8HLRCInTQJ0lCi+hpY0aVBfoHw8AzFBG4H/jHMc1FPd+dH9bzYzrKJlKA7XfLHkv0cI7a+Br/k2HYURWAB3KpdofUpqthNrj4cnwkYOjErVpEXmt939kEBP6VfxlVjEozggrrul+BaAT3GD/wLp089S1EwNtn8lh7/F47K5ZmS409iatAG9MZxrzdvNPpVn99aGlOah8yA8ED3vZHNopZcNRKWum0brQWqWtq/Ro/lBbO8/Wq38oYbUPy3NmBRQVIsurItGyNGHktQmYXpoZ/0cX3BhZZu9j2yZQWp7+QSQSwSId/X08qhhLEy/98ldL4Gvdf/WKNzD87YFiJXO/XSt8bBC80Md3UyuwO75bst3Io4H86DUlUnArDQFReOPql+rk/44RkqxkcgB92ggOb3UEOawwv50thbE+il9FtgueTgc/YU/ZVp9nZ5AzMbQpqSIO8zDLyP7Rm86VOFGinxcD3+bwTIjC0hM5WnPV2K52MEPbNs6QUMac24gy5ZwwAO4J6K7+3RIambyFvwIagTAR4l4IvaeeeXQ2PKRZFYTE9pxgR04vOl3x+1MxWuIrB3QnxOd5X/TZvIch64H9dEZt9agb/VJ8bBTPClPL0fZcU2zD8R05KCjMsg32ign9aA2+k8hiQCddnD1loDiL5lPKpKJ4I+FmUiKOJ9U8EQhz24LEIE10WzqXV5oj4F51JFQYF60rVnyn4UdLbaZLJVld8+mS9B9+oyWDCxsM8bI/Y2N8P6NtdRMjXTyFWdJffvk7USpC7lZb0UFtwWGF6ktBBbCM7Pm9D79HW4gbEWd4ZfCO/yJ71BRf0P29rznFLfG2yLsJKyues4suZ571FlCPg4g1IhC6YYXSHHbLJJjDGZH4TcQLvg3qIEXYwzYeqtmR73GDlvE7IbH9I3pAOjuupeb1YOjNl4p1DAuesmO9EoyRauCjymKkFHwGgooDzArzpMPElkwyEpwcZ7KSNWXMmbe9mvUfsmL4BxN+S5g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bae50ee-7403-48d6-64ed-08dc5808b2d3 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 20:15:56.4515 (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: PAXP250MB0494 Subject: [FFmpeg-devel] [PATCH v2 18/27] avcodec/codec_internal: Remove FF_CODEC_CAP_ALLOCATE_PROGRESS 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: DRe4UWo9LSD/ Before commit f025b8e110b36c1cdb4fb56c4cd57aeca1767b5b, every frame-threaded decoder used ThreadFrames, even when they did not have any inter-frame dependencies at all. In order to distinguish those decoders that need the AVBuffer for progress communication from those that do not (to avoid the allocation for the latter), the former decoders were marked with the FF_CODEC_CAP_ALLOCATE_PROGRESS internal codec cap. Yet distinguishing these two can be done in a more natural way: Don't use ThreadFrames when not needed and split ff_thread_get_buffer() into a core function that calls the user's get_buffer2 callback and a wrapper around it that also allocates the progress AVBuffer. This has been done in 02220b88fc38ef9dd4f2d519f5d3e4151258b60c and since that commit the ALLOCATE_PROGRESS cap was nearly redundant. The only exception was WebP and VP8. WebP can contain VP8 and uses the VP8 decoder directly (i.e. they share the same AVCodecContext). Both decoders are frame-threaded and VP8 has inter-frame dependencies (in general, not in valid WebP) and therefore the ALLOCATE_PROGRESS cap. In order to avoid allocating progress in case of a frame-threaded WebP decoder the cap and the check for the cap has been kept in place. Yet now the VP8 decoder has been switched to use ProgressFrames and therefore there is just no reason any more for this check and the cap. This commit therefore removes both. Also change the value of FF_CODEC_CAP_USES_PROGRESSFRAMES to leave no gaps. Signed-off-by: Andreas Rheinhardt --- doc/multithreading.txt | 15 +++++++-------- libavcodec/codec_internal.h | 7 +------ libavcodec/ffv1dec.c | 3 +-- libavcodec/h264dec.c | 2 +- libavcodec/hevcdec.c | 2 +- libavcodec/mpeg4videodec.c | 3 +-- libavcodec/pngdec.c | 3 +-- libavcodec/pthread_frame.c | 12 +++++------- libavcodec/rv30.c | 1 - libavcodec/rv40.c | 1 - libavcodec/tests/avcodec.c | 5 ----- 11 files changed, 18 insertions(+), 36 deletions(-) diff --git a/doc/multithreading.txt b/doc/multithreading.txt index 6c65ca9651..842d331e4f 100644 --- a/doc/multithreading.txt +++ b/doc/multithreading.txt @@ -36,9 +36,9 @@ Frame threading - * Codecs similar to ffv1, whose streams don't reset across frames, will not work because their bitstreams cannot be decoded in parallel. -* The contents of buffers must not be read before ff_thread_await_progress() +* The contents of buffers must not be read before ff_progress_frame_await() has been called on them. reget_buffer() and buffer age optimizations no longer work. -* The contents of buffers must not be written to after ff_thread_report_progress() +* The contents of buffers must not be written to after ff_progress_frame_report() has been called on them. This includes draw_edges(). Porting codecs to frame threading @@ -53,14 +53,13 @@ thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. -If there are inter-frame dependencies, so the codec calls -ff_thread_report/await_progress(), set FF_CODEC_CAP_ALLOCATE_PROGRESS in -FFCodec.caps_internal and use ff_thread_get_buffer() to allocate frames. -Otherwise decode directly into the user-supplied frames. +Use ff_thread_get_buffer() (or ff_progress_frame_get_buffer() +in case you have inter-frame dependencies and use the ProgressFrame API) +to allocate frame buffers. -Call ff_thread_report_progress() after some part of the current picture has decoded. +Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn't called anywhere, as it's useful too and the implementation is trivial when you're doing this. Note that draw_edges() needs to be called before reporting progress. -Before accessing a reference frame or its MVs, call ff_thread_await_progress(). +Before accessing a reference frame or its MVs, call ff_progress_frame_await(). diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 832e6440d7..1cd1f684f9 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -65,12 +65,7 @@ /** * The decoder might make use of the ProgressFrame API. */ -#define FF_CODEC_CAP_USES_PROGRESSFRAMES (1 << 11) -/* - * The codec supports frame threading and has inter-frame dependencies, so it - * uses ff_thread_report/await_progress(). - */ -#define FF_CODEC_CAP_ALLOCATE_PROGRESS (1 << 6) +#define FF_CODEC_CAP_USES_PROGRESSFRAMES (1 << 6) /** * Codec handles avctx->thread_count == 0 (auto) internally. */ diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index ba535e800d..dd594e3f9f 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -1129,6 +1129,5 @@ const FFCodec ff_ffv1_decoder = { UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 727dc1a662..6330fb9c48 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -1156,7 +1156,7 @@ const FFCodec ff_h264_decoder = { NULL }, .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, + FF_CODEC_CAP_INIT_CLEANUP, .flush = h264_decode_flush, UPDATE_THREAD_CONTEXT(ff_h264_update_thread_context), UPDATE_THREAD_CONTEXT_FOR_USER(ff_h264_update_thread_context_for_user), diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 727b02f0f4..cedd09fe14 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3715,7 +3715,7 @@ const FFCodec ff_hevc_decoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, + FF_CODEC_CAP_INIT_CLEANUP, .p.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_HEVC_DXVA2_HWACCEL diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 07de5d6d91..6a7a37e817 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3861,8 +3861,7 @@ const FFCodec ff_mpeg4_decoder = { FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 16e35a8cc6..5a99b4a1c4 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1940,7 +1940,6 @@ const FFCodec ff_apng_decoder = { UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_ICC_PROFILES, }; #endif @@ -1958,7 +1957,7 @@ const FFCodec ff_png_decoder = { UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES, }; #endif diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index e42a9563cd..4c073d5609 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -979,14 +979,12 @@ int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags) if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); - if (ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS) { - f->progress = ff_refstruct_allocz(sizeof(*f->progress)); - if (!f->progress) - return AVERROR(ENOMEM); + f->progress = ff_refstruct_allocz(sizeof(*f->progress)); + if (!f->progress) + return AVERROR(ENOMEM); - atomic_init(&f->progress->progress[0], -1); - atomic_init(&f->progress->progress[1], -1); - } + atomic_init(&f->progress->progress[0], -1); + atomic_init(&f->progress->progress[1], -1); ret = ff_thread_get_buffer(avctx, f->f, flags); if (ret) diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c index 9e13e71805..316962fbbb 100644 --- a/libavcodec/rv30.c +++ b/libavcodec/rv30.c @@ -304,5 +304,4 @@ const FFCodec ff_rv30_decoder = { AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index e48aa1f684..19d4e742df 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -582,5 +582,4 @@ const FFCodec ff_rv40_decoder = { AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index 58f54cac74..cd949f6385 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -142,7 +142,6 @@ int main(void){ } } if (codec2->caps_internal & (FF_CODEC_CAP_USES_PROGRESSFRAMES | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_EXPORTS_CROPPING | @@ -172,10 +171,6 @@ int main(void){ AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | AV_CODEC_CAP_ENCODER_FLUSH)) ERR("Decoder %s has encoder-only capabilities\n"); - if (codec2->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS && - !(codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)) - ERR("Decoder %s wants allocated progress without supporting" - "frame threads\n"); if (codec2->cb_type != FF_CODEC_CB_TYPE_DECODE && codec2->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS) ERR("Decoder %s is marked as setting pkt_dts when it doesn't have"