From bcaf1d69ec8ba4a616464aeb7b58ec92b76cc42a Mon Sep 17 00:00:00 2001
From: Yaowu Xu <yaowu@google.com>
Date: Mon, 21 Jul 2014 15:55:12 -0700
Subject: [PATCH] Moved call to vp9_clear_system_state() to a proper location

The commit moved a call to vp9_clear_system_state() to a correct
location, i.e. prior function calls using floating point numbers.
This was to fix a mismatch mmx code and sse2 version, where a
floating point number used in adjust_frame_rate(cpi) gets NAN due
to mmx registers being in wrong state.

Change-Id: I40e0a6de98812000ccee6a729badb630604fd7e6
---
 vp9/encoder/vp9_encoder.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 73379b099c..72f7202fd5 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2703,6 +2703,9 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
     cpi->last_end_time_stamp_seen = cpi->source->ts_start;
   }
 
+  // Clear down mmx registers
+  vp9_clear_system_state();
+
   // adjust frame rates based on timestamps given
   if (cm->show_frame) {
     adjust_frame_rate(cpi);
@@ -2717,9 +2720,6 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
   // start with a 0 size frame
   *size = 0;
 
-  // Clear down mmx registers
-  vp9_clear_system_state();
-
   /* find a free buffer for the new frame, releasing the reference previously
    * held.
    */
-- 
GitLab