My daughter (almost 2) has done something similar... I was told that 'Head banging and body rocking are normal self-comforting behaviors in babies.' Also my ped said that the head banging could be her distracting herself from teething or other pain (ear infections, bug bite etc).
I brought up emotional or development problems and the pediatrician said that it is very rare for this to be the sign of that type of problem, especially if all milestones have been met.
My pediatrician said that is more then likely a comfort thing and that she would out grow it by her third birthday. I could not stand seeing her do it so I decided to help her out by giving her something else to do (less harmful)... We got a small blanket with a bear head on top (fuzzy on one side and silk like on the other) which is now her 'lovey.' I started out rubbing it softly against her face to sooth/calm her. Thankfully she now does it by herself instead of banging her head. That was the first thing we tried... we got lucky. Try teaching a different pattern, so if she starts the head banging or whatever, get something else for her to do at that time like rub a blanket or stuff animal on her cheek. This will then 'train' her to do something none harmful.
Hope you find something that works for you!