From: Mark Reid <mindmark@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 06/11] avutil/half2float: adjust conversion of NaN Date: Wed, 10 Aug 2022 15:14:35 -0700 Message-ID: <CA+anCRnv-cg-cFf7k6L_eBOERxhROOWtAWJmr-0xGnQ1Sq95uA@mail.gmail.com> (raw) In-Reply-To: <f6b0af68-7169-434b-8dd3-a6257ac147ed@rothenpieler.org> On Wed, Aug 10, 2022 at 2:53 PM Timo Rothenpieler <timo@rothenpieler.org> 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 > _______________________________________________ > 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". > _______________________________________________ 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".
next prev parent reply other threads:[~2022-08-10 22:15 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-10 20:47 [FFmpeg-devel] [PATCH 01/11] lavu/pixfmt: add packed RGBA float16 format Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 02/11] avutil/hwcontext_d3d11va: add support for rgbaf16 pixel format Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 03/11] avfilter/vsrc_ddagrab: add rgbaf16 output support Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 04/11] avfilter/vsrc_ddagrab: add options for more control over output format fallback Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 05/11] avutil: move half-precision float helper to avutil Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 06/11] avutil/half2float: adjust conversion of NaN Timo Rothenpieler 2022-08-10 21:24 ` Andreas Rheinhardt 2022-08-10 21:36 ` Timo Rothenpieler 2022-08-10 21:43 ` Andreas Rheinhardt 2022-08-10 21:53 ` Timo Rothenpieler 2022-08-10 22:14 ` Mark Reid [this message] 2022-08-10 22:18 ` James Almer 2022-08-10 22:28 ` Timo Rothenpieler 2022-08-10 22:37 ` Mark Reid 2022-08-10 22:55 ` Timo Rothenpieler 2022-08-11 2:18 ` Mark Reid 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 07/11] avutil/half2float: move tables to header-internal structs Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 08/11] avutil/half2float: move non-inline init code out of header Timo Rothenpieler 2022-08-11 20:46 ` Michael Niedermayer 2022-08-11 20:50 ` Andreas Rheinhardt 2022-08-11 21:16 ` Michael Niedermayer 2022-08-11 21:31 ` Andreas Rheinhardt 2022-08-14 19:32 ` Michael Niedermayer 2022-08-15 4:20 ` Andreas Rheinhardt 2022-08-15 18:09 ` Michael Niedermayer 2022-08-14 21:54 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 09/11] avutil/half2float: use native _Float16 if available Timo Rothenpieler 2022-08-10 21:03 ` Andreas Rheinhardt 2022-08-10 21:58 ` Timo Rothenpieler 2022-08-10 22:02 ` James Almer 2022-08-10 22:51 ` [FFmpeg-devel] [PATCH v2 " Timo Rothenpieler 2022-08-11 0:14 ` James Almer 2022-08-11 11:50 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 10/11] swscale: add SwsContext parameter to input functions Timo Rothenpieler 2022-08-10 20:52 ` Timo Rothenpieler 2022-08-10 21:55 ` Andreas Rheinhardt 2022-08-10 22:02 ` Timo Rothenpieler 2022-08-10 20:47 ` [FFmpeg-devel] [PATCH 11/11] swscale/input: add rgbaf16 input support Timo Rothenpieler 2022-08-10 21:37 ` Timo Rothenpieler
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CA+anCRnv-cg-cFf7k6L_eBOERxhROOWtAWJmr-0xGnQ1Sq95uA@mail.gmail.com \ --to=mindmark@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git