ATTENTION PEOPLE
It's really really stupid to use ref=1.
Multiref is one of the big bitrate savers in h264 and YOU SHOULD USE IT. However, it's also pretty pointless to use ref=16.
Anyway x264 itself tells you what to do if you only take time to read what it's saying. Example from my last encode (I used ref=12 because I'm anal retentive):
Code:
avis [info]: 704x400 @ 29.97 fps (42548 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2 3DNow!
x264 [info]: slice I:335 Avg QP:15.65 size: 27088 PSNR Mean Y:51.13 U:53.80 V:53.30 Avg:51.71 Global:51.04
x264 [info]: slice P:24488 Avg QP:17.66 size: 3761 PSNR Mean Y:48.60 U:51.93 V:51.60 Avg:49.36 Global:48.58
x264 [info]: slice B:17725 Avg QP:19.04 size: 1200 PSNR Mean Y:48.35 U:51.52 V:51.24 Avg:49.08 Global:48.19
x264 [info]: mb I I16..4: 21.2% 29.6% 49.2%
x264 [info]: mb P I16..4: 2.9% 2.7% 1.6% P16..4: 32.3% 5.1% 4.1% 0.4% 0.3% skip:50.7%
x264 [info]: mb B I16..4: 0.1% 0.1% 0.1% B16..8: 15.5% 0.8% 2.2% direct: 1.1% skip:80.0%
x264 [info]: 8x8 transform intra:36.4% inter:61.7%
x264 [info]: direct mvs spatial:88.6% temporal:11.4%
x264 [info]: ref P 77.4% 9.0% 4.8% 1.8% 1.5% 1.2% 1.2% 0.7% 0.6% 0.5% 0.5% 0.6%
x264 [info]: ref B 74.7% 10.3% 4.2% 2.4% 1.8% 1.5% 1.2% 1.0% 0.8% 0.8% 0.6% 0.9%
x264 [info]: SSIM Mean Y:0.9938808
x264 [info]: PSNR Mean Y:48.517 U:51.774 V:51.461 Avg:49.264 Global:48.428 kb/s:690.07
encoded 42548 frames, 4.35 fps, 690.15 kb/s
Study the boldened part. "ref P" means "references from P-frames", "ref B" means "references from B-frames". Each following percentage is the amount of references made; first number is first reference and so on. You now see that using 3 references is pretty good, but after that you get drastically diminishing returns. Every added reference frame after the 6h or so (for the average anime source) is only used about 0.5-1% of the time, and that won't give you any bitrate saving to speak of.
You may now draw your own conclusions about how many references you want to use.