简体   繁体   English

解码无损预测编码

[英]Decode lossless predictive coding

In MATLAB, I did lossless predictive coding of standard images by predicting the next sample from previous samples, subtracting the predicted value from the actual one, and encoding the error using Huffman coding. 在MATLAB中,我通过预测以前的样本中的下一个样本,从实际样本中减去预测值,然后使用霍夫曼编码对错误进行编码,从而对标准图像进行了无损预测编码。 I decoded the errors as well, but now I have an array of errors without knowing how to go back to the original image. 我也对错误进行了解码,但是现在我遇到了一系列错误,却不知道如何返回到原始图像。 How do I predict the values of the original image matrix from these errors? 如何从这些错误中预测原始图像矩阵的值?

Just in case this helps, my predictor is of different types (to see which one gives the best result), with X being the actual value of a sample: 1) I take three neighboring values of X, find their average, and subtract them from X to obtain the error. 以防万一这有帮助,我的预测变量是不同类型的(看哪个预测结果最好),其中X是样本的实际值:1)我取三个相邻的X值,求出它们的平均值,然后减去它们从X获取错误。 2) I used the predictor (A+B)/2, where A and B are neighboring values of X, and subtract from X. 2)我使用了预测变量(A + B)/ 2,其中A和B是X的相邻值,并从X中减去。

And others like that. 还有其他类似的东西。 There's a pretty comprehensive list out there. 有一个相当全面的清单。

Any advice on how to predict the original values at the decoder? 关于如何在解码器中预测原始值的任何建议?

If your neighbouring pixels are A and B. Your predictor P is P=(A+B)/2. 如果您的相邻像素是A和B。您的预测变量P是P =(A + B)/ 2。 The searched pixel is X=P+E. 搜索的像素为X = P + E。 Do some algebra, solve these equations to X and you will have your formula: 进行一些代数运算,将这些方程式求解为X,您将获得公式:

X=(A+B)/2+E X =(A + B)/ 2 + E

Depending on your definition of the error, it might be X=PE 根据您对错误的定义,可能是X = PE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM