Hi everybody,
after I finally got some UHD HDR content (that I cannot play because no HDR displays) I somehow got into experimenting instead of just using x265 / madVR and tried to implement mastering display coloring volume metadata into x264 (since the H.264 spec supports it). Even with some help from x264dev on freenode I wasn't able since I can't do C. In the end someone else wrote a patch with the missing bits.
x264 can do HDR now ... woohoo
Sadly madVR doesn't enable tonemapping as it does for x264 HDR content. I guess it's just not enabled for h264 content?