Remove dead code.
This commit is contained in:
parent
b4032a3eee
commit
ea7855b9dd
34
rotation.cpp
34
rotation.cpp
|
@ -360,10 +360,6 @@ void rotate_pixel(Image const& src,
|
|||
pvalue_t interpolated = ((src_tl * inv_x + src_tr * x_delta) * inv_y
|
||||
+ (src_bl * inv_x + src_br * x_delta) * y_delta) >> (q_inter_pow << 1);
|
||||
rotate_buffer[rot_index] = interpolated;
|
||||
// rotate_buffer[rot_index + 1] = ((src.buffer[src_index_1 + 1] * inv_x + src.buffer[src_index_2 + 1] * x_delta) * inv_y
|
||||
// + (src.buffer[src_index_3 + 1] * inv_x + src.buffer[src_index_4 + 1] * x_delta) * y_delta) >> 6;
|
||||
// rotate_buffer[rot_index + 2] = ((src.buffer[src_index_1 + 2] * inv_x + src.buffer[src_index_2 + 2] * x_delta) * inv_y
|
||||
// + (src.buffer[src_index_3 + 2] * inv_x + src.buffer[src_index_4 + 2] * x_delta) * y_delta) >> 6;
|
||||
|
||||
#else
|
||||
|
||||
|
@ -384,9 +380,6 @@ void rotate_pixel(Image const& src,
|
|||
top = _mm_srli_epi16(top, 2 * q_pow);
|
||||
|
||||
rotate_buffer[rot_index] = _mm_extract_epi16(top, 0) + _mm_extract_epi16(top, 4);
|
||||
// rotate_buffer[rot_index + 1] = _mm_extract_epi16(top, 1) + _mm_extract_epi16(top, 5);
|
||||
// rotate_buffer[rot_index + 2] = _mm_extract_epi16(top, 2) + _mm_extract_epi16(top, 6);
|
||||
|
||||
|
||||
#endif // ! SIMD
|
||||
}
|
||||
|
@ -413,19 +406,9 @@ Image* rotate(Image const& src, double angle)
|
|||
int const q_pos_pow = 10;
|
||||
int const q_pos = 1 << q_pos_pow;
|
||||
|
||||
// TODO: we could have only one delta and deduce the other one
|
||||
Point const qdx(ceil(src_delta_x.x * q_pos / src.width), ceil(src_delta_x.y * q_pos / src.width));
|
||||
Point const qdy(ceil(src_delta_y.x * q_pos / src.height), ceil(src_delta_y.y * q_pos / src.height));
|
||||
|
||||
if (false)
|
||||
{
|
||||
LOG << "src delta x: " << src_delta_x << endl;
|
||||
LOG << "src delta y: " << src_delta_y << endl;
|
||||
LOG << "qdx: " << qdx << endl;
|
||||
LOG << "qdy: " << qdy << endl;
|
||||
LOG << "q pos: " << q_pos << endl;
|
||||
}
|
||||
|
||||
DPoint const rot_origin_in_src_grid = get_mapped_point(*rotated, Point(0, 0), -rotation);
|
||||
DPoint const rot_origin_in_src = convert_img_coord_precision(src, rot_origin_in_src_grid);
|
||||
|
||||
|
@ -456,23 +439,6 @@ Image* rotate(Image const& src, double angle)
|
|||
int const right_padding = padding_table[2 * y + 1];
|
||||
int const core_pixels = width - left_padding - right_padding;
|
||||
|
||||
if (core_pixels < 0)
|
||||
{
|
||||
ERRLOG << "Too much border at line " << y << endl;
|
||||
ERRLOG << " width = " << width << endl;
|
||||
ERRLOG << " left padding = " << left_padding << endl;
|
||||
ERRLOG << " right padding = " << right_padding << endl;
|
||||
ERRLOG << " core pixels = " << core_pixels << endl;
|
||||
abort();
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
LOG << "left padding = " << left_padding << endl;
|
||||
LOG << "right padding = " << right_padding << endl;
|
||||
LOG << "core pixels = " << core_pixels << endl;
|
||||
}
|
||||
|
||||
// Padding
|
||||
int const padding = left_padding + previous_right_padding;
|
||||
memset(buffer + buffer_index, 0, padding * sizeof (pvalue_t));
|
||||
|
|
Loading…
Reference in a new issue