forked from libjpeg-turbo/libjpeg-turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MMI: Fix comp. perf. issue w/ unaligned image rows
Using ldc1 with a non-64-bit-aligned memory location causes as much as a 10x slow-down in overall compression performance.
- Loading branch information
1 parent
2d0b675
commit 1c2d3cf
Showing
3 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ | |
* Loongson MMI optimizations for libjpeg-turbo | ||
* | ||
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB | ||
* Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. | ||
* Copyright (C) 2016-2017, Loongson Technology Corporation Limited, BeiJing. | ||
* Copyright (C) 2014-2015, 2019, D. R. Commander. All Rights Reserved. | ||
* Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing. | ||
* All Rights Reserved. | ||
* Authors: ZhuChen <[email protected]> | ||
* SunZhangzhi <[email protected]> | ||
* CaiWanwei <[email protected]> | ||
* ZhangLixia <[email protected]> | ||
* | ||
* Based on the x86 SIMD extension for IJG JPEG library | ||
* Copyright (C) 1999-2006, MIYASAKA Masaru. | ||
|
@@ -184,9 +185,15 @@ void jsimd_rgb_ycc_convert_mmi(JDIMENSION image_width, JSAMPARRAY input_buf, | |
"$14", "memory" | ||
); | ||
} else { | ||
mmA = _mm_load_si64((__m64 *)&inptr[0]); | ||
mmG = _mm_load_si64((__m64 *)&inptr[8]); | ||
mmF = _mm_load_si64((__m64 *)&inptr[16]); | ||
if (!(((long)inptr) & 7)) { | ||
mmA = _mm_load_si64((__m64 *)&inptr[0]); | ||
mmG = _mm_load_si64((__m64 *)&inptr[8]); | ||
mmF = _mm_load_si64((__m64 *)&inptr[16]); | ||
} else { | ||
mmA = _mm_loadu_si64((__m64 *)&inptr[0]); | ||
mmG = _mm_loadu_si64((__m64 *)&inptr[8]); | ||
mmF = _mm_loadu_si64((__m64 *)&inptr[16]); | ||
} | ||
inptr += RGB_PIXELSIZE * 8; | ||
} | ||
mmD = mmA; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters