From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1452948439 for ; Wed, 3 Jan 2024 11:20:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7005D68CC3D; Wed, 3 Jan 2024 13:20:25 +0200 (EET) Received: from mailout03.t-online.de (mailout03.t-online.de [194.25.134.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5CB0268C49C for ; Wed, 3 Jan 2024 13:20:18 +0200 (EET) Received: from fwd70.aul.t-online.de (fwd70.aul.t-online.de [10.223.144.96]) by mailout03.t-online.de (Postfix) with SMTP id 8F044483F8 for ; Wed, 3 Jan 2024 12:20:17 +0100 (CET) Received: from [192.168.178.21] ([91.60.179.66]) by fwd70.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1rKzIG-03QYnx0; Wed, 3 Jan 2024 12:20:16 +0100 To: ffmpeg-devel@ffmpeg.org References: <20240101193859.1038078-2-stefasab@gmail.com> From: Michael Koch Message-ID: Date: Wed, 3 Jan 2024 12:20:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20240101193859.1038078-2-stefasab@gmail.com> X-TOI-EXPURGATEID: 150726::1704280816-327FB937-B9B3F402/0/0 CLEAN NORMAL X-TOI-MSGID: b8fe099e-e4c3-4402-a40e-7ae0d53dfab8 Subject: Re: [FFmpeg-devel] [PATCH 2/2] doc/utils/eval: clarify meaning of random* seed value 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > Possible address trac issue: > http://trac.ffmpeg.org/ticket/10763 I don't like the random generator as it is, because the first two random numbers are very close to zero, as can be shown with this command line: ffmpeg -loglevel repeat -f lavfi -i nullsrc=size=1x1,format=gray -vf "geq=lum='print(random(0));print(random(0));print(random(0));print(random(0))'" -frames 1 -y out.png 0.000000 0.000091 0.285346 0.929202 This behaviour can be improved by inizializing the generator with a large number as seed value. I'm not sure if it's a good idea to share the same variables for ld() and st() (as double) and random() (as unsigned int). Wouldn't it be better to use separate variables for random()? Michael _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".