2009 Corolla Xrs 2AZ 2.4 Horrible engine noise

My Corolla Xrs has developed a horrid noise when revving the engine and when accelerating. Engine seems to sound normal at idle. Sounds like the sound is coming from the top end/ head of the engine. Any thoughts? Maybe VVT-i gear?
I think you are right with the VVTI gear. But if the noise starts to happen at lower/idling revs it may be a timing belt issue.