Update Codec.

Main changes:
- Revert codec creation.
- Update indexed management.
- Add generation of frame header.