Bi-Cubic Interpolation Algorithm for Image Scaling

后端 未结 4 1820
说谎
说谎 2021-02-06 01:03

I\'m trying to write a basic bicubic resize algorithm to resize a 24-bit RGB bitmap. I have a general understanding of the math involved, and I\'m using this i

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 02:02

    I suggest don't use this function because it was written very bad. You need to make two convolutions: at first by X coordinate then by Y. In this function all these convolutions are making in the same time that leads to very slow work. And if You would look at jj loop body you could notice that all second part of body begining from "d0 = C[0] - C[1];" could be moved outside jj loop because only the last iteration of this loop takes effect on out[] array (all previous iterations results will be overwrited).

提交回复
热议问题