From patchwork Fri Jul 7 23:45:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4264 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp791327vsb; Fri, 7 Jul 2017 16:45:43 -0700 (PDT) X-Received: by 10.223.155.205 with SMTP id e13mr2031796wrc.33.1499471143677; Fri, 07 Jul 2017 16:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499471143; cv=none; d=google.com; s=arc-20160816; b=sXy1F4gl5bmMvGPaWxm5q9Jnv4ga3uFN8AgFIEBJybwKLlCecQnJbH+PTK9KpNnXpq 7wS0C93pgwm+8/3AF6JkfOZ4VBvMXXajdGc4HizMjSJYa+tun9IvGlipS7V8ZJ+tf2zV /XDYtYyXchhUW+eBn2s87LVL+dWKuh0fT80TF5NTOSbfkBAuap1opfK0iNjOYao0boF6 G6uGz5AvbWLiZqny2Ni6PkU3pSAXjgq4Hq1VSF1cpX9YovA0i+STUar7gfV8aZstd4AO HnAIWjIVBLlOUMRwnPSMTplOBJroTGWa0ziEs7D6LOhTP5a8sb2euVaYDdVCtfowXnc2 6kmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :in-reply-to:mime-version:references:message-id:to:from:date :delivered-to:arc-authentication-results; bh=LiPq3Bsj/JD2eyOhdW5WoOaZlYVnVsNW4KZYU15Z41M=; b=sgo9JVlp0LtKX3YCsfxAvF4vbBO2KVaudYT0hpE2nu+f7iGTQ9ql9JbD07xuEQc8d3 DQgUJCDJLWf4okuGGjOwOtRvW0J7Ey6VhxNVZrkJKdgSGQZD3gBvELzT9b8dfxhlgZGO OyDsh3tgl08MSGzR+U/6el+izkMUkdn0LKnkOZOsODXXUq0wLy0PdYwRj0iaF87M5DMR u5QK1OFre/mKbuSKSEgZwA2hAYQ+TYj2b6eyCyvdPMXdwI9z4WmJGSgxCluS8ZyzbiM/ nLQnjIsaiXDkHOSkNqz7TvRzaUpE0TJAgQY7N94S8DzX2dNwQE/Jfdp9Jux4Pcgx2cf7 Q7fQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y189si678654wme.66.2017.07.07.16.45.42; Fri, 07 Jul 2017 16:45:43 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6C559689B64; Sat, 8 Jul 2017 02:45:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67FC56883AE for ; Sat, 8 Jul 2017 02:45:29 +0300 (EEST) Received: from mfilter17-d.gandi.net (mfilter17-d.gandi.net [217.70.178.145]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 24E25A80CB for ; Sat, 8 Jul 2017 01:45:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter17-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter17-d.gandi.net (mfilter17-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id t9YWIjsdqYe5 for ; Sat, 8 Jul 2017 01:45:30 +0200 (CEST) X-Originating-IP: 213.47.41.20 Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 7411CA80C0 for ; Sat, 8 Jul 2017 01:45:30 +0200 (CEST) Date: Sat, 8 Jul 2017 01:45:06 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20170707234506.GU4727@nb4> References: <20170707140438.15026-1-mfcc64@gmail.com> MIME-Version: 1.0 In-Reply-To: <20170707140438.15026-1-mfcc64@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter/pthread: rewrite implementation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On Fri, Jul 07, 2017 at 09:04:37PM +0700, Muhammad Faiz wrote: > Avoid pthread_cond_broadcast that wakes up all workers. Make each of them > uses distict mutex/cond. Also let main thread help running jobs. > > Benchmark using afir with threads=5 and 4096 taps fir: > channels=1: > old: > 1849650 decicycles in afir_execute, 2 runs, 0 skips > 1525719 decicycles in afir_execute, 1024 runs, 0 skips > 1546032 decicycles in afir_execute, 16356 runs, 28 skips > new: > 1495525 decicycles in afir_execute, 2 runs, 0 skips > 968897 decicycles in afir_execute, 1024 runs, 0 skips > 941286 decicycles in afir_execute, 16384 runs, 0 skips > > channels=2: > old: > 3135485 decicycles in afir_execute, 2 runs, 0 skips > 1967158 decicycles in afir_execute, 1024 runs, 0 skips > 1802430 decicycles in afir_execute, 16364 runs, 20 skips > new: > 1864750 decicycles in afir_execute, 2 runs, 0 skips > 1437792 decicycles in afir_execute, 1024 runs, 0 skips > 1183963 decicycles in afir_execute, 16382 runs, 2 skips > > channels=4: > old: > 4879925 decicycles in afir_execute, 2 runs, 0 skips > 3557950 decicycles in afir_execute, 1022 runs, 2 skips > 3206843 decicycles in afir_execute, 16379 runs, 5 skips > new: > 2962320 decicycles in afir_execute, 2 runs, 0 skips > 2450430 decicycles in afir_execute, 1024 runs, 0 skips > 2446219 decicycles in afir_execute, 16383 runs, 1 skips > > channels=8: > old: > 6032455 decicycles in afir_execute, 2 runs, 0 skips > 4838614 decicycles in afir_execute, 1023 runs, 1 skips > 4720760 decicycles in afir_execute, 16369 runs, 15 skips > new: > 5228150 decicycles in afir_execute, 2 runs, 0 skips > 4592129 decicycles in afir_execute, 1023 runs, 1 skips > 4469067 decicycles in afir_execute, 16383 runs, 1 skips this causes a strange change: ./ffmpeg -i ~/videos/matrixbench_mpeg2.mpg -vcodec libxavs -vf scale=80x60 -t 1 file3.nut results in different files before and after this patch. Neither plays i suspect this is not a bug in the patch but something odd elsewhere but i dont know -rw-r----- 1 michael michael 57671 Jul 8 00:48 file3.nut -rw-r----- 1 michael michael 62162 Jul 8 00:48 file3p.nut framecrc difference of video with -vcodec copy -copyinkf -f framecrc [...] --- a 2017-07-08 01:41:49.717555033 +0200 +++ b 2017-07-08 01:42:09.877555273 +0200 @@ -5,28 +5,28 @@ #dimensions 0: 80x60 #sar 0: 1/1 0, 0, 0, 2048, 1860, 0xaa19412e, F=0x0 -0, 2048, 2048, 2048, 1261, 0xd0bd2d34, F=0x0 -0, 4096, 4096, 2048, 1261, 0x30083a11, F=0x0 -0, 6144, 6144, 2048, 1347, 0xfd5b5c17, F=0x0 -0, 8192, 8192, 2048, 933, 0x3e95a0aa, F=0x0 -0, 10240, 10240, 2048, 1299, 0x5fd141e1, F=0x0 -0, 12288, 12288, 2048, 1311, 0xcb90563e, F=0x0 -0, 14336, 14336, 2048, 1288, 0x55553cee, F=0x0 -0, 16384, 16384, 2048, 1295, 0x68d34476, F=0x0 -0, 18432, 18432, 2048, 1397, 0xf0646699, F=0x0 -0, 20480, 20480, 2048, 1353, 0xbd0557f9, F=0x0 -0, 22528, 22528, 2048, 1358, 0x90095601, F=0x0 -0, 24576, 24576, 2048, 2004, 0x8de57d88, F=0x0 -0, 26624, 26624, 2048, 1477, 0x6c099b28, F=0x0 -0, 28672, 28672, 2048, 1515, 0x2fd78855, F=0x0 +0, 2048, 2048, 2048, 1827, 0x1a47f795, F=0x0 +0, 4096, 4096, 2048, 1379, 0x50435dbb, F=0x0 +0, 6144, 6144, 2048, 1912, 0x9b2529a8, F=0x0 +0, 8192, 8192, 2048, 1052, 0x6fe1ce3b, F=0x0 +0, 10240, 10240, 2048, 1862, 0x10e30eae, F=0x0 +0, 12288, 12288, 2048, 1432, 0x93858555, F=0x0 +0, 14336, 14336, 2048, 1850, 0xaf3b039d, F=0x0 +0, 16384, 16384, 2048, 1408, 0x049e668a, F=0x0 +0, 18432, 18432, 2048, 1956, 0x751c36c6, F=0x0 +0, 20480, 20480, 2048, 1465, 0xb6e58045, F=0x0 +0, 22528, 22528, 2048, 1916, 0x22dc1fe7, F=0x0 +0, 24576, 24576, 2048, 2038, 0x56548c7c, F=0x0 +0, 26624, 26624, 2048, 1490, 0x7e42a072, F=0x0 +0, 28672, 28672, 2048, 1521, 0x6e128b71, F=0x0 0, 30720, 30720, 2048, 1523, 0xa5819af8, F=0x0 0, 32768, 32768, 2048, 1528, 0x9898a156, F=0x0 -0, 34816, 34816, 2048, 1601, 0x9873cdf4, F=0x0 +0, 34816, 34816, 2048, 1613, 0x5e97d399, F=0x0 0, 36864, 36864, 2048, 1597, 0xf02ad0e6, F=0x0 -0, 38912, 38912, 2048, 1620, 0x4da2da72, F=0x0 -0, 40960, 40960, 2048, 1668, 0xb794dc64, F=0x0 +0, 38912, 38912, 2048, 1625, 0x9bdddcbb, F=0x0 +0, 40960, 40960, 2048, 1673, 0x0a11de8f, F=0x0 0, 43008, 43008, 2048, 1678, 0xd81de01a, F=0x0 0, 45056, 45056, 2048, 1647, 0x5ca1d51c, F=0x0 -0, 47104, 47104, 2048, 1643, 0x8010d916, F=0x0 -0, 49152, 49152, 2048, 2118, 0x985ea130, F=0x0 +0, 47104, 47104, 2048, 1655, 0xca23ddf2, F=0x0 +0, 49152, 49152, 2048, 2158, 0x4619aaac, F=0x0 0, 49153, 49153, 2048, 4, 0x00b300b2, F=0x0