heuristic to calculate the frame offset