* Calculate the gain when using the generalized complementary technique
*/
static int calculate_gain(unsigned char *R, int r) {
- int max_gain = -1;
- int idx = 0, i;
+ int max_gain = 0;
+ int idx = -1, i;
int gain;
/* the gain for r == 1 */
idx = i;
}
}
- if (max_gain > 0)
- return idx;
- return -1;
+ return idx;
}
/**