psnr range

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

psnr range

Le Chiffre
I have found that the psnr result from the psnr filter, vs the psnr that is
part of libvmaf (calling it via ffmpeg), differs slightly, generally under
1%. I suppose the implementation is different.

This seems ok. What is more interesting is that libvmaf-psnr clearly has a
range up to 60 whereas the ffmpeg psnr seems to go past 90.

1. What's the full range of ffmpeg's psnr value?

2. Is it likely that libvmaf is simply capping the result to 60? Since for
their purposes this might be the limit of perception?

If I take an average over a 15 minute video, I get a 2.3% difference
(ffmpeg is higher), ignoring frames where ffmpeg reports inf psnr. If I cap
to 60, the difference in averages is just 0.01, so this is negligible. But
that's because the number of nearly identical frames (runs of complete
black) is so small.

Should I really just not worry about it?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: psnr range

Carl Eugen Hoyos-2
Am Di., 25. Juni 2019 um 22:00 Uhr schrieb Le Chiffre
<[hidden email]>:
>
> I have found that the psnr result from the psnr filter, vs the psnr that is
> part of libvmaf (calling it via ffmpeg), differs slightly, generally under
> 1%. I suppose the implementation is different.
>
> This seems ok. What is more interesting is that libvmaf-psnr clearly has a
> range up to 60 whereas the ffmpeg psnr seems to go past 90.
>
> 1. What's the full range of ffmpeg's psnr value?

The source code contains the following line in vf_psnr.c:
return 10.0 * log10(pow_2(max) / (mse / nb_frames))
so a likely range is 0-100

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: psnr range

Nicolas George
Carl Eugen Hoyos (12019-06-26):
> The source code contains the following line in vf_psnr.c:
> return 10.0 * log10(pow_2(max) / (mse / nb_frames))
> so a likely range is 0-100

You are reading the formula upside down: x/max would have a range [0;1]
(possibly later converted to a percentage), but max/x has range [1;+∞].
And indeed, +∞ is a possible value for lossless encoding.

Then the logarithm turns the range to [0:+∞].

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: psnr range

Le Chiffre
Thanks. For reference, yes libvmaf does limit the psnr. 60dB for 8-bit
video, 72dB for 10-bit. Google tells me that indeed, 60dB is the limit of
visual perception, give or take.

The computation is the same:

    double eps = 1e-10;
    *score = MIN(10 * log10(peak * peak / MAX(noise_, eps)), psnr_max);

I assume ffmpeg also has a floor value for MSE, to prevent divide-by-zero,
just not seen in the snippet posted.

On Wed, Jun 26, 2019 at 1:26 AM Nicolas George <[hidden email]> wrote:

> Carl Eugen Hoyos (12019-06-26):
> > The source code contains the following line in vf_psnr.c:
> > return 10.0 * log10(pow_2(max) / (mse / nb_frames))
> > so a likely range is 0-100
>
> You are reading the formula upside down: x/max would have a range [0;1]
> (possibly later converted to a percentage), but max/x has range [1;+∞].
> And indeed, +∞ is a possible value for lossless encoding.
>
> Then the logarithm turns the range to [0:+∞].
>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".