[Libva] [PATCH] Fix the code to avoid plus minus conversion if the result is already zero in the float to integer conversion algorithm.
Ung, Teng En
teng.en.ung at intel.com
Thu Aug 18 06:06:36 UTC 2016
Signed-off-by: Ung, Teng En <teng.en.ung at intel.com>
---
src/intel_media_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel_media_common.c b/src/intel_media_common.c
index 99293b2..8821bc4 100644
--- a/src/intel_media_common.c
+++ b/src/intel_media_common.c
@@ -76,7 +76,7 @@ int intel_format_convert(float src, int out_int_bits, int out_frac_bits,int out_
if(negative_flag)
output_value = (~output_value + 1) & ((1 <<(out_int_bits + out_frac_bits)) -1);
- if(out_sign_flag == 1 && negative_flag)
+ if(output_value != 0 && out_sign_flag == 1 && negative_flag)
{
output_value |= negative_flag <<(out_int_bits + out_frac_bits);
}
--
2.5.0
More information about the Libva
mailing list