If you are talking about a quadrature encoder (2 outputs: A and B phase) then ignore this reply.
If you are talking about an encoder that simply generates pulses as the motor turns and does not provide any direction information, then read on..
To go from 1024 pulses / revolution to 400 pulses / revolution is not a simple task. 1024/400 = 2.56... The answer for this problem is way out of your depth.
Why not divide the 1024 by 4 and get 256 pulses per revolution?
Dividing by 4 is pretty simple task using both sections of a CD4013 (dual d flip-flop).
Another device to consider is the CD4040. It can divide an incoming signal by 2,4,8,16,..4096. If you picked the divide by 4096 output you would get 1 pulse every 4 revolutions.
Gary D