encode TFRAME