I have several comments,
First, the relation E=hf is only valid for a photon.
Second, a diatomic molecule has 5 degrees of freedom.
http://en.wikipedia.org/wiki/Degrees_of_freedom_(physics_and_chemistry)
Let's imagine you lay out your molecule along a Cartesian coordinate system (x, y and z axes). We'll have the axis of the molecule point along the x direction. Imagine one oxygen atom at position (d,0,0) and the other at position (-d,0,0).
The 5 degrees of freedom are linear motion along the x, y and z axes (3 degrees of freedom), rotation about the y or z axis (Note how these two types of motion are completely equivalent, since any axes perpendicular to that of the molecule's axis are indistinguishable (1 degree of freedom), and oscillations along the x-axis (Like two masses on a spring, the two atoms can move closer and further apart) (1 degree of freedom).
We don't count the rotation about the x-axis since it incorporates very little energy, just like we disregard the rotation of a mono-atomic gas. (I'm not quite sure why this is valid and how it sits with the equipartition principle, but it's just the way it is. Maybe it has something to do with how two snapshots of the rotation would be indistinguishable from each other)
The whole degrees of freedom thing is a bit tricky, I may have mislead you here a bit, so if someone better informed comes along, feel free to take their word over mine.
The gist of the matter is that you're supposed to remember the following, mono-atomic - 3 degrees of freedom, diatomic - 5 degrees of freedom.
If you're dealing with a polyatomic molecule, you'll either be asked for a qualitative description, or simply given the number of degrees of freedom, since counting degrees of freedom gets complicated.
Oh, and on a final note, movement and momentum are the same thing. What you might have meant is position and momentum, but position does not constitute a degree of freedom separate from that axis' associated momentum/KE.