An encoder dynamically filters information for lossy compression so as to
control bitrate or quality with few sudden, dramatic changes to
perceptual quality of the compressed information. For example, a video
encoder regulates the level of a buffer (e.g., how full or empty the
buffer is) by adjusting median filtering of video information (e.g.,
pixel data and/or prediction residuals). The buffer stores compressed
video information for the video encoder. Based upon the buffer level, the
video encoder changes the median filter kernel applied to video
information. If the buffer starts to get too full, the video encoder
increases the size of the kernel, which tends to smooth the video
information, introduce slight blurriness, and deplete the buffer. If the
buffer starts to get too empty, the video encoder decreases the size of
the kernel or stops filtering, which tends to preserve the video
information and fill the buffer.