encode definition for nnhp