summaryrefslogtreecommitdiff
path: root/src/static_libs/rg_etc
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-04-08 16:22:59 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2014-04-08 16:22:59 +0200
commite004338cce39190fdcf27aa5ec98e3158292b213 (patch)
tree15a16fcf536f5b2deb23dc1078f340e4ba9d3750 /src/static_libs/rg_etc
parent0196da9a858f1bd7bf2327148ed2b2f661b58371 (diff)
rg_etc: Fix local shadow problems
Make it clear which local variable we really want to use by changing the names. All of these seem to be fine but this can really bite us so have better clarity here.
Diffstat (limited to 'src/static_libs/rg_etc')
-rw-r--r--src/static_libs/rg_etc/rg_etc1.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/static_libs/rg_etc/rg_etc1.c b/src/static_libs/rg_etc/rg_etc1.c
index 814a14839f..ff8af919fd 100644
--- a/src/static_libs/rg_etc/rg_etc1.c
+++ b/src/static_libs/rg_etc/rg_etc1.c
@@ -1661,11 +1661,11 @@ rg_etc1_optimizer_compute(rg_etc1_optimizer *optimizer)
1661 for (index = 0; index < n; index++) 1661 for (index = 0; index < n; index++)
1662 { 1662 {
1663 const uint s = *pSelectors++; 1663 const uint s = *pSelectors++;
1664 const int yd = pInten_table[s]; 1664 const int yyd = pInten_table[s];
1665 // Compute actual delta being applied to each pixel, taking into account clamping. 1665 // Compute actual delta being applied to each pixel, taking into account clamping.
1666 delta_sum_r += CLAMP(base_color.comp.r + yd, 0, 255) - base_color.comp.r; 1666 delta_sum_r += CLAMP(base_color.comp.r + yyd, 0, 255) - base_color.comp.r;
1667 delta_sum_g += CLAMP(base_color.comp.g + yd, 0, 255) - base_color.comp.g; 1667 delta_sum_g += CLAMP(base_color.comp.g + yyd, 0, 255) - base_color.comp.g;
1668 delta_sum_b += CLAMP(base_color.comp.b + yd, 0, 255) - base_color.comp.b; 1668 delta_sum_b += CLAMP(base_color.comp.b + yyd, 0, 255) - base_color.comp.b;
1669 } 1669 }
1670 if ((!delta_sum_r) && (!delta_sum_g) && (!delta_sum_b)) 1670 if ((!delta_sum_r) && (!delta_sum_g) && (!delta_sum_b))
1671 break; 1671 break;
@@ -2251,10 +2251,10 @@ rg_etc1_pack_block_solid_color_constrained(rg_etc1_optimizer_results *results,ui
2251 if ((diff) && (pBase_color5_unscaled)) 2251 if ((diff) && (pBase_color5_unscaled))
2252 { 2252 {
2253 const int p0 = (x >> 8) & 255; 2253 const int p0 = (x >> 8) & 255;
2254 unsigned char c1 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32, 2254 unsigned char cc1 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32,
2255 i); 2255 i);
2256 int delta = p0 - (int)(c1); 2256 int delta1 = p0 - (int)(cc1);
2257 if ((delta < cETC1ColorDeltaMin) || (delta > cETC1ColorDeltaMax)) 2257 if ((delta1 < cETC1ColorDeltaMin) || (delta1 > cETC1ColorDeltaMax))
2258 { 2258 {
2259 if (*pTable == 0xFFFF) 2259 if (*pTable == 0xFFFF)
2260 break; 2260 break;
@@ -2279,12 +2279,12 @@ rg_etc1_pack_block_solid_color_constrained(rg_etc1_optimizer_results *results,ui
2279 2279
2280 if ((diff) && (pBase_color5_unscaled)) 2280 if ((diff) && (pBase_color5_unscaled))
2281 { 2281 {
2282 unsigned char c1 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32, 2282 unsigned char cc1 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32,
2283 s_next_comp[i]); 2283 s_next_comp[i]);
2284 int delta1 = (p1 & 0xFF) - (int)(c1); 2284 int delta1 = (p1 & 0xFF) - (int)(cc1);
2285 unsigned char c2 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32, 2285 unsigned char cc2 = rg_etc1_color_quad_component_get(pBase_color5_unscaled->m_u32,
2286 s_next_comp[i + 1]); 2286 s_next_comp[i + 1]);
2287 int delta2 = (p2 & 0xFF) - (int)(c2); 2287 int delta2 = (p2 & 0xFF) - (int)(cc2);
2288 if ((delta1 < cETC1ColorDeltaMin) || (delta1 > cETC1ColorDeltaMax) 2288 if ((delta1 < cETC1ColorDeltaMin) || (delta1 > cETC1ColorDeltaMax)
2289 || (delta2 < cETC1ColorDeltaMin) || (delta2 > cETC1ColorDeltaMax)) 2289 || (delta2 < cETC1ColorDeltaMin) || (delta2 > cETC1ColorDeltaMax))
2290 { 2290 {
@@ -2627,8 +2627,8 @@ rg_etc1_pack_block(void* pETC1_block, const unsigned int* pSrc_pixels_rgba, rg_e
2627 for (subblock = 1; subblock >= 0; --subblock) 2627 for (subblock = 1; subblock >= 0; --subblock)
2628 { 2628 {
2629 const uint8* pSelectors = best_results[subblock].m_pSelectors + 4; 2629 const uint8* pSelectors = best_results[subblock].m_pSelectors + 4;
2630 uint i; 2630 uint j;
2631 for (i = 0; i < 2; i++) 2631 for (j = 0; j < 2; j++)
2632 { 2632 {
2633 uint b; 2633 uint b;
2634 b = rg_etc_selector_index_to_etc1[pSelectors[3]]; 2634 b = rg_etc_selector_index_to_etc1[pSelectors[3]];