If you’re going to be doing any reencoding, particularly for color alterations, it’s always going to be a better idea to convert it to a lossless (or near-lossless) codec first. H264 is… not that.
I recommend Lagarith personally, though I’ve zero experience working with it in any resolution greater than 1080p, and even that does require fairly large file sizes.