An Algorithm for Learning Orthonormal Matrix Codebooks for Adaptive Transform Coding