Commit d650f276 authored by Urvang Joshi's avatar Urvang Joshi

Vertical scalers: Use signed int for src/dst pitch in parameters.

This avoids explicitly casting them to 'int' later.
These methods were already called with signed int arguments for pitch,
so this also avoids int -> unsigned int -> int conversion.

Change-Id: I2129f5ceff8f2525a188ee3ae52f9fe7067bd2e3
parent df70d29b
......@@ -8,12 +8,12 @@ forward_decls qw/aom_scale_forward_decls/;
# Scaler functions
if (aom_config("CONFIG_SPATIAL_RESAMPLING") eq "yes") {
add_proto qw/void aom_horizontal_line_5_4_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void aom_vertical_band_5_4_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_vertical_band_5_4_scale/, "unsigned char *source, int src_pitch, unsigned char *dest, int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_horizontal_line_5_3_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void aom_vertical_band_5_3_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_vertical_band_5_3_scale/, "unsigned char *source, int src_pitch, unsigned char *dest, int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_horizontal_line_2_1_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void aom_vertical_band_2_1_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_vertical_band_2_1_scale/, "unsigned char *source, int src_pitch, unsigned char *dest, int dest_pitch, unsigned int dest_width";
add_proto qw/void aom_vertical_band_2_1_scale_i/, "unsigned char *source, int src_pitch, unsigned char *dest, int dest_pitch, unsigned int dest_width";
}
add_proto qw/void aom_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";
......
......@@ -252,8 +252,8 @@ static void Scale2D(
void (*horiz_line_scale)(const unsigned char *, unsigned int, unsigned char *,
unsigned int) = NULL;
void (*vert_band_scale)(unsigned char *, unsigned int, unsigned char *,
unsigned int, unsigned int) = NULL;
void (*vert_band_scale)(unsigned char *, int, unsigned char *, int,
unsigned int) = NULL;
int ratio_scalable = 1;
int interpolation = 0;
......
......@@ -59,9 +59,8 @@ void aom_horizontal_line_5_4_scale_c(const unsigned char *source,
}
}
void aom_vertical_band_5_4_scale_c(unsigned char *source,
unsigned int src_pitch, unsigned char *dest,
unsigned int dest_pitch,
void aom_vertical_band_5_4_scale_c(unsigned char *source, int src_pitch,
unsigned char *dest, int dest_pitch,
unsigned int dest_width) {
const unsigned char *const dest_end = dest + dest_width;
while (dest < dest_end) {
......@@ -124,9 +123,8 @@ void aom_horizontal_line_5_3_scale_c(const unsigned char *source,
}
}
void aom_vertical_band_5_3_scale_c(unsigned char *source,
unsigned int src_pitch, unsigned char *dest,
unsigned int dest_pitch,
void aom_vertical_band_5_3_scale_c(unsigned char *source, int src_pitch,
unsigned char *dest, int dest_pitch,
unsigned int dest_width) {
const unsigned char *const dest_end = dest + dest_width;
while (dest < dest_end) {
......@@ -178,27 +176,23 @@ void aom_horizontal_line_2_1_scale_c(const unsigned char *source,
}
}
void aom_vertical_band_2_1_scale_c(unsigned char *source,
unsigned int src_pitch, unsigned char *dest,
unsigned int dest_pitch,
void aom_vertical_band_2_1_scale_c(unsigned char *source, int src_pitch,
unsigned char *dest, int dest_pitch,
unsigned int dest_width) {
(void)dest_pitch;
(void)src_pitch;
memcpy(dest, source, dest_width);
}
void aom_vertical_band_2_1_scale_i_c(unsigned char *source,
unsigned int src_pitch,
unsigned char *dest,
unsigned int dest_pitch,
void aom_vertical_band_2_1_scale_i_c(unsigned char *source, int src_pitch,
unsigned char *dest, int dest_pitch,
unsigned int dest_width) {
const unsigned char *const dest_end = dest + dest_width;
const int src_step = src_pitch;
(void)dest_pitch;
while (dest < dest_end) {
const unsigned int a = source[-src_step] * 3;
const unsigned int a = source[-src_pitch] * 3;
const unsigned int b = source[0] * 10;
const unsigned int c = source[src_step] * 3;
const unsigned int c = source[src_pitch] * 3;
dest[0] = (unsigned char)((8 + a + b + c) >> 4);
++source;
++dest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment