开发者

Blur filter in assembler

开发者 https://www.devze.com 2023-01-01 05:08 出处:网络
I am trying to get it working but still no results. Do you know some kind of tutorial or sample assembler code for 开发者_C百科blur image filtering?You could blur with a convolution matrix.

I am trying to get it working but still no results. Do you know some kind of tutorial or sample assembler code for 开发者_C百科blur image filtering?


You could blur with a convolution matrix.

Depending about the system, you can use the older floating point stuff, integer arithmetic or newer SSE ops.

If you are using a byte to represent color value, here's an overall algorithm:

calculate sum of convolution matrix (in blur matrix that would be 9)
Clear destination register
load each byte under convolution matrix
multiply each byte with its corresponding number in the convolution matrix
place the sum into the destination register
divide destination register with the sum of convolution matrix
store the destination register into destination buffer
0

精彩评论

暂无评论...
验证码 换一张
取 消