Encoder for obtaining training signals configured to train a codebook for vector quantization of a video sequence of subsequent frames, each frame being subdivided into coding blocks, and for encoding the video sequence in encoded signals, the encoder comprising: - a scalar quantization unit configured to obtain, for each coding block of one or more training frames of the video sequence, a scalar quantized signal from a prediction error (e k), - an entropy coding unit configured to entropy code, for each coding block of each training frame of the video sequence, the scalar quantized signal into an output signal, - a data selection unit configured to select, from among the training frames of the video sequence, one or several coding blocks of the training frames depending on a cost function of their respective output signal, and to obtain, for each selected coding block, a training signal, wherein the training signal is either the prediction error (e k) or a reconstructed prediction error (e' k) of the selected coding block, and configured to train the codebook for vector quantization of the video sequence, wherein the cost function of the output signal is a number of bits per pixel of the output signal or a rate distortion function of the output signal; and the data selection unit is configured to select the coding blocks for which the respective output signal has a cost function above a threshold (t VQ), and wherein the encoder is configured to add the threshold (t VQ) in the encoded signals as side information. the encoder comprising: - a scalar quantization unit configured to obtain, for each coding block of one or more training frames of the video sequence, a scalar quantized signal from a prediction error (e k), - an entropy coding unit configured to entropy code, for each coding block of each training frame of the video sequence, the scalar quantized signal into an output signal, - a data selection unit configured to select, from among the training frames of the video sequence, one or several coding blocks of the training frames depending on a cost function of their respective output signal, and to obtain, for each selected coding block, a training signal, wherein the training signal is either the prediction error (e k) or a reconstructed prediction error (e' k) of the selected coding block, and configured to train the codebook for vector quantization of the video sequence, - a scalar quantization unit configured to obtain, for each coding block of one or more training frames of the video sequence, a scalar quantized signal from a prediction error (e k), - an entropy coding unit configured to entropy code, for each coding block of each training frame of the video sequence, the scalar quantized signal into an output signal, - a data selection unit configured to select, from among the training frames of the video sequence, one or several coding blocks of the training frames depending on a cost function of their respective output signal, and to obtain, for each selected coding block, a training signal, wherein the training signal is either the prediction error (e k) or a reconstructed prediction error (e' k) of the selected coding block, and configured to train the codebook for vector quantization of the video sequence, wherein the cost function of the output signal is a number of bits per pixel of the output signal or a rate distortion function of the output signal; and the data selection unit is configured to select the coding blocks for which the respective output signal has a cost function above a threshold (t VQ), and wherein the encoder is configured to add the threshold (t VQ) in the encoded signals as side information.