Fix sao_calc_edge_block_dims

It was computing wrong dimensions, which was causing out-of-bounds reads in sao_reconstruct.