In the US, altitude limits (for Part 107, not for recreational fliers) are calculated above the ground or "structure" that is higher than ground level. From the FAA: "The maximum allowable altitude is 400 feet above the ground, and higher if your drone remains within 400 feet of a structure." So as a hill rises, your 400-foot limit also rises, to keep 400 feet above the increased ground level. If you were flying over the Empire State Building (just an example, not a suggestion), you would be good for the height of the building + 400 feet.
Over trees, it depends on what you and the FAA define as a "structure". Technically, the FAA has not defined "structure" as it relates to their guidelines for UAS. For manned aircraft, they do not use the term "structure" but rather "obstacle" (manned aircraft must maintain "an altitude of 1,000 feet above the highest obstacle within a horizontal radius of 2,000 feet of the aircraft") and structure is restricted to usage concerning marking and warning lights requirements for buildings, antennas, and the like.
So, if you're flying 450 feet high over a forest of 50-foot high trees, are you within that restriction? I can't answer that for you, as the FAA hasn't answered that themselves. But just remember, if you're flying recreationally in the US, there's no technical altitude limit for your flight.
Outside the US, all of this is moot and dependent upon your own country's laws. Your mileage (or altitude) may vary.