Question: Help Me make this code run 4x faster! I have been able to increase the speed thus far by replacing the three lines ****dst[RIDX_F(i, j,

Help Me make this code run 4x faster!

Help Me make this code run 4x faster! I have been able

I have been able to increase the speed thus far by replacing the three lines ****dst[RIDX_F(i, j, dim)].red = src[RIDX(i, j, dim)].red; dst[RIDX_F(i, j, dim)].green = src[RIDX(i, j, dim)].green; dst[RIDX_F(i, j, dim)].blue = src[RIDX(i, j, dim)].blue;****with just one line, dst[RIDX_F(i, j, dim)] = src[RIDX(i, j, dim)];, but still need to optomize the code from here to run at least 2x faster than current. Thanks!

The following C function computes the result of flipping the source image src and stores the result in destination image dst. dim is the dimension of the image. Note that your RIDX F function is given by the program and is different from that of other students. As you optimize further, you may find yourself wanting to replace calls to RIDXF with something more specilic, customized, or optimized. This is fine, as long as the output is still correct void naive flip(int dim, pixel src, pixel dst) int i, j for (i-0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!