allocate palette in codec directly