A communication device and method for controlling a bit rate when encoding video data that includes a plurality of frames. The method includes partitioning a received current frame into groups of blocks; estimating an energy for a current group of blocks, where the energy of the current group of blocks depends from a same group of blocks in a previous frame; determining a target number of bits for the current group of blocks; calculating a quantization parameter for the current group of blocks of the current frame based on the estimated energy of the current group of blocks and the determined target number of bits for the current group of blocks; and encoding the current group of blocks based on the calculated quantization parameter.