Multiplication is avoided and the newer code does not produce int-in-bool-context-warning. draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:00:27 +0900
changeset 81079 e9d66487de46fc4f2a46c221ec2474ae5cf76fe9
parent 81078 3ea553d1a739a8a3ad38cd3eb73ba1868635e852
child 81080 0c88b04a1a7bc6d233eb0185b40ffa2c6b9f82a3
push id9744
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:01:06 +0000
treeherdertry-comm-central@56c83244ac0e [default view] [failures only]
Multiplication is avoided and the newer code does not produce int-in-bool-context-warning.
mozilla-M-C-017-video_denoiser-int-in-bool-context.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-017-video_denoiser-int-in-bool-context.patch
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  a7dc5d71c52da2ec1936be84993a7ab8ce0925e2
+Multiplication is avoided and the newer code does not produce int-in-bool-context-warning.
+
+diff --git a/media/webrtc/trunk/webrtc/modules/video_processing/video_denoiser.cc b/media/webrtc/trunk/webrtc/modules/video_processing/video_denoiser.cc
+--- a/media/webrtc/trunk/webrtc/modules/video_processing/video_denoiser.cc
++++ b/media/webrtc/trunk/webrtc/modules/video_processing/video_denoiser.cc
+@@ -177,17 +177,19 @@ void VideoDenoiser::CopySrcOnMOB(const u
+       const int mb_index = mb_index_base + mb_col;
+       const uint32_t offset_col = mb_col << 4;
+       const uint8_t* mb_src = mb_src_base + offset_col;
+       uint8_t* mb_dst = mb_dst_base + offset_col;
+       // Check if the block is a moving object block or may cause a trailing
+       // artifacts.
+       if (mb_filter_decision_[mb_index] != FILTER_BLOCK ||
+           IsTrailingBlock(moving_edge_, mb_row, mb_col) ||
+-          (x_density_[mb_col] * y_density_[mb_row] &&
++          // Originally: x_density_[mb_col] * y_density_[mb_row] &&
++          // Faster code below and avoids int-in-bool-context warning
++          (x_density_[mb_col] != 0 && y_density_[mb_row] != 0 &&
+            moving_object_[mb_row * mb_cols_ + mb_col])) {
+         // Copy y source.
+         filter_->CopyMem16x16(mb_src, stride_src, mb_dst, stride_dst);
+       }
+     }
+   }
+ }
+