#define INTERPOLATE_NUMERATOR(Y1, Y2, diff_x_x1) \
((((Y2) - (Y1)) * (diff_x_x1)) << INTERPOLATE_SHIFT)
#define GET_LINEAR_INTERPOLATE_VALUE(Y1, Y2, diff_x2_x1, diff_x_x1) \
- (((INTERPOLATE_NUMERATOR((int)Y1, (int)Y2, diff_x_x1)) / (diff_x2_x1)) + \
- (((int)(Y1) << INTERPOLATE_SHIFT)))
+ (diff_x2_x1) ? (((INTERPOLATE_NUMERATOR((int)Y1, (int)Y2, diff_x_x1)) / (diff_x2_x1)) + \
+ (((int)(Y1) << INTERPOLATE_SHIFT))) : \
+ (int)(Y1) << INTERPOLATE_SHIFT
#define RESTORE_SHIFT_VALUE(value) ((int)(value) >> INTERPOLATE_SHIFT)
enum tdnr_mode {