Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: source/libvpx/vp9/common/vp9_postproc.c

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_onyxc_int.h ('k') | source/libvpx/vp9/common/vp9_pred_common.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_postproc.c
diff --git a/source/libvpx/vp9/common/vp9_postproc.c b/source/libvpx/vp9/common/vp9_postproc.c
index bb21ade4037c9e58cf7ec5181d131b56452607b0..983a4744dd64a677538cafca252b35a272c30466 100644
--- a/source/libvpx/vp9/common/vp9_postproc.c
+++ b/source/libvpx/vp9/common/vp9_postproc.c
@@ -91,10 +91,7 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr,
int flimit) {
uint8_t const *p_src;
uint8_t *p_dst;
- int row;
- int col;
- int i;
- int v;
+ int row, col, i, v, kernel;
int pitch = src_pixels_per_line;
uint8_t d[8];
(void)dst_pixels_per_line;
@@ -105,8 +102,8 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr,
p_dst = dst_ptr;
for (col = 0; col < cols; col++) {
- int kernel = 4;
- int v = p_src[col];
+ kernel = 4;
+ v = p_src[col];
for (i = -2; i <= 2; i++) {
if (abs(v - p_src[col + i * pitch]) > flimit)
@@ -128,7 +125,7 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr,
d[i] = p_src[i];
for (col = 0; col < cols; col++) {
- int kernel = 4;
+ kernel = 4;
v = p_src[col];
d[col & 7] = v;
@@ -168,10 +165,7 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr,
int flimit) {
uint16_t const *p_src;
uint16_t *p_dst;
- int row;
- int col;
- int i;
- int v;
+ int row, col, i, v, kernel;
int pitch = src_pixels_per_line;
uint16_t d[8];
@@ -181,8 +175,8 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr,
p_dst = dst_ptr;
for (col = 0; col < cols; col++) {
- int kernel = 4;
- int v = p_src[col];
+ kernel = 4;
+ v = p_src[col];
for (i = -2; i <= 2; i++) {
if (abs(v - p_src[col + i * pitch]) > flimit)
@@ -205,7 +199,7 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr,
d[i] = p_src[i];
for (col = 0; col < cols; col++) {
- int kernel = 4;
+ kernel = 4;
v = p_src[col];
d[col & 7] = v;
@@ -518,22 +512,24 @@ void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
assert((src->flags & YV12_FLAG_HIGHBITDEPTH) ==
(dst->flags & YV12_FLAG_HIGHBITDEPTH));
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
- const uint16_t *const src = CONVERT_TO_SHORTPTR(srcs[i] + 2 * src_stride
- + 2);
- uint16_t *const dst = CONVERT_TO_SHORTPTR(dsts[i] + 2 * dst_stride + 2);
- vp9_highbd_post_proc_down_and_across(src, dst, src_stride, dst_stride,
- src_height, src_width, ppl);
+ const uint16_t *const src_plane = CONVERT_TO_SHORTPTR(
+ srcs[i] + 2 * src_stride + 2);
+ uint16_t *const dst_plane = CONVERT_TO_SHORTPTR(
+ dsts[i] + 2 * dst_stride + 2);
+ vp9_highbd_post_proc_down_and_across(src_plane, dst_plane, src_stride,
+ dst_stride, src_height, src_width,
+ ppl);
} else {
- const uint8_t *const src = srcs[i] + 2 * src_stride + 2;
- uint8_t *const dst = dsts[i] + 2 * dst_stride + 2;
+ const uint8_t *const src_plane = srcs[i] + 2 * src_stride + 2;
+ uint8_t *const dst_plane = dsts[i] + 2 * dst_stride + 2;
- vp9_post_proc_down_and_across(src, dst, src_stride, dst_stride,
- src_height, src_width, ppl);
+ vp9_post_proc_down_and_across(src_plane, dst_plane, src_stride,
+ dst_stride, src_height, src_width, ppl);
}
#else
- const uint8_t *const src = srcs[i] + 2 * src_stride + 2;
- uint8_t *const dst = dsts[i] + 2 * dst_stride + 2;
- vp9_post_proc_down_and_across(src, dst, src_stride, dst_stride,
+ const uint8_t *const src_plane = srcs[i] + 2 * src_stride + 2;
+ uint8_t *const dst_plane = dsts[i] + 2 * dst_stride + 2;
+ vp9_post_proc_down_and_across(src_plane, dst_plane, src_stride, dst_stride,
src_height, src_width, ppl);
#endif
}
@@ -558,16 +554,15 @@ static void fillrd(struct postproc_state *state, int q, int a) {
* a gaussian distribution with sigma determined by q.
*/
{
- double i;
int next, j;
next = 0;
for (i = -32; i < 32; i++) {
- int a = (int)(0.5 + 256 * gaussian(sigma, 0, i));
+ int a_i = (int)(0.5 + 256 * gaussian(sigma, 0, i));
- if (a) {
- for (j = 0; j < a; j++) {
+ if (a_i) {
+ for (j = 0; j < a_i; j++) {
char_dist[next + j] = (char) i;
}
@@ -656,8 +651,8 @@ int vp9_post_proc_frame(struct VP9Common *cm,
return 1;
}
ppstate->prev_mi = ppstate->prev_mip + cm->mi_stride + 1;
- vpx_memset(ppstate->prev_mip, 0,
- cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
+ memset(ppstate->prev_mip, 0,
+ cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
}
// Allocate post_proc_buffer_int if needed.
@@ -679,8 +674,8 @@ int vp9_post_proc_frame(struct VP9Common *cm,
// Ensure that postproc is set to all 0s so that post proc
// doesn't pull random data in from edge.
- vpx_memset(cm->post_proc_buffer_int.buffer_alloc, 128,
- cm->post_proc_buffer.frame_size);
+ memset(cm->post_proc_buffer_int.buffer_alloc, 128,
+ cm->post_proc_buffer.frame_size);
}
}
« no previous file with comments | « source/libvpx/vp9/common/vp9_onyxc_int.h ('k') | source/libvpx/vp9/common/vp9_pred_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698