[Encoder] refactor Sps generation

refactor Sps generation by wraping the generation of SPS to a function
being reviewed at: https://rbcommons.com/s/OpenH264/r/930/