Commit b56f3af7 authored by Tim Kopp's avatar Tim Kopp
Browse files

Fixes in VP9 alloc, free, and COPY_FRAME case

Change-Id: I1216f17e2206ef521fe219b6d72d8e41d1ba1147
parent 0fec8f97
...@@ -69,7 +69,7 @@ int update_running_avg(uint8_t *mc_avg, int mc_avg_stride, uint8_t *avg, ...@@ -69,7 +69,7 @@ int update_running_avg(uint8_t *mc_avg, int mc_avg_stride, uint8_t *avg,
} }
uint8_t *block_start(uint8_t *framebuf, int stride, int mi_row, int mi_col) { uint8_t *block_start(uint8_t *framebuf, int stride, int mi_row, int mi_col) {
return framebuf + (stride * mi_row) + mi_col; return framebuf + (stride * mi_row * 8) + (mi_col * 8);
} }
void copy_block(uint8_t *dest, int dest_stride, void copy_block(uint8_t *dest, int dest_stride,
...@@ -85,8 +85,7 @@ void copy_block(uint8_t *dest, int dest_stride, ...@@ -85,8 +85,7 @@ void copy_block(uint8_t *dest, int dest_stride,
return; return;
} }
void vp9_denoiser_denoise(VP9_DENOISER *denoiser, void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
MACROBLOCK *mb, MODE_INFO **grid,
int mi_row, int mi_col, BLOCK_SIZE bs) { int mi_row, int mi_col, BLOCK_SIZE bs) {
int decision = COPY_BLOCK; int decision = COPY_BLOCK;
...@@ -103,16 +102,26 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, ...@@ -103,16 +102,26 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser,
} }
if (decision == COPY_BLOCK) { if (decision == COPY_BLOCK) {
copy_block(block_start(avg.y_buffer, avg.y_stride, mi_row, mi_col), copy_block(block_start(avg.y_buffer, avg.y_stride, mi_row, mi_col),
avg.y_stride, avg.y_stride, src.buf, src.stride, bs);
block_start(src.buf, src.stride, mi_row, mi_col),
src.stride,
bs);
} }
return; return;
} }
void copy_frame(YV12_BUFFER_CONFIG dest, YV12_BUFFER_CONFIG src) { void copy_frame(YV12_BUFFER_CONFIG dest, YV12_BUFFER_CONFIG src) {
memcpy(dest.buffer_alloc, src.buffer_alloc, src.buffer_alloc_sz); int r, c;
uint8_t *srcbuf = src.y_buffer;
uint8_t *destbuf = dest.y_buffer;
assert(dest.y_width == src.y_width);
assert(dest.y_height == src.y_height);
for (r = 0; r < dest.y_height; ++r) {
for (c = 0; c < dest.y_width; ++c) {
destbuf[c] = srcbuf[c];
}
destbuf += dest.y_stride;
srcbuf += src.y_stride;
}
return;
} }
void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
......
...@@ -35,8 +35,7 @@ void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, ...@@ -35,8 +35,7 @@ void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
int refresh_golden_frame, int refresh_golden_frame,
int refresh_last_frame); int refresh_last_frame);
void vp9_denoiser_denoise(VP9_DENOISER *denoiser, void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
MACROBLOCK *mb, MODE_INFO **grid,
int mi_row, int mi_col, BLOCK_SIZE bs); int mi_row, int mi_col, BLOCK_SIZE bs);
void vp9_denoiser_update_frame_stats(); void vp9_denoiser_update_frame_stats();
......
...@@ -495,8 +495,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -495,8 +495,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
} }
} }
#if CONFIG_DENOISING #if CONFIG_DENOISING
vp9_denoiser_denoise(&cpi->denoiser, x, cpi->common.mi_grid_visible, mi_row, vp9_denoiser_denoise(&cpi->denoiser, x, mi_row, mi_col, bsize);
mi_col, bsize);
#endif #endif
return INT64_MAX; return INT64_MAX;
......
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