Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions