Very low bit-rate video coding using regularly shaped patterns to represent moving regions in macroblocks has good potential for improved coding efficiency. This paper presents a real-time pattern selection (RTPS) algorithm, which uses a pattern relevance and similarity metric to achieve faster pattern selection from a large codebook. For each applicable macroblock, the relevance metric is applied to create a customized pattern codebook (CPC) from which the best pattern is selected using the similarity metric. The CPC size is adapted to facilitate real-time selection. Results prove the quantitative and perceptual performance of RTPS is superior to both the Fixed-8 algorithm and H.263.