Built-in self-repair (BISR) technique is a popular method for repairing defective embedded memories. To allocate redundancy efficiently, built-in redundancy-analysis (BIRA) component is a core component in a BISR design. This paper presents a BIRA scheme for RAMs with two-level redundancy, i.e., spare rows, spare columns, and spare words. A compressed local bitmap is used to collect faulty information for redundancy allocation. Then an efficient redundancy analysis algorithm based on the compressed local bitmap is proposed to allocate redundancy. Experimental results show that the repair rate (the ratio of the number of repaired memories to the number of defective memories) of the proposed redundancy analysis algorithm approaches to that of the exhaustive search algorithm. Also, area overhead of the proposed BIRA scheme is low. It is only about 2% for an 8K × 64-bit RAM with three spare rows, three spare columns, and two spare words.