what does the x264 tuning settings do?

film: meant for normal film material encoded at a decent datarate (lowers the inloop-deblocking and tweaks the psychovisual settings slightly)

animation: cartoon like material with large flat areas (boost deblocking, changes pychoviual settings doubles reference frames)

grain: for grainy (or really foggy) source material where the grain should be kept and is not filtered out before encoding (see: https://en.wikipedia.org/wiki/Film_grain); the movie 300 is a good example of a grains source

psnr: disables the psychovisual settings, which you normally do not want; this is mainly there for debugging and seeing how (https://en.wikipedia.org/wiki/PSNR) is affected by the settings choice

ssim: similar to psnr but here you aim for good SSIM (https://en.wikipedia.org/wiki/Structural_similarity) values; like psnr not really meant for normal use

fastdecode: this is ment for content that needs to be played back on systems with low cpu power; to archive the same quality that you would have without this tune option, you will have to boost the datarate probably more than 30% (fastdecode disables a lot of the essential bit rate saving, but cpu power consuming options of the H.264 standard)