Add get-all-frame framing function
Add inverse framing
Small variable rename: we use s to represent "segment"