Clear MMX FP state in PVQ code.
Not clearing the FP state was causing acos to return NaN on OSX / LLVM.
This was not causing problems Linux or AWCY.
Change-Id: I278d02839e4de858b5f55cfb380fa3968937995e
diff --git a/av1/decoder/pvq_decoder.c b/av1/decoder/pvq_decoder.c
index 4e3d81e..4c32afd 100644
--- a/av1/decoder/pvq_decoder.c
+++ b/av1/decoder/pvq_decoder.c
@@ -26,6 +26,7 @@
#include "av1/common/pvq_state.h"
#include "av1/decoder/decint.h"
#include "av1/decoder/pvq_decoder.h"
+#include "aom_ports/system_state.h"
static void aom_decode_pvq_codeword(aom_reader *r, od_pvq_codeword_ctx *ctx,
od_coeff *y, int n, int k) {
@@ -319,6 +320,8 @@
const unsigned char *pvq_qm;
int use_masking;
+ aom_clear_system_state();
+
/*Default to skip=1 and noref=0 for all bands.*/
for (i = 0; i < PVQ_MAX_PARTITIONS; i++) {
noref[i] = 0;
diff --git a/av1/encoder/pvq_encoder.c b/av1/encoder/pvq_encoder.c
index 7ba5762..487c22c 100644
--- a/av1/encoder/pvq_encoder.c
+++ b/av1/encoder/pvq_encoder.c
@@ -26,6 +26,7 @@
#include "av1/common/pvq_state.h"
#include "av1/encoder/encodemb.h"
#include "av1/encoder/pvq_encoder.h"
+#include "aom_ports/system_state.h"
#define OD_PVQ_RATE_APPROX (0)
/*Shift to ensure that the upper bound (i.e. for the max blocksize) of the
@@ -825,6 +826,8 @@
OD_UNUSED(by);
#endif
+ aom_clear_system_state();
+
use_masking = enc->use_activity_masking;
if (use_masking)