edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBe12d32fTahinli6 days ago3982 commits
| 1 | #!/usr/bin/env python3 |
| 2 | """Per-frame and mean PSNR between two raw I420 files of the same geometry. |
| 3 | |
| 4 | Usage: python3 -I yuv_psnr.py <width> <height> <ref.yuv> <test.yuv> [bits] |
| 5 | |
| 6 | `bits` is 8 (default) or 10; at 10 the files hold 16-bit little-endian samples |
| 7 | and the peak is 1023. |
| 8 | |
| 9 | Prints the mean luma PSNR over frames, the mean PSNR over all three planes |
| 10 | (sample-weighted), and the frame count. Identical files give inf. |
| 11 | """ |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | , = , |
| 19 | = |
| 20 | = - 1 |
| 21 | , = // 2, // 2 |
| 22 | = |
| 23 | = |
| 24 | = |
| 25 | = |
| 26 | |
| 27 | = |
| 28 | |
| 29 | = // |
| 30 | |
| 31 | |
| 32 | , , = , 0, 0 |
| 33 | |
| 34 | = * |
| 35 | = |
| 36 | = |
| 37 | |
| 38 | = |
| 39 | = |
| 40 | = |
| 41 | |
| 42 | += |
| 43 | , = |
| 44 | |
| 45 | += |
| 46 | += |
| 47 | = / |
| 48 | = 10 * |
| 49 | |
| 50 | return 0 |
| 51 | |
| 52 | |
| 53 | |
| 54 |