-
Notifications
You must be signed in to change notification settings - Fork 0
/
complane.py
50 lines (41 loc) · 1.63 KB
/
complane.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
The original source code is from https://www.nmm-hd.org/newbbs/viewtopic.php?f=23&t=1813
PSNR arguments are base on https://github.com/vcb-s/rp-checker
rpc.vpy from https://github.com/AmusementClub/vapoursynth-script/blob/master/RpcTemplate.vpy
usage: vspipe -p rpc.vpy . | python3 complane.py > rpc_result.txt
"""
import sys
d_y = {}
d_u = {}
d_v = {}
for l in sys.stdin:
l = l.strip()
if not l:
continue
parts = l.split(" ")
if len(parts) != 5:
continue
frame, psnr_y , psnr_u, psnr_v = int(parts[1]), float(parts[2]), float(parts[3]), float(parts[4])
if psnr_y < 30:
psnr_y = '%s' % (psnr_y)
d_y.update({psnr_y: frame})
elif psnr_u < 40:
psnr_u = '%s' % (psnr_u)
d_u.update({psnr_u: frame})
elif psnr_v < 40:
psnr_v = '%s' % (psnr_v)
d_v.update({psnr_v: frame})
if d_y == {} and d_u == {} and d_v == {}:
print("Every planes are OK!!!")
elif d_y != {}:
print("==============FUCKING_Y==============")
[print("Frame:", fnm, "PSNR_Y:", list(d_y.keys())[list(d_y.values()).index(fnm)]) for fnm in sorted(d_y.values())]
print("===================================")
elif d_u != {}:
print("==============FUCKING_U==============")
[print("Frame:", fnm, "PSNR_U:", list(d_u.keys())[list(d_u.values()).index(fnm)]) for fnm in sorted(d_u.values())]
print("===================================")
elif d_v != {}:
print("==============FUCKING_V==============")
[print("Frame:", fnm, "PSNR_V:", list(d_v.keys())[list(d_v.values()).index(fnm)]) for fnm in sorted(d_v.values())]
print("===================================")