This commit is contained in:
Anthony Minessale
2019-09-11 15:51:47 +00:00
committed by Andrey Volk
parent 34fcadbd53
commit ceb051af4e
821 changed files with 89961 additions and 48650 deletions

View File

@@ -424,11 +424,11 @@ void vp9_resize_plane(const uint8_t *const input, int height, int width,
int in_stride, uint8_t *output, int height2, int width2,
int out_stride) {
int i;
uint8_t *intbuf = (uint8_t *)malloc(sizeof(uint8_t) * width2 * height);
uint8_t *intbuf = (uint8_t *)calloc(width2 * height, sizeof(*intbuf));
uint8_t *tmpbuf =
(uint8_t *)malloc(sizeof(uint8_t) * (width < height ? height : width));
uint8_t *arrbuf = (uint8_t *)malloc(sizeof(uint8_t) * height);
uint8_t *arrbuf2 = (uint8_t *)malloc(sizeof(uint8_t) * height2);
(uint8_t *)calloc(width < height ? height : width, sizeof(*tmpbuf));
uint8_t *arrbuf = (uint8_t *)calloc(height, sizeof(*arrbuf));
uint8_t *arrbuf2 = (uint8_t *)calloc(height2, sizeof(*arrbuf2));
if (intbuf == NULL || tmpbuf == NULL || arrbuf == NULL || arrbuf2 == NULL)
goto Error;
assert(width > 0);
@@ -506,10 +506,12 @@ static void highbd_interpolate(const uint16_t *const input, int inlength,
sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK;
filter = interp_filters[sub_pel];
sum = 0;
for (k = 0; k < INTERP_TAPS; ++k)
for (k = 0; k < INTERP_TAPS; ++k) {
assert(int_pel - INTERP_TAPS / 2 + 1 + k < inlength);
sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k < 0
? 0
: int_pel - INTERP_TAPS / 2 + 1 + k)];
}
*optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd);
}
// Middle part.
@@ -720,6 +722,10 @@ void vp9_highbd_resize_plane(const uint8_t *const input, int height, int width,
uint16_t *arrbuf2 = (uint16_t *)malloc(sizeof(uint16_t) * height2);
if (intbuf == NULL || tmpbuf == NULL || arrbuf == NULL || arrbuf2 == NULL)
goto Error;
assert(width > 0);
assert(height > 0);
assert(width2 > 0);
assert(height2 > 0);
for (i = 0; i < height; ++i) {
highbd_resize_multistep(CONVERT_TO_SHORTPTR(input + in_stride * i), width,
intbuf + width2 * i, width2, tmpbuf, bd);