1. An apparatus for coding video data, comprising: a memory for storing the video data, the memory including a buffer; and a hardware processor operationally coupled to the memory and configured to: receive the video data to be coded, determine a difference between a number of bits allocated for coding a current block of the video data and a number of bits used for encoding a previous block of the video data, determine a range among a plurality of ranges within which the difference falls, determine an adjustment value for adjusting a quantization parameter (QP) based on the determined range, determine an adjusted QP of the current block based on the determined adjustment value, and code the current block in a bitstream using the adjusted QP.