An apparatus for decoding a current block of video, comprising: a memory; and a processor, the processor configured to execute instructions stored in the memory to: decode, from a compressed bitstream, a flag indicating whether a residual block for the current block is encoded using vector quantization; in response to the flag indicating that the residual block is encoded using VQ, execute instructions to: decode a parameter indicating an entry in a codebook by: decoding a gain index indicating an entry in a gain codebook and indicative of a magnitude of the residual block and used to lookup a quantized magnitude of the residual block in a gain lookup table; and decoding a shape index indicating an entry in a shape codebook and used to obtain from a shape lookup table a code vector to which a unit-norm of the residual block is quantized; and obtain the residual block by multiplying at least the quantized magnitude and the code vector; in response to the flag indicating that the residual block is not encoded using VQ, execute instructions to: decode the residual block based on a skip flag indicating whether the current block is encoded using transform skip mode; and reconstruct the current block using the residual block. a memory; and a processor, the processor configured to execute instructions stored in the memory to: decode, from a compressed bitstream, a flag indicating whether a residual block for the current block is encoded using vector quantization; in response to the flag indicating that the residual block is encoded using VQ, execute instructions to: decode a parameter indicating an entry in a codebook by: decoding a gain index indicating an entry in a gain codebook and indicative of a magnitude of the residual block and used to lookup a quantized magnitude of the residual block in a gain lookup table; and decoding a shape index indicating an entry in a shape codebook and used to obtain from a shape lookup table a code vector to which a unit-norm of the residual block is quantized; and obtain the residual block by multiplying at least the quantized magnitude and the code vector; in response to the flag indicating that the residual block is not encoded using VQ, execute instructions to: decode the residual block based on a skip flag indicating whether the current block is encoded using transform skip mode; and reconstruct the current block using the residual block. decode, from a compressed bitstream, a flag indicating whether a residual block for the current block is encoded using vector quantization; in response to the flag indicating that the residual block is encoded using VQ, execute instructions to: decode a parameter indicating an entry in a codebook by: decoding a gain index indicating an entry in a gain codebook and indicative of a magnitude of the residual block and used to lookup a quantized magnitude of the residual block in a gain lookup table; and decoding a shape index indicating an entry in a shape codebook and used to obtain from a shape lookup table a code vector to which a unit-norm of the residual block is quantized; and obtain the residual block by multiplying at least the quantized magnitude and the code vector; in response to the flag indicating that the residual block is not encoded using VQ, execute instructions to: decode the residual block based on a skip flag indicating whether the current block is encoded using transform skip mode; and reconstruct the current block using the residual block. decode a parameter indicating an entry in a codebook by: decoding a gain index indicating an entry in a gain codebook and indicative of a magnitude of the residual block and used to lookup a quantized magnitude of the residual block in a gain lookup table; and decoding a shape index indicating an entry in a shape codebook and used to obtain from a shape lookup table a code vector to which a unit-norm of the residual block is quantized; and obtain the residual block by multiplying at least the quantized magnitude and the code vector; decoding a gain index indicating an entry in a gain codebook and indicative of a magnitude of the residual block and used to lookup a quantized magnitude of the residual block in a gain lookup table; and decoding a shape index indicating an entry in a shape codebook and used to obtain from a shape lookup table a code vector to which a unit-norm of the residual block is quantized; and obtain the residual block by multiplying at least the quantized magnitude and the code vector; in response to the flag indicating that the residual block is not encoded using VQ, execute instructions to: decode the residual block based on a skip flag indicating whether the current block is encoded using transform skip mode; and reconstruct the current block using the residual block.