Hi, For quality tuning, pleas refer to this post:
Under identical configuration, H265 should be slightly better than H264. You may compare the PSNR.