Commit c76572af authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge changes Icfc16070,Ied47a248,I8af087d9,I322a1366,If04580af into nextgenv2

* changes:
  Palette: Use inverse_color_order to find color index faster.
  Rewrite some loops to avoid -Wunsafe-loop-optimizations warnings.
  Remove some useless casts
  Add compiler warning flag -Wextra and fix related warnings.
  Declare some array sizes to be constants (known at compile time).
parents 98a306a1 967ff395
......@@ -65,6 +65,10 @@ void aom_convolve8_avg_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(x_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_y;
q0s16 = vld1q_s16(filter_x);
src -= 3; // adjust for taps
......@@ -241,6 +245,10 @@ void aom_convolve8_avg_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(y_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_x;
src -= src_stride * 3;
q0s16 = vld1q_s16(filter_y);
for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h
......
......@@ -65,6 +65,10 @@ void aom_convolve8_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(x_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_y;
q0s16 = vld1q_s16(filter_x);
src -= 3; // adjust for taps
......@@ -225,6 +229,10 @@ void aom_convolve8_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(y_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_x;
src -= src_stride * 3;
q0s16 = vld1q_s16(filter_y);
for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h
......
......@@ -27,6 +27,10 @@ typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, \
ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, \
const int16_t *filter_y, int y_step_q4, int w, int h) { \
(void)filter_x; \
(void)x_step_q4; \
(void)filter_y; \
(void)y_step_q4; \
assert(filter[3] != 128); \
assert(step_q4 == 16); \
if (filter[0] | filter[1] | filter[2]) { \
......
......@@ -68,24 +68,25 @@ static void scale1d_2t1_i(const unsigned char *source, int source_step,
unsigned int source_scale, unsigned int source_length,
unsigned char *dest, int dest_step,
unsigned int dest_scale, unsigned int dest_length) {
unsigned int i, j;
unsigned int temp;
int source_pitch = source_step;
const unsigned int source_pitch = source_step;
const unsigned char *const dest_end = dest + dest_length * dest_step;
(void)source_length;
(void)source_scale;
(void)dest_scale;
source_step *= 2;
dest[0] = source[0];
for (i = dest_step, j = source_step; i < dest_length * dest_step;
i += dest_step, j += source_step) {
temp = 8;
temp += 3 * source[j - source_pitch];
temp += 10 * source[j];
temp += 3 * source[j + source_pitch];
temp >>= 4;
dest[i] = (char)(temp);
source_step *= 2; // Every other row.
dest[0] = source[0]; // Special case: 1st pixel.
source += source_step;
dest += dest_step;
while (dest < dest_end) {
const unsigned int a = 3 * source[-source_pitch];
const unsigned int b = 10 * source[0];
const unsigned int c = 3 * source[source_pitch];
*dest = (unsigned char)((8 + a + b + c) >> 4);
source += source_step;
dest += dest_step;
}
}
......@@ -119,17 +120,18 @@ static void scale1d_2t1_ps(const unsigned char *source, int source_step,
unsigned int source_length, unsigned char *dest,
int dest_step, unsigned int dest_scale,
unsigned int dest_length) {
unsigned int i, j;
const unsigned char *const dest_end = dest + dest_length * dest_step;
(void)source_length;
(void)source_scale;
(void)dest_scale;
source_step *= 2;
j = 0;
source_step *= 2; // Every other row.
for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step)
dest[i] = source[j];
while (dest < dest_end) {
*dest = *source;
source += source_step;
dest += dest_step;
}
}
/****************************************************************************
*
......@@ -159,12 +161,12 @@ static void scale1d_c(const unsigned char *source, int source_step,
unsigned int source_scale, unsigned int source_length,
unsigned char *dest, int dest_step,
unsigned int dest_scale, unsigned int dest_length) {
unsigned int i;
unsigned int round_value = dest_scale / 2;
const unsigned char *const dest_end = dest + dest_length * dest_step;
const unsigned int round_value = dest_scale / 2;
unsigned int left_modifier = dest_scale;
unsigned int right_modifier = 0;
unsigned char left_pixel = *source;
unsigned char right_pixel = *(source + source_step);
unsigned char left_pixel = source[0];
unsigned char right_pixel = source[source_step];
(void)source_length;
......@@ -173,18 +175,18 @@ static void scale1d_c(const unsigned char *source, int source_step,
/* assert ( (source_length - 1) * dest_scale >= (dest_length - 1) *
* source_scale);*/
for (i = 0; i < dest_length * dest_step; i += dest_step) {
dest[i] = (char)((left_modifier * left_pixel +
right_modifier * right_pixel + round_value) /
dest_scale);
while (dest < dest_end) {
*dest = (unsigned char)((left_modifier * left_pixel +
right_modifier * right_pixel + round_value) /
dest_scale);
right_modifier += source_scale;
while (right_modifier > dest_scale) {
right_modifier -= dest_scale;
source += source_step;
left_pixel = *source;
right_pixel = *(source + source_step);
left_pixel = source[0];
right_pixel = source[source_step];
}
left_modifier = dest_scale - right_modifier;
......@@ -236,11 +238,10 @@ static void Scale2D(
unsigned int dest_width, unsigned int dest_height, unsigned char *temp_area,
unsigned char temp_area_height, unsigned int hscale, unsigned int hratio,
unsigned int vscale, unsigned int vratio, unsigned int interlaced) {
/*unsigned*/
int i, j, k;
int bands;
int dest_band_height;
int source_band_height;
unsigned int i, j, k;
unsigned int bands;
unsigned int dest_band_height;
unsigned int source_band_height;
typedef void (*Scale1D)(const unsigned char *source, int source_step,
unsigned int source_scale, unsigned int source_length,
......@@ -331,7 +332,7 @@ static void Scale2D(
if (ratio_scalable) {
if (source_height == dest_height) {
/* for each band of the image */
for (k = 0; k < (int)dest_height; k++) {
for (k = 0; k < dest_height; ++k) {
horiz_line_scale(source, source_width, dest, dest_width);
source += source_pitch;
dest += dest_pitch;
......@@ -346,14 +347,13 @@ static void Scale2D(
horiz_line_scale(source, source_width, temp_area, dest_width);
}
for (k = 0;
k < (int)(dest_height + dest_band_height - 1) / dest_band_height;
k++) {
for (k = 0; k < (dest_height + dest_band_height - 1) / dest_band_height;
++k) {
/* scale one band horizontally */
for (i = 0; i < source_band_height; i++) {
for (i = 0; i < source_band_height; ++i) {
/* Trap case where we could read off the base of the source buffer */
line_src = (unsigned char *)source + i * source_pitch;
line_src = source + i * source_pitch;
if (line_src < source_base) line_src = source_base;
......@@ -388,7 +388,7 @@ static void Scale2D(
if (source_height == dest_height) {
/* for each band of the image */
for (k = 0; k < (int)dest_height; k++) {
for (k = 0; k < dest_height; ++k) {
Scale1Dh(source, 1, hscale, source_width + 1, dest, 1, hratio,
dest_width);
source += source_pitch;
......@@ -414,10 +414,10 @@ static void Scale2D(
/* for each band of the image */
bands = (dest_height + dest_band_height - 1) / dest_band_height;
for (k = 0; k < bands; k++) {
for (k = 0; k < bands; ++k) {
/* scale one band horizontally */
for (i = 1; i < source_band_height + 1; i++) {
if (k * source_band_height + i < (int)source_height) {
for (i = 1; i < source_band_height + 1; ++i) {
if (k * source_band_height + i < source_height) {
Scale1Dh(source + i * source_pitch, 1, hscale, source_width + 1,
temp_area + i * dest_pitch, 1, hratio, dest_width);
} else { /* Duplicate the last row */
......@@ -428,7 +428,7 @@ static void Scale2D(
}
/* scale one band vertically */
for (j = 0; j < (int)dest_width; j++) {
for (j = 0; j < dest_width; ++j) {
Scale1Dv(&temp_area[j], dest_pitch, vscale, source_band_height + 1,
&dest[j], dest_pitch, vratio, dest_band_height);
}
......@@ -487,12 +487,12 @@ void aom_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
temp_area, temp_height, hscale, hratio, vscale, vratio, interlaced);
if (dw < (int)dst->y_width)
for (i = 0; i < dh; i++)
for (i = 0; i < dh; ++i)
memset(dst->y_buffer + i * dst->y_stride + dw - 1,
dst->y_buffer[i * dst->y_stride + dw - 2], dst->y_width - dw + 1);
if (dh < (int)dst->y_height)
for (i = dh - 1; i < (int)dst->y_height; i++)
for (i = dh - 1; i < (int)dst->y_height; ++i)
memcpy(dst->y_buffer + i * dst->y_stride,
dst->y_buffer + (dh - 2) * dst->y_stride, dst->y_width + 1);
......@@ -502,13 +502,13 @@ void aom_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
vratio, interlaced);
if (dw / 2 < (int)dst->uv_width)
for (i = 0; i < dst->uv_height; i++)
for (i = 0; i < dst->uv_height; ++i)
memset(dst->u_buffer + i * dst->uv_stride + dw / 2 - 1,
dst->u_buffer[i * dst->uv_stride + dw / 2 - 2],
dst->uv_width - dw / 2 + 1);
if (dh / 2 < (int)dst->uv_height)
for (i = dh / 2 - 1; i < (int)dst->y_height / 2; i++)
for (i = dh / 2 - 1; i < (int)dst->y_height / 2; ++i)
memcpy(dst->u_buffer + i * dst->uv_stride,
dst->u_buffer + (dh / 2 - 2) * dst->uv_stride, dst->uv_width);
......@@ -518,13 +518,13 @@ void aom_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
vratio, interlaced);
if (dw / 2 < (int)dst->uv_width)
for (i = 0; i < dst->uv_height; i++)
for (i = 0; i < dst->uv_height; ++i)
memset(dst->v_buffer + i * dst->uv_stride + dw / 2 - 1,
dst->v_buffer[i * dst->uv_stride + dw / 2 - 2],
dst->uv_width - dw / 2 + 1);
if (dh / 2 < (int)dst->uv_height)
for (i = dh / 2 - 1; i < (int)dst->y_height / 2; i++)
for (i = dh / 2 - 1; i < (int)dst->y_height / 2; ++i)
memcpy(dst->v_buffer + i * dst->uv_stride,
dst->v_buffer + (dh / 2 - 2) * dst->uv_stride, dst->uv_width);
}
......@@ -39,27 +39,23 @@ void aom_horizontal_line_5_4_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
unsigned i;
unsigned int a, b, c, d, e;
unsigned char *des = dest;
const unsigned char *src = source;
const unsigned char *const source_end = source + source_width;
(void)dest_width;
for (i = 0; i < source_width; i += 5) {
a = src[0];
b = src[1];
c = src[2];
d = src[3];
e = src[4];
while (source < source_end) {
const unsigned int a = source[0];
const unsigned int b = source[1];
const unsigned int c = source[2];
const unsigned int d = source[3];
const unsigned int e = source[4];
des[0] = (unsigned char)a;
des[1] = (unsigned char)((b * 192 + c * 64 + 128) >> 8);
des[2] = (unsigned char)((c * 128 + d * 128 + 128) >> 8);
des[3] = (unsigned char)((d * 64 + e * 192 + 128) >> 8);
dest[0] = (unsigned char)a;
dest[1] = (unsigned char)((b * 192 + c * 64 + 128) >> 8);
dest[2] = (unsigned char)((c * 128 + d * 128 + 128) >> 8);
dest[3] = (unsigned char)((d * 64 + e * 192 + 128) >> 8);
src += 5;
des += 4;
source += 5;
dest += 4;
}
}
......@@ -67,25 +63,21 @@ void aom_vertical_band_5_4_scale_c(unsigned char *source,
unsigned int src_pitch, unsigned char *dest,
unsigned int dest_pitch,
unsigned int dest_width) {
unsigned int i;
unsigned int a, b, c, d, e;
unsigned char *des = dest;
unsigned char *src = source;
for (i = 0; i < dest_width; i++) {
a = src[0 * src_pitch];
b = src[1 * src_pitch];
c = src[2 * src_pitch];
d = src[3 * src_pitch];
e = src[4 * src_pitch];
des[0 * dest_pitch] = (unsigned char)a;
des[1 * dest_pitch] = (unsigned char)((b * 192 + c * 64 + 128) >> 8);
des[2 * dest_pitch] = (unsigned char)((c * 128 + d * 128 + 128) >> 8);
des[3 * dest_pitch] = (unsigned char)((d * 64 + e * 192 + 128) >> 8);
src++;
des++;
const unsigned char *const dest_end = dest + dest_width;
while (dest < dest_end) {
const unsigned int a = source[0 * src_pitch];
const unsigned int b = source[1 * src_pitch];
const unsigned int c = source[2 * src_pitch];
const unsigned int d = source[3 * src_pitch];
const unsigned int e = source[4 * src_pitch];
dest[0 * dest_pitch] = (unsigned char)a;
dest[1 * dest_pitch] = (unsigned char)((b * 192 + c * 64 + 128) >> 8);
dest[2 * dest_pitch] = (unsigned char)((c * 128 + d * 128 + 128) >> 8);
dest[3 * dest_pitch] = (unsigned char)((d * 64 + e * 192 + 128) >> 8);
++source;
++dest;
}
}
......@@ -114,26 +106,21 @@ void aom_horizontal_line_5_3_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
unsigned int i;
unsigned int a, b, c, d, e;
unsigned char *des = dest;
const unsigned char *src = source;
const unsigned char *const source_end = source + source_width;
(void)dest_width;
for (i = 0; i < source_width; i += 5) {
a = src[0];
b = src[1];
c = src[2];
d = src[3];
e = src[4];
des[0] = (unsigned char)a;
des[1] = (unsigned char)((b * 85 + c * 171 + 128) >> 8);
des[2] = (unsigned char)((d * 171 + e * 85 + 128) >> 8);
src += 5;
des += 3;
while (source < source_end) {
const unsigned int a = source[0];
const unsigned int b = source[1];
const unsigned int c = source[2];
const unsigned int d = source[3];
const unsigned int e = source[4];
dest[0] = (unsigned char)a;
dest[1] = (unsigned char)((b * 85 + c * 171 + 128) >> 8);
dest[2] = (unsigned char)((d * 171 + e * 85 + 128) >> 8);
source += 5;
dest += 3;
}
}
......@@ -141,24 +128,20 @@ void aom_vertical_band_5_3_scale_c(unsigned char *source,
unsigned int src_pitch, unsigned char *dest,
unsigned int dest_pitch,
unsigned int dest_width) {
unsigned int i;
unsigned int a, b, c, d, e;
unsigned char *des = dest;
unsigned char *src = source;
for (i = 0; i < dest_width; i++) {
a = src[0 * src_pitch];
b = src[1 * src_pitch];
c = src[2 * src_pitch];
d = src[3 * src_pitch];
e = src[4 * src_pitch];
des[0 * dest_pitch] = (unsigned char)a;
des[1 * dest_pitch] = (unsigned char)((b * 85 + c * 171 + 128) >> 8);
des[2 * dest_pitch] = (unsigned char)((d * 171 + e * 85 + 128) >> 8);
src++;
des++;
const unsigned char *const dest_end = dest + dest_width;
while (dest < dest_end) {
const unsigned int a = source[0 * src_pitch];
const unsigned int b = source[1 * src_pitch];
const unsigned int c = source[2 * src_pitch];
const unsigned int d = source[3 * src_pitch];
const unsigned int e = source[4 * src_pitch];
dest[0 * dest_pitch] = (unsigned char)a;
dest[1 * dest_pitch] = (unsigned char)((b * 85 + c * 171 + 128) >> 8);
dest[2 * dest_pitch] = (unsigned char)((d * 171 + e * 85 + 128) >> 8);
++source;
++dest;
}
}
......@@ -186,18 +169,12 @@ void aom_horizontal_line_2_1_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
unsigned int i;
unsigned int a;
unsigned char *des = dest;
const unsigned char *src = source;
const unsigned char *const source_end = source + source_width;
(void)dest_width;
for (i = 0; i < source_width; i += 2) {
a = src[0];
des[0] = (unsigned char)(a);
src += 2;
des += 1;
while (source < source_end) {
dest[0] = source[0];
source += 2;
++dest;
}
}
......@@ -215,18 +192,14 @@ void aom_vertical_band_2_1_scale_i_c(unsigned char *source,
unsigned char *dest,
unsigned int dest_pitch,
unsigned int dest_width) {
int i;
int temp;
int width = dest_width;
const unsigned char *const dest_end = dest + dest_width;
(void)dest_pitch;
for (i = 0; i < width; i++) {
temp = 8;
temp += source[i - (int)src_pitch] * 3;
temp += source[i] * 10;
temp += source[i + src_pitch] * 3;
temp >>= 4;
dest[i] = (unsigned char)(temp);
while (dest < dest_end) {
const unsigned int a = source[-src_pitch] * 3;
const unsigned int b = source[0] * 10;
const unsigned int c = source[src_pitch] * 3;
dest[0] = (unsigned char)((8 + a + b + c) >> 4);
++source;
++dest;
}
}
......@@ -1415,9 +1415,8 @@ static void open_output_file(struct stream_state *stream,
#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
stream->webm_ctx.stream = stream->file;
write_webm_file_header(&stream->webm_ctx, cfg, &global->framerate,
stream->config.stereo_fmt, global->codec->fourcc,
pixel_aspect_ratio);
write_webm_file_header(&stream->webm_ctx, cfg, stream->config.stereo_fmt,
global->codec->fourcc, pixel_aspect_ratio);
}
#else
(void)pixel_aspect_ratio;
......
......@@ -828,7 +828,7 @@ static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx,
va_list args) {
aom_ref_frame_t *data = va_arg(args, aom_ref_frame_t *);
const aom_ref_frame_t *const frame = va_arg(args, aom_ref_frame_t *);
// Only support this function in serial decode.
if (ctx->frame_parallel_decode) {
......@@ -836,8 +836,7 @@ static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx,
return AOM_CODEC_INCAPABLE;
}
if (data) {
aom_ref_frame_t *frame = (aom_ref_frame_t *)data;
if (frame) {
YV12_BUFFER_CONFIG sd;
AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
......
......@@ -892,13 +892,14 @@ static const aom_prob default_rect_tx_prob[TX_SIZES - 1] = { 192, 192, 192 };
#if CONFIG_PALETTE
int av1_get_palette_color_context(const uint8_t *color_map, int cols, int r,
int c, int n, int *color_order) {
int c, int n, uint8_t *color_order,
int *color_idx) {
int i, j, max, max_idx, temp;
int scores[PALETTE_MAX_SIZE + 10];
int weights[4] = { 3, 2, 3, 2 };
int color_ctx = 0;
int color_neighbors[4];
int inverse_color_order[PALETTE_MAX_SIZE];
assert(n <= PALETTE_MAX_SIZE);
if (c - 1 >= 0)
......@@ -918,7 +919,10 @@ int av1_get_palette_color_context(const uint8_t *color_map, int cols, int r,
else
color_neighbors[3] = -1;
for (i = 0; i < PALETTE_MAX_SIZE; ++i) color_order[i] = i;
for (i = 0; i < PALETTE_MAX_SIZE; ++i) {
color_order[i] = i;
inverse_color_order[i] = i;
}
memset(scores, 0, PALETTE_MAX_SIZE * sizeof(scores[0]));
for (i = 0; i < 4; ++i) {
if (color_neighbors[i] >= 0) scores[color_neighbors[i]] += weights[i];
......@@ -944,6 +948,8 @@ int av1_get_palette_color_context(const uint8_t *color_map, int cols, int r,
temp = color_order[i];
color_order[i] = color_order[max_idx];
color_order[max_idx] = temp;
inverse_color_order[color_order[i]] = i;
inverse_color_order[color_order[max_idx]] = max_idx;
}
}
......@@ -956,7 +962,9 @@ int av1_get_palette_color_context(const uint8_t *color_map, int cols, int r,
}
if (color_ctx >= PALETTE_COLOR_CONTEXTS) color_ctx = 0;
if (color_idx != NULL) {
*color_idx = inverse_color_order[color_map[r * cols + c]];
}
return color_ctx;
}
#endif // CONFIG_PALETTE
......
......@@ -359,7 +359,8 @@ static INLINE int av1_ceil_log2(int n) {
#if CONFIG_PALETTE
int av1_get_palette_color_context(const uint8_t *color_map, int cols, int r,
int c, int n, int *color_order);
int c, int n, uint8_t *color_order,
int *color_idx);
#endif // CONFIG_PALETTE
#ifdef __cplusplus
......
......@@ -338,15 +338,15 @@ static void dec_set_contexts(const MACROBLOCKD *xd,
#if CONFIG_PALETTE
void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
aom_reader *r) {
MODE_INFO *const mi = xd->mi[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
const MODE_INFO *const mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int rows = (4 * num_4x4_blocks_high_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_y);
const int cols = (4 * num_4x4_blocks_wide_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_x);
int color_idx, color_ctx, color_order[PALETTE_MAX_SIZE];
int n = mbmi->palette_mode_info.palette_size[plane != 0];
uint8_t color_order[PALETTE_MAX_SIZE];
const int n = mbmi->palette_mode_info.palette_size[plane != 0];
int i, j;
uint8_t *color_map = xd->plane[plane != 0].color_index_map;
const aom_prob(*const prob)[PALETTE_COLOR_CONTEXTS][PALETTE_COLORS - 1] =
......@@ -355,10 +355,10 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
for (i = 0; i < rows; ++i) {
for (j = (i == 0 ? 1 : 0); j < cols; ++j) {
color_ctx =
av1_get_palette_color_context(color_map, cols, i, j, n, color_order);
color_idx = aom_read_tree(r, av1_palette_color_tree[n - 2],
prob[n - 2][color_ctx], ACCT_STR);
const int color_ctx = av1_get_palette_color_context(color_map, cols, i, j,
n, color_order, NULL);
const int color_idx = aom_read_tree(r, av1_palette_color_tree[n - 2],
prob[n - 2][color_ctx], ACCT_STR);
assert(color_idx >= 0 && color_idx < n);
color_map[i * cols + j] = color_order[color_idx];
}
......
......@@ -422,39 +422,6 @@ static void dealloc_compressor_data(AV1_COMP *cpi) {
aom_free(cpi->segmentation_map);
cpi->segmentation_map = NULL;
#if CONFIG_REF_MV
for (i = 0; i < NMV_CONTEXTS; ++i) {
aom_free(cpi->nmv_costs[i][0]);
aom_free(cpi->nmv_costs[i][1]);
aom_free(cpi->nmv_costs_hp[i][0]);
aom_free(cpi->nmv_costs_hp[i][1]);
cpi->nmv_costs[i][0] = NULL;
cpi->nmv_costs[i][1] = NULL;
cpi->nmv_costs_hp[i][0] = NULL;
cpi->nmv_costs_hp[i][1] = NULL;
}
#endif
aom_free(cpi->nmvcosts[0]);
aom_free(cpi->nmvcosts[1]);
cpi->nmvcosts[0] = NULL;
cpi->nmvcosts[1] = NULL;
aom_free(cpi->nmvcosts_hp[0]);