[Libva] [PATCH] Fix the code to avoid plus minus conversion if the result is already zero in the float to integer conversion algorithm.
Sean V Kelley
seanvk at posteo.de
Thu Aug 18 20:17:00 UTC 2016
On Thu, 2016-08-18 at 14:06 +0800, Ung, Teng En wrote:
> Signed-off-by: Ung, Teng En <teng.en.ung at intel.com>
lgtm, applied.
Thanks,
Sean
> ---
> 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);
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/libva/attachments/20160818/0c525a66/attachment.sig>
More information about the Libva
mailing list