1) take your raw uncompressed y4m file and write it out to a directory of PNG files, one png file per frame. this is your static image reference baseline for subjective eyeballs.
2) take your raw uncompressed y4m file and encode it to x265 or whatever codec you're testing, at various different bitrates and encoder settings
3) take your various encoded x265 files and also write those out to PNG files in separate directories
3) pick exactly the same frame number filename from your 'master' PNGs and your encoder-output PNGs, copy them and put them in the same directory so you can quickly flip back and forth between them in a image slideshow application.
If you want to do this with 2160p24,p25 or p30 videos at several minute lengths, be prepared to have 150-160GB of scratch disk per y4m and per PNG-dump-directory.