Unpredictable packet loss that occurs in the channel connecting a local sensor and a remote estimator will deteriorate the performance of state estimation. To relieve this detrimental impact, an online linear temporal coding scheme is studied in this paper. If the packet of the last step is lost, a linear combination of the current and the last measurements with proper weights is transmitted; otherwise, only the current data is sent. By virtue of the innovation sequence approach, a linear minimum mean-squared error estimation algorithm is designed. To optimize performance, a novel estimator is also proposed which provides a recursive expression of the error covariances. The proposed two algorithms are proved to be equivalent via a set of transformations. With the aid of some optimization techniques, a recursive algorithm is presented to obtain the optimal coding weight in terms of minimizing the average estimation error covariance.