@@ -71,6 +71,7 @@ MLConverter::MLConverter(void)
71
71
void
72
72
MLConverter::Argb8bitToR8G8B8A8 (const uint32_t * pFrom, uint32_t * pTo, const int width, const int height)
73
73
{
74
+ #pragma omp parallel for
74
75
for (int y = 0 ; y < height; ++y) {
75
76
for (int x = 0 ; x < width; ++x) {
76
77
const int pos = x + y * width;
96
97
MLConverter::Rgb10bitToRGBA8bit (const uint32_t *pFrom, uint32_t *pTo, const int width, const int height, const uint8_t alpha)
97
98
{
98
99
const uint32_t a = alpha;
100
+
101
+ #pragma omp parallel for
99
102
for (int y = 0 ; y < height; ++y) {
100
103
for (int x = 0 ; x < width; ++x) {
101
104
const int pos = x + y * width;
123
126
MLConverter::Rgb10bitToR10G10B10A2 (const uint32_t * pFrom, uint32_t * pTo, const int width, const int height, const uint8_t alpha)
124
127
{
125
128
const uint32_t a = (alpha >> 6 ) & 0x3 ;
129
+
130
+ #pragma omp parallel for
126
131
for (int y = 0 ; y < height; ++y) {
127
132
for (int x = 0 ; x < width; ++x) {
128
133
const int pos = x + y * width;
@@ -153,6 +158,7 @@ MLConverter::R10G10B10A2ToExrHalfFloat(const uint32_t* pFrom, uint16_t* pTo, con
153
158
// 0.0~1.0の範囲の値。
154
159
half aF = (float )(alpha /255 .0f );
155
160
161
+ #pragma omp parallel for
156
162
for (int y = 0 ; y < height; ++y) {
157
163
for (int x = 0 ; x < width; ++x) {
158
164
const int readPos = x + y * width;
@@ -209,6 +215,7 @@ MLConverter::R10G10B10A2ToR210(const uint32_t* pFrom, uint32_t* pTo, const int w
209
215
{
210
216
const uint32_t a = (alpha >> 6 ) & 0x3 ;
211
217
218
+ #pragma omp parallel for
212
219
for (int y = 0 ; y < height; ++y) {
213
220
for (int x = 0 ; x < width; ++x) {
214
221
const int pos = x + y * width;
@@ -243,6 +250,7 @@ MLConverter::Rgb12bitToR8G8B8A8(const uint32_t* pFrom, uint32_t* pTo, const int
243
250
const uint8_t a = alpha;
244
251
const int pixelCount = width * height;
245
252
253
+ #pragma omp parallel for
246
254
for (int i=0 ; i<pixelCount/8 ; ++i) {
247
255
const int fromPos = i * 9 ;
248
256
const int toPos = i * 8 ;
@@ -363,6 +371,7 @@ MLConverter::Rgb12bitToR10G10B10A2(const uint32_t* pFrom, uint32_t* pTo, const i
363
371
const uint8_t a = (alpha>>6 ) & 0x3 ;
364
372
const int pixelCount = width * height;
365
373
374
+ #pragma omp parallel for
366
375
for (int i=0 ; i<pixelCount/8 ; ++i) {
367
376
const int fromPos = i * 9 ;
368
377
const int toPos = i * 8 ;
@@ -484,6 +493,7 @@ MLConverter::Rgb12bitToR210(const uint32_t* pFrom, uint32_t* pTo, const int widt
484
493
const uint8_t a = 0x3 ;
485
494
const int pixelCount = width * height;
486
495
496
+ #pragma omp parallel for
487
497
for (int i=0 ; i<pixelCount/8 ; ++i) {
488
498
const int fromPos = i * 9 ;
489
499
const int toPos = i * 8 ;
@@ -619,6 +629,7 @@ MLConverter::Rgb12bitToR16G16B16A16(const uint32_t* pFrom, uint64_t* pTo, const
619
629
const uint16_t a = alpha * 257 ; // < 255 * 257 = 65535
620
630
const int pixelCount = width * height;
621
631
632
+ #pragma omp parallel for
622
633
for (int i = 0 ; i < pixelCount / 8 ; ++i) {
623
634
const int fromPos = i * 9 ;
624
635
const int toPos = i * 8 ;
@@ -725,5 +736,4 @@ MLConverter::Rgb12bitToR16G16B16A16(const uint32_t* pFrom, uint64_t* pTo, const
725
736
pTo[toPos + 6 ] = ((uint64_t )a << 48 ) + ((uint64_t )b6 << 32 ) + ((uint32_t )g6 << 16 ) + r6;
726
737
pTo[toPos + 7 ] = ((uint64_t )a << 48 ) + ((uint64_t )b7 << 32 ) + ((uint32_t )g7 << 16 ) + r7;
727
738
}
728
-
729
739
}
0 commit comments