1. A method comprising: in a data storage device including a non-volatile memory, performing: receiving a representation of a codeword that is read from the non-volatile memory; determining a shaping level of a set of one or more bits of the representation of the codeword; determining a soft metric of each bit of the one or more bits of the representation of the codeword based on a value of the bit in the received representation and based on the shaping level; and initiating a decoding operation of the codeword based on the soft metrics.