diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index a04ef4ddcf..d08f37dfff 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -689,7 +689,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh if(width > 127 && height > 127) { //don't span to many threads they will kill the rest of the emu :) - omp_set_num_threads(cpu_info.num_cores + 2 / 3); + omp_set_num_threads((cpu_info.num_cores + 2) / 3); } else { @@ -723,10 +723,10 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh #pragma omp parallel for for (int y = 0; y < height; y += 8) for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8, yStep++) - for (int iy = 0; iy < 8; iy++,yStep++) + for (int iy = 0, xStep = yStep * 8 ; iy < 8; iy++,xStep++) for (int ix = 0; ix < 4; ix++) { - int val = src[4 * yStep + ix]; + int val = src[4 * xStep + ix]; dst[(y + iy) * width + x + ix * 2] = Convert4To8(val >> 4); dst[(y + iy) * width + x + ix * 2 + 1] = Convert4To8(val & 0xF); } @@ -962,7 +962,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he if(width > 127 && height > 127) { //don't span to many threads they will kill the rest of the emu :) - omp_set_num_threads(cpu_info.num_cores + 2 / 3); + omp_set_num_threads((cpu_info.num_cores + 2) / 3); } else {