An apparatus for encoding a sign of a current transform coefficient of a signal comprising a processing circuitry which is configured to: determine whether or not the sign of the current transform coefficient is to be embedded in result of a first function of transform coefficients in a set of transform coefficients by evaluating a second function of the transform coefficient values in the set of transform coefficients and a number of those transform coefficients in the set of transform coefficients which are larger than a coefficient value threshold; wherein the first function is a parity corresponding to a modulo M operation, M being an integer equal to 2 or larger than 2, and wherein the second function is a sum of absolute values only of certain coefficients among the coefficients in the set of transform coefficients, corresponding to weighted sum of the coefficients from the set of transform coefficients with some weights equal to zero; and embed the sign of the current transform coefficient according to the result of the determination; wherein the evaluating of the second function of the transform coefficient values in the set of transform coefficients includes comparing the second function of said transform coefficient values with a second function threshold; the evaluating of the number of those transform coefficients in the set of transform coefficients which are larger than the coefficient value threshold includes comparison of said number with a number threshold; the evaluating is performed for a plurality of combinations of values of the second function threshold and the number thresholds; and the sign of the current transform coefficient is embedded in a result of the first function of the transform coefficients if the evaluating is successful for at least one of the plurality of combinations and not embedded in the result of said first function of the transform coefficients otherwise, thereby including sets of coefficients among those for which sign embedding is allowed. determine whether or not the sign of the current transform coefficient is to be embedded in result of a first function of transform coefficients in a set of transform coefficients by evaluating a second function of the transform coefficient values in the set of transform coefficients and a number of those transform coefficients in the set of transform coefficients which are larger than a coefficient value threshold; wherein the first function is a parity corresponding to a modulo M operation, M being an integer equal to 2 or larger than 2, and wherein the second function is a sum of absolute values only of certain coefficients among the coefficients in the set of transform coefficients, corresponding to weighted sum of the coefficients from the set of transform coefficients with some weights equal to zero; and embed the sign of the current transform coefficient according to the result of the determination; wherein the evaluating of the second function of the transform coefficient values in the set of transform coefficients includes comparing the second function of said transform coefficient values with a second function threshold; the evaluating of the number of those transform coefficients in the set of transform coefficients which are larger than the coefficient value threshold includes comparison of said number with a number threshold; the evaluating is performed for a plurality of combinations of values of the second function threshold and the number thresholds; and the sign of the current transform coefficient is embedded in a result of the first function of the transform coefficients if the evaluating is successful for at least one of the plurality of combinations and not embedded in the result of said first function of the transform coefficients otherwise, thereby including sets of coefficients among those for which sign embedding is allowed.