Adding stride and interlaced values to caps, and cleaning code