encoder: add infrastructure for per-slice handling of packed headers.