Yes that's essentially how the compression works. My code works in 3 stages:
1) calculate number of columns and reserve space for ptr table (column data).
2) generate column data, reserve space for ptr (pixel data), and update ptr table.
3) compress pixel data and update ptr (pixel data) in column data.
There's just a few conditions that need tweaked in my code (such as making sure banks are not crossed and anything else that's causing compression to fail), but you can see from the image I posted that it's working otherwise.