u can search for a paper by rahul sarpeshkar and jorg kramer.they have done good work on motion detectors.u may do this if u are planning to make a vlsi chip of a motion detector.if u dont need to determine the velocity then u can go in for rainer deutschmann's thesis,if u need it i shall upload it.but anyway if u make a simple google search u shall get tha same.
I thinks it's hard doing it with jpeg format bcoz its coding technics u may change the pic to bmp after that u could use many other algorithems such as :
like minimum power difference (min square method) and also u could use corrolation methods ...