[automerger] Merge changes from topic "am-c9e7b840dd89496cad321d7c52b28826" into nyc-dr1-dev am: 72c25a331e am: 99d693c89f am: 29819a74ab am: 2c48ad1660 am: 989db21f60 am: 0456f282de
am: 91a7eef76b

Change-Id: I04b5cdadf0a982139334e751fa9b6277033f27de
diff --git a/Android.bp b/Android.bp
index 464f768..957e253 100644
--- a/Android.bp
+++ b/Android.bp
@@ -6,6 +6,9 @@
     cflags: [
         "-fPIC",
         "-O3",
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-variable",
     ],
 
     export_include_dirs: [
@@ -79,7 +82,7 @@
                 "-DDEFAULT_ARCH=D_ARCH_ARM_NONEON",
             ],
 
-            armv7_a_neon: {
+            neon: {
                 srcs: [
                     "decoder/arm/ih264d_function_selector_a9q.c",
                     "common/arm/ih264_intra_pred_chroma_a9q.s",
@@ -242,6 +245,9 @@
         "-fPIC",
 
         "-O3",
+        "-Wall",
+        "-Werror",
+        "-Wno-error=constant-conversion",
     ],
 
     export_include_dirs: [
@@ -326,7 +332,7 @@
                 "-DDISABLE_NEON",
             ],
 
-            armv7_a_neon: {
+            neon: {
                 srcs: [
                     "encoder/arm/ih264e_function_selector_a9q.c",
                     "common/arm/ih264_resi_trans_quant_a9.s",
diff --git a/encoder/ih264e_defs.h b/encoder/ih264e_defs.h
index c4e7885..4537bc2 100644
--- a/encoder/ih264e_defs.h
+++ b/encoder/ih264e_defs.h
@@ -202,7 +202,7 @@
 #define DEFAULT_RECON_ENABLE            0
 #define DEFAULT_RC                      IVE_RC_STORAGE
 #define DEFAULT_MAX_FRAMERATE           120000
-#define DEFAULT_MAX_BITRATE             20000000
+#define DEFAULT_MAX_BITRATE             50000000
 #define DEFAULT_MAX_NUM_BFRAMES         0
 #define DEFAULT_MAX_SRCH_RANGE_X        256
 #define DEFAULT_MAX_SRCH_RANGE_Y        256
diff --git a/encoder/ih264e_intra_modes_eval.c b/encoder/ih264e_intra_modes_eval.c
index 871bdd4..3edf98f 100644
--- a/encoder/ih264e_intra_modes_eval.c
+++ b/encoder/ih264e_intra_modes_eval.c
@@ -428,7 +428,8 @@
     /* set valid intra modes for evaluation */
     u4_valid_intra_modes = u1_valid_intra_modes[i4_ngbr_avbl];
 
-    if (ps_codec->s_cfg.u4_enc_speed_preset == IVE_FAST)
+    if (ps_codec->s_cfg.u4_enc_speed_preset == IVE_FAST ||
+                    ps_codec->s_cfg.u4_enc_speed_preset == IVE_FASTEST)
         u4_valid_intra_modes &= ~(1 << PLANE_I16x16);
 
     /* evaluate b/w HORZ_I16x16, VERT_I16x16 & DC_I16x16 */
@@ -440,8 +441,7 @@
     /* cost = distortion + lambda*rate */
     i4_mb_cost_least = i4_mb_distortion_least;
 
-    if ((( (u4_valid_intra_modes >> 3) & 1) != 0) && (ps_codec->s_cfg.u4_enc_speed_preset != IVE_FASTEST ||
-                    ps_proc->i4_slice_type == ISLICE))
+    if (((u4_valid_intra_modes >> 3) & 1) != 0)
     {
         /* intra prediction for PLANE mode*/
         (ps_codec->apf_intra_pred_16_l)[PLANE_I16x16](pu1_ngbr_pels_i16, pu1_pred_mb_intra_16x16_plane, 0, i4_pred_strd, i4_ngbr_avbl);
@@ -1450,7 +1450,8 @@
 
     u4_valid_intra_modes = u1_valid_intra_modes[i4_ngbr_avbl];
 
-    if (ps_codec->s_cfg.u4_enc_speed_preset == IVE_FAST)
+    if (ps_codec->s_cfg.u4_enc_speed_preset == IVE_FAST ||
+                    ps_codec->s_cfg.u4_enc_speed_preset == IVE_FASTEST)
         u4_valid_intra_modes &= ~(1 << PLANE_CH_I8x8);
 
     i4_chroma_mb_distortion = INT_MAX;
diff --git a/encoder/ih264e_me.h b/encoder/ih264e_me.h
index bd88a01..2266e5a 100644
--- a/encoder/ih264e_me.h
+++ b/encoder/ih264e_me.h
@@ -38,6 +38,25 @@
 #define IH264E_ME_H_
 
 /*****************************************************************************/
+/* Constant Macros                                                           */
+/*****************************************************************************/
+
+/**
+******************************************************************************
+ *  @brief     Skip Bias value for P slice
+******************************************************************************
+ */
+#define SKIP_BIAS_P 0
+
+/**
+******************************************************************************
+ *  @brief     Skip Bias value for B slice
+******************************************************************************
+ */
+#define SKIP_BIAS_B 0
+
+
+/*****************************************************************************/
 /* Function Macros                                                           */
 /*****************************************************************************/
 
diff --git a/encoder/ih264e_process.c b/encoder/ih264e_process.c
index 5fb0b88..644a5a2 100644
--- a/encoder/ih264e_process.c
+++ b/encoder/ih264e_process.c
@@ -2098,7 +2098,7 @@
             }
 
             /* If we already have the minimum sad, there is no point in searching for sad again */
-            if (ps_proc->u4_min_sad_reached == 0)
+            if (ps_proc->u4_min_sad_reached == 0 || ps_codec->s_cfg.u4_enc_speed_preset != IVE_FASTEST)
             {
                 /* intra gating in inter slices */
                 /* No need of gating if we want to force intra, we need to find the threshold only if inter is enabled by AIR*/
diff --git a/encoder/ime.h b/encoder/ime.h
index 17912d4..f035e9e 100644
--- a/encoder/ime.h
+++ b/encoder/ime.h
@@ -47,20 +47,6 @@
  */
 #define NUM_LAYERS 16
 
-/**
-******************************************************************************
- *  @brief     Skip Bias value for P slice
-******************************************************************************
- */
-#define SKIP_BIAS_P 2
-
-/**
-******************************************************************************
- *  @brief     Skip Bias value for B slice
-******************************************************************************
- */
-#define SKIP_BIAS_B 16
-
 /*****************************************************************************/
 /* Extern Function Declarations                                              */
 /*****************************************************************************/
diff --git a/test/Android.bp b/test/Android.bp
index 5fef68b..9e34a51 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -7,6 +7,8 @@
         "-DARM",
         "-DMD5_DISABLE",
         "-fPIC",
+        "-Wall",
+        "-Werror",
     ],
     local_include_dirs: [
         "decoder/",
@@ -26,6 +28,9 @@
         "-DMD5_DISABLE",
         "-fPIC",
         "-pie",
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-variable",
     ],
     local_include_dirs: [
         "encoder/",
diff --git a/test/encoder/app.h b/test/encoder/app.h
index 223ad5c..0e9a3df 100644
--- a/test/encoder/app.h
+++ b/test/encoder/app.h
@@ -75,7 +75,7 @@
 #define DEFAULT_MAX_REORDER_FRM     0
 #define DEFAULT_QP_MIN              4
 #define DEFAULT_QP_MAX              51
-#define DEFAULT_MAX_BITRATE         20000000
+#define DEFAULT_MAX_BITRATE         50000000
 #define DEFAULT_NUM_BFRAMES         0
 #define DEFAULT_MAX_SRCH_RANGE_X    256
 #define DEFAULT_MAX_SRCH_RANGE_Y    256