Merge pull request #571 from ruil2/encoder_nal

add complexity calculation parameter for screen content
move some common functions to common.cpp and add some functions in common