Adding to GIEGAR's accurate comparison is the fact that Onkyo's naming convention is a little odd. The TX-NR828 was never intended to be a replacement for the 818, but rather the 929 was.
The big draw with the 929 and the X4000 is that they have the highest version of Audyssey, MultiEQ XT32, while the 828 has a lower level Audyssey. Two different subs in different acoustical locations will be handled better by the Denon. On the other hand the 929 has a little more power per channel and two more of them. If I wanted to add two rear surrounds to my 929 I could add a stereo amp to the pre-outs for a full 11.2 surround.
Both brands have had some minor issues, the biggest of which was the overheating HDMI boards for Onkyo/Integra. I can tell you first hand that my 929, with it's onboard amps, runs 30 to 35 degrees cooler than my little older Integra Pre-Pro without amps. So maybe what Onkyo said about a fix is true.
The fan boys will be opinionated so wade through all that with open eyes. BBW.