Fast approximation functions for image processing filters
A specified collection of computationally expensive functions are identified and polynomial approximations thereto are determined. In the context of a graphical processing application in general, and image filters in particular, certain characteristics of the specified collection of computationally expensive functions (e.g., range, accuracy and allowable error) permit highly efficient (computationally low cost) approximations to be determined a priori. The substitute polynomial approximations may be compiled into filter programs that can execute on a computer system's central processing or graphical processing units.
1 . A method to approximate functions in an image processing application, comprising:
identifying a target function in an image filter program; and
substituting a polynomial approximation for the target function in a compiled version of the image filter program.
2 . The method of claim 1 , wherein the polynomial approximation comprises a Chebychev mini-max approximation polynomial.
3 . The method of claim 1 , wherein the target function comprises a transcendental function.
4 . The method of claim 3 , wherein the transcendental functions are range limited to ±π.
5 . The method of claim 3 , wherein the transcendental functions comprise combinations of one or more of a sine function and a cosine function.
6 . The method of claim 1 , wherein the act of identifying comprises identifying a sine function or a cosine function.
7 . The method of claim 1 , wherein the act of substituting is performed by a just-in-time compiler application.
8 . The method of claim 1 , wherein the compiled version of the image filter program executes on a computer system central processing unit.
9 . The method of claim 1 , wherein the compiled version of the image filter program executes on a graphics processing unit.
10 . The method of claim 1 , wherein the acts of identifying and substituting are performed only if the compiled version of the image filter program is not going to execute on specialized graphics hardware.
11 . A compiler application for compiling image filter programs, said compiler application comprising instructions stored on a program storage device for causing a programmable control device to:
identify a target function instruction in an image filter program; and
substitute polynomial approximation instructions for the target function instructions in a compiled version of the image filter program.
12 . The compiler application of claim 11 , wherein the instructions to identify a target function comprise instructions to identify a transcendental function.
13 . The compiler application of claim 12 , wherein the instructions to identify a transcendental function comprise instructions to identify combinations of one or more of a sine function and a cosine function.
14 . The compiler application of claim 11 , wherein the instructions to substitute polynomial approximation instructions for a target function comprise instructions to substitute instructions embodying a Chebychev mini-max approximation polynomial.
15 . The compiler application of claim 11 , wherein the instructions to identify and substitute are executed by a just-in-time compiler application.
16 . The compiler application of claim 11 , wherein the compiled version of the image filter program execute on a computer system central processing unit.
17 . The compiler application of claim 11 , wherein the compiled version of the image filter program execute on a graphics processing unit.