some (still incomplete) code for intra-frame encoding test