Coupla things on the second half about video macro block fusion from the previous post. First, it’s

δx_{2}= h_{2}tan(θ)

not

δx_{2}= atan(δx_{2}/ h_{2})

The latter is working out θ which is known anyway. Just a bit of careless writing down thoughts by me.

More interestingly, the picture represents forward positive movement from left to right across the page. However, the pitch angle is negative following the right hand rule which my code adheres to. Therefore, the full conversion equation is:

δx = δx_{1}+h_{2}tan(θ)

The situation on the Y / roll axis is different. If you mentally flip the diagram left / right, following the right to left represents a positive move on the Y axis. The roll angle in this case is also positive according to the right hand rule so the equation looks like this:

δy = δy_{1}-h_{2}tan(φ)

There are other places in the code which already follow this ruling.