Skip to content
Myr

stb_image; optimize row computation in PR

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent b2bde48 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:stb_image_write.h+6 added-6 removed
1467 unmodified lines
1468 for(y = 0; y < height; y += 8) {1469 for(x = 0; x < width; x += 8) {1470 float YDU[64], UDU[64], VDU[64];1471 for(row = y, pos = 0; row < y+8; ++row) {1472 if(row < height) {1473 p = (stbi__flip_vertically_on_write ? (height-1-row) : row)*width*comp;1474 } else {1475 // row >= height => use last input row (=> first if flipping)1476 p = stbi__flip_vertically_on_write ? 0 : ((height-1)*width*comp);1477 }1478 for(col = x; col < x+8; ++col, ++pos) {1479 float r, g, b;1480 int p;1475 if(row < height) {1476 p = (stbi__flip_vertically_on_write ? (height-1-row) : row)*width*comp;1477 } else {1478 // row >= height => use last input row (=> first if flipping)1479 p = stbi__flip_vertically_on_write ? 0 : ((height-1)*width*comp);1480 }1481 // if col >= width => use pixel from last input column1482 p += ((col < width) ? col : (width-1))*comp;14831484 r = imageData[p+0];
132 unmodified lines