Introduction - If you have any usage issues, please Google them yourself
Calculate scaling factor once for each reference frame and use fixed point scaling factors in decoding and encoding routines. Hardware implementations can calculate scale factor in device driver and use multiplication and shifting on hardware instead of division.