Support multiple framing modes and improve flowgraphs