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 DD2BF43DA0 for ; Wed, 10 Aug 2022 22:18:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D07968B8C8; Thu, 11 Aug 2022 01:18:51 +0300 (EEST) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE42668B630 for ; Thu, 11 Aug 2022 01:18:44 +0300 (EEST) Received: by mail-ua1-f43.google.com with SMTP id cd25so3874410uab.8 for ; Wed, 10 Aug 2022 15:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=beXOrpJPC2paAxyltcm+hFl0WCNAE0rwwfHqzag68Rc=; b=TLdL0tR4D5b150vTahIvX3fks10EFp7jwYt3lT9D8KRYlzOKq2guIvF9B5NYPpMobe vPk1o6/l9bSf9iAf37B8yZqMzi3jCx1PMsLlO5ZYZs7sKslQBgfXYjS2RAgYH2sMJxkW 6GZsGLrd2fmCxC1G7NSBzmMf3WSdBOWanGCMzgy6sbGAWREg1v7laJNc3VyVdUIhMSIC ZKOOUOfrlc9nFVe2i/J7o4Kao5+v8Mpf3pGik03mSyhD9+4KMviLW48DIxOU6mwUR6FR vvDtzZJ/bOrYljvDVitq3r2niFhljLEhUr/H7eZe1LNmKiy27Toy4fOco7rfmeakWuTR valw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=beXOrpJPC2paAxyltcm+hFl0WCNAE0rwwfHqzag68Rc=; b=CISQEdM2m2c36tTT92Pz66F2uO67HNQVdmLbiPMCyQR2b2l6pirdnUg6gmK6phR+7o vdYSjbZGOjtYbsbbL2Sbkh7JnLeeAFnzoGZr6r0ZQlm2MFp4peLYIsKB6zHzMVViEG9/ Y8wmwiX+VFNOMim89rFSl1SQgzqeZxcED7hOQ+9+MQg197CfPyqDjy4PGo5l1EVorJEw CZ887QXi8+TtEzVPwQQrnBoAwazXgPi4ssTKgNdbA6xFAmddjPHYnTQa/WRu0QG10YIA uo5aRIz98hrx9gaKPsTnQRG2klv2G6zDXeQqyPHH9FldM1nBhd959057Y2UOBKcfWS4z x/Mg== X-Gm-Message-State: ACgBeo3Qliz2XQ5uX/eitQl4tUdaA26Vnx9Rjsz4juuQwILQeZ4YQlro bRY4DgM/aP8ks09ScDPuOOASuIp5F9A= X-Google-Smtp-Source: AA6agR4oCtz0YpTD/C1vPDLsa6Xf/MppQQJEdK2YmPZAsuUAq03qsxL16C1CMl7aImcmdauslBZw1g== X-Received: by 2002:ab0:6512:0:b0:38c:9786:a213 with SMTP id w18-20020ab06512000000b0038c9786a213mr7672793uam.40.1660169923194; Wed, 10 Aug 2022 15:18:43 -0700 (PDT) Received: from [192.168.0.11] ([186.136.131.204]) by smtp.gmail.com with ESMTPSA id c8-20020ab03488000000b003842250a024sm14193728uar.10.2022.08.10.15.18.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 15:18:42 -0700 (PDT) Message-ID: Date: Wed, 10 Aug 2022 19:18:41 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220810204712.3123-1-timo@rothenpieler.org> <20220810204712.3123-6-timo@rothenpieler.org> <423b2beb-9ad6-003e-be31-e3237f9f9788@rothenpieler.org> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 06/11] avutil/half2float: adjust conversion of NaN 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: On 8/10/2022 7:14 PM, Mark Reid wrote: > On Wed, Aug 10, 2022 at 2:53 PM Timo Rothenpieler > wrote: > >> On 10.08.2022 23:43, Andreas Rheinhardt wrote: >>> Timo Rothenpieler: >>>> On 10.08.2022 23:24, Andreas Rheinhardt wrote: >>>>> Timo Rothenpieler: >>>>>> IEEE-754 differentiates two different kind of NaNs. >>>>>> Quiet and Signaling ones. They are differentiated by the MSB of the >>>>>> mantissa. >>>>>> >>>>>> For whatever reason, actual hardware conversion of half to single >> always >>>>>> sets the signaling bit to 1 if the mantissa is != 0, and to 0 if it's >> 0. >>>>>> So our code has to follow suite or fate-testing hardware float16 will >> be >>>>>> impossible. >>>>> >>>>> What does the exr spec say about quiet and signaling nans? >>>> >>>> Not sure how exr would be involved here. >>> >>> Your patch changes the output of an exr-test. The output of the exr >>> decoder is presumably determined by the exr spec. There is after all the >>> possibility that what hardware does in hardware and what this patch does >>> in software is incompatible with what exr specifies. >> >> The exr spec just says something along the lines of analogous to >> ieee-754 floats: >> >> https://openexr.readthedocs.io/en/latest/TechnicalIntroduction.html?highlight=ieee#the-half-data-type >> It barely ever mentions NaNs, other than that they exist. Which makes >> sense, given they don't typically appear in images. >> >> The only output changed is that for how NaNs are converted. >> And given the cross-validation with multiple hardware implementations, >> I'm confident that it's correct. >> > > here is openexr implementation > https://github.com/AcademySoftwareFoundation/Imath/blob/main/src/Imath/toFloat.cpp#L78 > It has been a while since I check but I believe the current implementation > matches this. > > The fate sample: rgb_scanline_zip_half_float_0x0_to_0xFFFF.exr was created > to test this. > it contains every possible float16 value Then maybe the current implementation should be moved back to exr (it used to be internal to exr until Paul made it standalone), so this lavu module can match the existing hardware implementations of IEEE-734 half floats for the purpose of relevant pixel format support. _______________________________________________ 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".