On Fri, Apr 18, 2014 at 2:06 PM, Martin Storsjö <[email protected]> wrote:
> On Fri, 18 Apr 2014, Janne Grunau wrote:
>
>> On 2014-04-17 20:17:42 +0200, Anton Khirnov wrote:
>>>
>>>
>>> On Thu, 17 Apr 2014 12:57:35 +0200, Janne Grunau <[email protected]>
>>> wrote:
>>>>
>>>> On 2014-04-17 12:46:37 +0200, Anton Khirnov wrote:
>>>>>
>>>>> ---
>>>>>  tests/tiny_psnr.c |    5 +++++
>>>>>  1 file changed, 5 insertions(+)
>>>>>
>>>>> diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
>>>>> index 66eaf82..5f819bb 100644
>>>>> --- a/tests/tiny_psnr.c
>>>>> +++ b/tests/tiny_psnr.c
>>>>> @@ -223,6 +223,11 @@ int main(int argc, char *argv[])
>>>>>                      a = get_f32l(buf[0] + j);
>>>>>                      b = get_f32l(buf[1] + j);
>>>>>                  }
>>>>> +                if (isnan(a) || isnan(b)) {
>>>>> +                    fprintf(stderr, "Invalid values in the input.\n");
>>>>> +                    return 1;
>>>>> +                }
>>>>
>>>>
>>>> (-)inf is handled as expected? just asking since you asked about
>>>> isfinite
>>>> first
>>>>
>>>
>>> Actually no, seems I tested it wrong.
>>>
>>> When it's converted to fixed point, the inf becomes zero.
>>>
>>> Shall I use isfinite() or a separate isinf() call?
>>
>>
>> isfinite is nicer we could try our luck if everything supports that c99
>> feature. if you want to be careful use !isnan/!isinf. Testing the result
>> fabs(b - a) is preferable in that case.
>
>
> Unsurprisingly, MSVC has not got any of them (isinf, isnan, isfinite).
>

There is _isnan and _finite, not C99 names, but compatible functions.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to