This paper presents boundary optimization techniques for the nonexpansive decomposition of arbitrary-length signals with multirate filterbanks. Both biorthogonal and paraunitary filterbanks are considered. The paper shows how matching moments and orthonormality can be imposed as additional conditions during the boundary filter optimization process. It provides direct solutions to the problem of finding good boundary filters for the following cases: a) biorthogonal boundary filters with exactly matching moments and b) orthogonal boundary filters with almost matching moments. With the proposed methods, numerical optimization is only needed if orthonormality and exactly matching moments are demanded. The proposed direct solutions are applicable to systems with a large number of subbands and/or very long filter impulse responses. Design examples show that the methods allow the design of boundary filters with good frequency selectivity.