summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchiyotsai <chiyotsai@google.com>2019-01-31 21:39:19 -0800
committerchiyotsai <chiyotsai@google.com>2019-02-04 14:12:11 -0800
commit4cab8adc9e6274a62c796f9434459f316f622652 (patch)
treef89a5ce047fd2053a4b83665ff3fdddce9895131
parent3248ea0e455aa3a57e9b034d740181d216c99cfb (diff)
downloadlibvpx-4cab8adc9e6274a62c796f9434459f316f622652.tar
libvpx-4cab8adc9e6274a62c796f9434459f316f622652.tar.gz
libvpx-4cab8adc9e6274a62c796f9434459f316f622652.tar.bz2
libvpx-4cab8adc9e6274a62c796f9434459f316f622652.zip
Some cosmetic fixes to temporal filter
BUG=webm:1591 Change-Id: I34fd7e6cbe6f3d5486a669d0895402fd21de7641
-rw-r--r--vp9/encoder/vp9_temporal_filter.c30
-rw-r--r--vp9/encoder/x86/temporal_filter_sse4.c8
2 files changed, 19 insertions, 19 deletions
diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c
index d02603615..0b636b85c 100644
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -225,24 +225,24 @@ static INLINE int get_filter_weight(unsigned int i, unsigned int j,
unsigned int block_height,
unsigned int block_width,
const int *const blk_fw, int use_32x32) {
- int filter_weight = 0;
-
- if (use_32x32)
- // blk_fw[0] ~ blk_fw[3] are the same.
+ // blk_fw[0] ~ blk_fw[3] are the same.
+ if (use_32x32) {
return blk_fw[0];
+ }
if (i < block_height / 2) {
- if (j < block_width / 2)
- filter_weight = blk_fw[0];
- else
- filter_weight = blk_fw[1];
- } else {
- if (j < block_width / 2)
- filter_weight = blk_fw[2];
- else
- filter_weight = blk_fw[3];
+ if (j < block_width / 2) {
+ return blk_fw[0];
+ }
+
+ return blk_fw[1];
+ }
+
+ if (j < block_width / 2) {
+ return blk_fw[2];
}
- return filter_weight;
+
+ return blk_fw[3];
}
void vp9_apply_temporal_filter_c(
@@ -296,7 +296,7 @@ void vp9_apply_temporal_filter_c(
for (i = 0, k = 0, m = 0; i < block_height; i++) {
for (j = 0; j < block_width; j++) {
const int pixel_value = y_pred[i * y_buf_stride + j];
- int filter_weight =
+ const int filter_weight =
get_filter_weight(i, j, block_height, block_width, blk_fw, use_32x32);
// non-local mean approach
diff --git a/vp9/encoder/x86/temporal_filter_sse4.c b/vp9/encoder/x86/temporal_filter_sse4.c
index 9f9483a9b..76c0d5a29 100644
--- a/vp9/encoder/x86/temporal_filter_sse4.c
+++ b/vp9/encoder/x86/temporal_filter_sse4.c
@@ -254,7 +254,7 @@ static INLINE void read_chroma_dist_row_16(int ss_x, const uint16_t *u_dist,
__m128i *v_first,
__m128i *v_second) {
if (!ss_x) {
- // If there is no chroma subsampling in the horizaontal direction, then we
+ // If there is no chroma subsampling in the horizontal direction, then we
// need to load 16 entries from chroma.
read_dist_16(u_dist, u_first, u_second);
read_dist_16(v_dist, v_first, v_second);
@@ -274,8 +274,8 @@ static INLINE void read_chroma_dist_row_16(int ss_x, const uint16_t *u_dist,
}
}
-// Horizonta add unsigned 16-bit ints in src and store them as signed 32-bit int
-// in dst.
+// Horizontal add unsigned 16-bit ints in src and store them as signed 32-bit
+// int in dst.
static INLINE void hadd_epu16(__m128i *src, __m128i *dst) {
const __m128i zero = _mm_setzero_si128();
const __m128i shift_right = _mm_srli_si128(*src, 2);
@@ -323,7 +323,7 @@ static INLINE void add_luma_dist_to_8_chroma_mod(const uint16_t *y_dist,
// Apply temporal filter to the luma components. This performs temporal
// filtering on a luma block of 16 X block_height. Use blk_fw as an array of
-// size 4for the weights for each of the 4 subblocks if blk_fw is not NULL,
+// size 4 for the weights for each of the 4 subblocks if blk_fw is not NULL,
// else use top_weight for top half, and bottom weight for bottom half.
static void vp9_apply_temporal_filter_luma_16(
const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre,