Sample coding