refactor the setting of function pointer for simplification
add static
Merge pull request #550 from sijchen/funcptr_refactor

[Encoder Refactor] Simplify the setting of function pointers