Don't use static structs for rc init

Most of them was benign and didn't risk any data race; they
were used for write-only memory during init.

The array as_itt_memtab in ih264e_get_rate_control_mem_tab
could however cause a real data race, if multiple threads
try to initialize an encoder at the same time, since it
used as temporary storage when mapping between different
structs.

Change-Id: I3ca29f0e3be2fad154becc3ee29867e591975a74
diff --git a/encoder/ih264e_modify_frm_rate.c b/encoder/ih264e_modify_frm_rate.c
index bc0e873..f60fa6d 100644
--- a/encoder/ih264e_modify_frm_rate.c
+++ b/encoder/ih264e_modify_frm_rate.c
@@ -103,7 +103,7 @@
                                                ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static pd_frm_rate_t s_temp_pd_frm_rate_t;
+    pd_frm_rate_t s_temp_pd_frm_rate_t;
 
     /* Hack for al alloc, during which we dont have any state memory.
      Dereferencing can cause issues */
diff --git a/encoder/ih264e_rc_mem_interface.c b/encoder/ih264e_rc_mem_interface.c
index e4d5781..10b6750 100644
--- a/encoder/ih264e_rc_mem_interface.c
+++ b/encoder/ih264e_rc_mem_interface.c
@@ -332,7 +332,7 @@
                                        iv_mem_rec_t  *ps_mem,
                                        ITT_FUNC_TYPE_E e_func_type)
 {
-    static itt_memtab_t as_itt_memtab[NUM_RC_MEMTABS];
+    itt_memtab_t as_itt_memtab[NUM_RC_MEMTABS];
     WORD32 i4_num_memtab = 0, j = 0;
     void *refptr2[4];
     void **refptr1[4];
diff --git a/encoder/ih264e_time_stamp.c b/encoder/ih264e_time_stamp.c
index a6a7f3c..0c3685e 100644
--- a/encoder/ih264e_time_stamp.c
+++ b/encoder/ih264e_time_stamp.c
@@ -221,7 +221,7 @@
                                               ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static frame_time_t s_temp_frame_time_t;
+    frame_time_t s_temp_frame_time_t;
 
     /* Hack for al alloc, during which we dont have any state memory.
      Dereferencing can cause issues */
@@ -404,7 +404,7 @@
                                               ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static time_stamp_t s_temp_time_stamp_t;
+    time_stamp_t s_temp_time_stamp_t;
 
     /* Hack for al alloc, during which we dont have any state memory.
      Dereferencing can cause issues */
diff --git a/encoder/irc_bit_allocation.c b/encoder/irc_bit_allocation.c
index 1dfd9de..6f52970 100644
--- a/encoder/irc_bit_allocation.c
+++ b/encoder/irc_bit_allocation.c
@@ -251,7 +251,7 @@
                                        ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static bit_allocation_t s_bit_allocation_temp;
+    bit_allocation_t s_bit_allocation_temp;
 
     /*
      * Hack for all alloc, during which we don't have any state memory.
diff --git a/encoder/irc_cbr_buffer_control.c b/encoder/irc_cbr_buffer_control.c
index c179a28..9febbc8 100644
--- a/encoder/irc_cbr_buffer_control.c
+++ b/encoder/irc_cbr_buffer_control.c
@@ -79,7 +79,7 @@
                                                ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0, i;
-    static cbr_buffer_t s_cbr_buffer_temp;
+    cbr_buffer_t s_cbr_buffer_temp;
 
     /*
      * Hack for all alloc, during which we don't have any state memory.
diff --git a/encoder/irc_est_sad.c b/encoder/irc_est_sad.c
index 0d8abc2..97a0b68 100644
--- a/encoder/irc_est_sad.c
+++ b/encoder/irc_est_sad.c
@@ -58,7 +58,7 @@
                                             ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static est_sad_t s_est_sad;
+    est_sad_t s_est_sad;
 
     /* Hack for al alloc, during which we don't have any state memory.
      * Dereferencing can cause issues
diff --git a/encoder/irc_fixed_point_error_bits.c b/encoder/irc_fixed_point_error_bits.c
index 42dcfc5..1c35685 100644
--- a/encoder/irc_fixed_point_error_bits.c
+++ b/encoder/irc_fixed_point_error_bits.c
@@ -62,7 +62,7 @@
                                                ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static error_bits_t s_error_bits_temp;
+    error_bits_t s_error_bits_temp;
 
     /*
      * Hack for all alloc, during which we don't have any state memory.
diff --git a/encoder/irc_mb_model_based.c b/encoder/irc_mb_model_based.c
index 880ee19..b8e3d1b 100644
--- a/encoder/irc_mb_model_based.c
+++ b/encoder/irc_mb_model_based.c
@@ -47,7 +47,7 @@
                                          ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static mb_rate_control_t s_mb_rate_control_temp;
+    mb_rate_control_t s_mb_rate_control_temp;
 
     /*
      * Hack for al alloc, during which we don't have any state memory.
diff --git a/encoder/irc_picture_type.c b/encoder/irc_picture_type.c
index 186188c..358c880 100644
--- a/encoder/irc_picture_type.c
+++ b/encoder/irc_picture_type.c
@@ -225,7 +225,7 @@
                                                  ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static pic_handling_t s_pic_handling_temp;
+    pic_handling_t s_pic_handling_temp;
 
     /*
      * Hack for al alloc, during which we dont have any state memory.
diff --git a/encoder/irc_rate_control_api.c b/encoder/irc_rate_control_api.c
index 6c6586e..9be4638 100644
--- a/encoder/irc_rate_control_api.c
+++ b/encoder/irc_rate_control_api.c
@@ -73,7 +73,7 @@
                                                  ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0, i;
-    static rate_control_api_t s_temp_rc_api;
+    rate_control_api_t s_temp_rc_api;
 
     /*
      * Hack for al alloc, during which we dont have any state memory.
diff --git a/encoder/irc_rd_model.c b/encoder/irc_rd_model.c
index f5c0737..a04412c 100644
--- a/encoder/irc_rd_model.c
+++ b/encoder/irc_rd_model.c
@@ -55,7 +55,7 @@
                                              ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static rc_rd_model_t s_rc_rd_model_temp;
+    rc_rd_model_t s_rc_rd_model_temp;
 
     /*
      * Hack for al alloc, during which we don't have any state memory.
diff --git a/encoder/irc_vbr_storage_vbv.c b/encoder/irc_vbr_storage_vbv.c
index 23e9959..aaf0d6e 100644
--- a/encoder/irc_vbr_storage_vbv.c
+++ b/encoder/irc_vbr_storage_vbv.c
@@ -73,7 +73,7 @@
                                             ITT_FUNC_TYPE_E e_func_type)
 {
     WORD32 i4_mem_tab_idx = 0;
-    static vbr_storage_vbv_t s_vbr_storage_vbv_temp;
+    vbr_storage_vbv_t s_vbr_storage_vbv_temp;
 
     /*
      * Hack for al alloc, during which we don't have any state memory.