rtc: Enable noise estimation for high resols

Enable noise estimation for resoln about VGA.

Adjust the threshold increase logic for var_based_partition
based on noise estimation, and remove some split logic
based on noise level. Also remove the duplicate
avg_frame_low_motion computation, and modify the content
state to include low_sumdiff flag, used to increase the
partition thresholds at superblock level.

The increased partition threshold applies only to noisy
content and is targeted to avoid superblocks with motion.
This helps visually to improve background stability for
high noise clips.

bdrate only affects a few of the noisy 720p clip in rtc_set,
and change is neutral, except for dark720 clip which has
bdrate gain ~4% at speed 8.

Change-Id: I42b2e3f71aca5f008034656af6a2fb1d64fd06c6
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 4e98c71..7b8f5dc 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -797,6 +797,21 @@
   int pts_inref[16];
 } WARP_SAMPLE_INFO;
 
+/*!\cond */
+typedef enum {
+  kInvalid = 0,
+  kLowSad = 1,
+  kMedSad = 2,
+  kHighSad = 3
+} SOURCE_SAD;
+
+typedef struct {
+  SOURCE_SAD source_sad;
+  int lighting_change;
+  int low_sumdiff;
+} CONTENT_STATE_SB;
+/*!\endcond */
+
 /*! \brief Encoder's parameters related to the current coding block.
  *
  * This struct contains most of the information the encoder needs to encode the
@@ -952,7 +967,7 @@
    *  Characteristics like whether the block has high sad, low sad, etc. This is
    *  only used by av1 realtime mode.
    */
-  uint8_t content_state_sb;
+  CONTENT_STATE_SB content_state_sb;
   /**@}*/
 
   /*****************************************************************************