Compress samples in groups of >=5000.

Change-Id: Idf1b4a3918b3719edb3290d00f201dd0588535a3