I hope I'm not doing your homework for you. Here's what I came up with, but not sure if I'm right. Please check it to make sure:
a = 1 if 64<=s2<=158, 0 otherwise
129<=s1<=159 => j1 = (s1 - 112) * 2 - a
224<=s1<=239 => j1 = (s1 - 176) * 2 - a
64<=s2<=158 => j2 = s2 - 31 - {1 if s2 >= 128, 0 otherwise}
159<=s2<=252 => j2 = s2 - 126