There are provided mechanisms for encoding a picture of a video sequence in a video bitstream. The picture comprises pixels wherein each pixel has a color value comprising at least one color component value. The method comprises determining a frequency distribution of the color component values of the at least one color component. The method comprises determining at least one quantization parameter for coding of transform coefficients for the at least one color component based on the determined frequency distribution of the color component values. The method comprises encoding the determined at least one quantization parameter.