merge the desired changes from merge branch
simplify the calculation to avoid possible error
Merge branch 'merge2' into codec_trace2

Conflicts:
	codec/encoder/core/src/encoder_ext.cpp
	codec/encoder/plus/src/welsEncoderExt.cpp