fix bug for 10 bits depth