I am in the process of writing code to build an algorithm for the JPEG predictive rule #5 which states:
I'[i,j] = I[i, j-1] + I[[i-1, j] + I[i-1, j-1]]/2
I have previously built an algorithm that satisfies the condition of rule #4 and the line of code I used was:
arrayshift[i][j] = originalarray[i - 1][j - 1];
The code copies the cell from the position at i-1 and j-1 to i,j in the array.
Can anyone tell me how to write, if not explain how to write the line of code for the rule mentioned above. I wrote the following but received errors;
arrayshift[i][j] = originalarray[i][j-1] + array[[i-1][j]+[i-1][j-1]]/2;
Thanks for any suggestions provided.