use new Frame class to manage memory for all encoding steps after DWT