Skip to content

Instantly share code, notes, and snippets.

@master-of-zen
Created February 19, 2021 10:38
Show Gist options
  • Save master-of-zen/477b9fe58cb6273e91e04efb0523bff7 to your computer and use it in GitHub Desktop.
Save master-of-zen/477b9fe58cb6273e91e04efb0523bff7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from matplotlib import pyplot as plt
import matplotlib
matplotlib.rc('xtick', labelsize=24)
matplotlib.rc('ytick', labelsize=24)
data = {
10: {
10: (-11.90, 0.72),
20: (-6.46, 0.24),
30: (-1.99, 0.14),
},
9: {
10: (-5.04, 0.45),
20: (-2.54, 0.14),
30: (-0.94, -0.02),
},
8: {
10: (-4.43, 1.0),
20: (-2.49, 0.49),
30: (-0.66, 0.22),
},
7: {
10: (-4.64, 1.11),
20: (-3.23, 0.46),
30: (-1.15, 0.18),
},
6: {
10: (-4.85, 1.22),
20: (-2.56, 0.36),
30: (-0.60, 0.10),
},
5: {
10: (-4.79, 1.16),
20: (-2.55, 0.41),
30: (-1.04, 0.12),
},
4: {
10: (-4.04, 1.14),
20: (-2.09, 0.36),
30: (-0.89, 0.15),
},
3: {
10: (-4.20, 1.12),
20: (-2.22, 0.40),
30: (-0.7, 0.121),
},
2: {
10: (-4.07, 1.16),
20: (-2.19, 0.44),
30: (-0.87, 0.19),
},
1: {
10: (-2.96, 1.12),
20: (-1.59, 0.38),
30: (-0.66, 0.19),
}
}
plt.plot([x for x in range(10)], [data[x][10][1] for x in data],
linewidth=3,
label='--rdo-lookahead-frames 10')
plt.plot([x for x in range(10)], [data[x][20][1] for x in data],
linewidth=3,
label='--rdo-lookahead-frames 20')
plt.plot([x for x in range(10)], [data[x][30][1] for x in data],
linewidth=3,
label='--rdo-lookahead-frames 30')
[plt.axhline(i / 2, color='black', linewidth=0.7) for i in range(13)]
[plt.axvline(i, color='grey', linewidth=0.3) for i in range(0, 10, 1)]
plt.tight_layout()
plt.xticks([x for x in range(10)], [x for x in range(10, 0, -1)])
plt.yticks([x / 2 for x in range(0, 26, 1)])
plt.ylabel('% BD-rate difference', size=20)
plt.xlabel('Speed', size=24)
plt.title('rav1e --rdo-lookahead-frames test', size=30)
plt.legend(prop={'size': 22}, loc="upper right")
plt.xlim(0, 9)
plt.ylim(0, 2)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment