simplify, use pointer to codec context in struct instead of only id