A method performed by a system comprising a decoder, the method comprising: • Recovering from a received bit stream a string of binary symbols forming a non-binary valued symbol of a received image block, wherein the non-binary valued symbol corresponds to a quantized coefficient value at a position x in a horizontal direction and a position y in a vertical direction of the received image block; • Entropy decode the string of binary symbols, thereby arriving at a entropy decoded string of binary symbols; • Inverse quantize the entropy decoded string of binary symbols, thereby arriving at a dequantized coefficient d[x][y]; • If inverse transform is not applied to the image block for higher bit depth coding, performing a scaling operation on d[x][y], characterized in that said scaling operation comprises the steps of: TS Shift = MAX fCMAX TDR - Bit Depth - Log2TrSize), o]; r ' x y = d x y < < TS _ Shift; bdShift' = (cIdx == o) ? 20 - BitDepth y: 20 - BitDepth c; bdShift = MAX (TS_Shift, bdShift'); r x y = r' x y + 1 < < bdShift − 1 > > bdShift; wherein MAX TDR is the maximum dynamic range of the transform, Bit Depth = (cIdx == o)? BitDepth y: BitDepth c, Log2TrSize is the Log2 of the transform size, r [x] [y] is a residual value output from the scaling operation, wherein cIdx represents a color component index, and BitDepth y and BitDepth c indicate a luma source bit depth and a chroma source bit depth, respectively, wherein bdShift is a right bit shift for the scaling operation and TS_Shift is a left bit shift for the scaling operation; wherein the == operation indicates a relational operator of being equal to; wherein the MAX operation returns a maximum value of the values between the parenthesis; wherein the expression x ? y: z corresponds to the following: if x is true or not equal to o, the expression evaluates to the value of y, otherwise, the expression evaluates to the value of z; wherein x >> y corresponds to an arithmetic right shift of a two's complement integer representation of x by y binary digits, wherein this function is only defined for non-negative integer values of y and bits shifted into most significant bits, MSBs, as a result of the right shift, have a value equal to the MSB of x prior to the shift operation, x << y corresponds to an arithmetic left shift of a two's complement integer representation of x by y binary digits, wherein this function is only defined for non-negative integer values of y and bits shifted into least significant bits, LSBs, as a result of the left shift have a value equal to o. • Recovering from a received bit stream a string of binary symbols forming a non-binary valued symbol of a received image block, wherein the non-binary valued symbol corresponds to a quantized coefficient value at a position x in a horizontal direction and a position y in a vertical direction of the received image block; • Entropy decode the string of binary symbols, thereby arriving at a entropy decoded string of binary symbols; • Inverse quantize the entropy decoded string of binary symbols, thereby arriving at a dequantized coefficient d[x][y]; • If inverse transform is not applied to the image block for higher bit depth coding, performing a scaling operation on d[x][y], TS Shift = MAX fCMAX TDR - Bit Depth - Log2TrSize), o]; r ' x y = d x y < < TS _ Shift; bdShift' = (cIdx == o) ? 20 - BitDepth y: 20 - BitDepth c; bdShift = MAX (TS_Shift, bdShift'); r x y = r' x y + 1 < < bdShift − 1 > > bdShift; wherein MAX TDR is the maximum dynamic range of the transform, Bit Depth = (cIdx == o)? BitDepth y: BitDepth c, Log2TrSize is the Log2 of the transform size, r [x] [y] is a residual value output from the scaling operation, wherein cIdx represents a color component index, and BitDepth y and BitDepth c indicate a luma source bit depth and a chroma source bit depth, respectively, wherein bdShift is a right bit shift for the scaling operation and TS_Shift is a left bit shift for the scaling operation; wherein the == operation indicates a relational operator of being equal to; wherein the MAX operation returns a maximum value of the values between the parenthesis; wherein the expression x ? y: z corresponds to the following: if x is true or not equal to o, the expression evaluates to the value of y, otherwise, the expression evaluates to the value of z; wherein x >> y corresponds to an arithmetic right shift of a two's complement integer representation of x by y binary digits, wherein this function is only defined for non-negative integer values of y and bits shifted into most significant bits, MSBs, as a result of the right shift, have a value equal to the MSB of x prior to the shift operation, x << y corresponds to an arithmetic left shift of a two's complement integer representation of x by y binary digits, wherein this function is only defined for non-negative integer values of y and bits shifted into least significant bits, LSBs, as a result of the left shift have a value equal to o.