Split codec-regression.sh, put all the code which can be shared by