Skip to content

Commit 7ae38a1

Browse files
committed
Standardize on blk for image block variables
1 parent 0e6c184 commit 7ae38a1

6 files changed

Lines changed: 111 additions & 111 deletions

Source/astcenc_decompress_symbolic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ float compute_symbolic_block_difference(
285285
astcenc_profile decode_mode,
286286
const block_size_descriptor* bsd,
287287
const symbolic_compressed_block* scb,
288-
const imageblock* pb,
288+
const imageblock* blk,
289289
const error_weight_block *ewb
290290
) {
291291
// if we detected an error-block, blow up immediately.
@@ -394,7 +394,7 @@ float compute_symbolic_block_difference(
394394
plane2_weights[i],
395395
plane2_mask);
396396

397-
vfloat4 oldColor = pb->texel(i);
397+
vfloat4 oldColor = blk->texel(i);
398398

399399
vfloat4 error = oldColor - color;
400400

Source/astcenc_encoding_choice_error.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void compute_error_squared_rgb_single_partition(
150150
*/
151151
void compute_encoding_choice_errors(
152152
const block_size_descriptor* bsd,
153-
const imageblock* pb,
153+
const imageblock* blk,
154154
const partition_info* pt,
155155
const error_weight_block* ewb,
156156
int separate_component, // component that is separated out in 2-plane mode, -1 in 1-plane mode
@@ -168,19 +168,19 @@ void compute_encoding_choice_errors(
168168
vfloat4 color_scalefactors[4];
169169

170170
compute_partition_error_color_weightings(bsd, ewb, pt, error_weightings, color_scalefactors);
171-
compute_avgs_and_dirs_3_comp(pt, pb, ewb, color_scalefactors, 3, averages, directions_rgb);
171+
compute_avgs_and_dirs_3_comp(pt, blk, ewb, color_scalefactors, 3, averages, directions_rgb);
172172

173173
endpoints ep;
174174
if (separate_component == -1)
175175
{
176176
endpoints_and_weights ei;
177-
compute_endpoints_and_ideal_weights_1_plane(bsd, pt, pb, ewb, &ei);
177+
compute_endpoints_and_ideal_weights_1_plane(bsd, pt, blk, ewb, &ei);
178178
ep = ei.ep;
179179
}
180180
else
181181
{
182182
endpoints_and_weights ei1, ei2;
183-
compute_endpoints_and_ideal_weights_2_planes(bsd, pt, pb, ewb, separate_component, &ei1, &ei2);
183+
compute_endpoints_and_ideal_weights_2_planes(bsd, pt, blk, ewb, separate_component, &ei1, &ei2);
184184
merge_endpoints(&(ei1.ep), &(ei2.ep), separate_component, &ep);
185185
}
186186

@@ -249,7 +249,7 @@ void compute_encoding_choice_errors(
249249
proc_luminance_lines.bis = normalize(csf) * icsf;
250250

251251
compute_error_squared_rgb_single_partition(
252-
i, bsd, pt, pb, ewb,
252+
i, bsd, pt, blk, ewb,
253253
&proc_uncorr_rgb_lines, &uncorr_rgb_error,
254254
&proc_samechroma_rgb_lines, &samechroma_rgb_error,
255255
&proc_rgb_luma_lines, &rgb_luma_error,

Source/astcenc_entry.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static void compress_image(
693693
int block_z = bsd->zdim;
694694
astcenc_profile decode_mode = ctx.config.profile;
695695

696-
imageblock pb;
696+
imageblock blk;
697697
int dim_x = image.dim_x;
698698
int dim_y = image.dim_y;
699699
int dim_z = image.dim_z;
@@ -770,22 +770,22 @@ static void compress_image(
770770
// Fetch the full block for compression
771771
if (use_full_block)
772772
{
773-
fetch_imageblock(decode_mode, image, &pb, bsd, x * block_x, y * block_y, z * block_z, swizzle);
773+
fetch_imageblock(decode_mode, image, &blk, bsd, x * block_x, y * block_y, z * block_z, swizzle);
774774
}
775775
// Apply alpha scale RDO - substitute constant color block
776776
else
777777
{
778-
pb.origin_texel = vfloat4::zero();
779-
pb.data_min = vfloat4::zero();
780-
pb.data_max = pb.data_min;
781-
pb.grayscale = false;
778+
blk.origin_texel = vfloat4::zero();
779+
blk.data_min = vfloat4::zero();
780+
blk.data_max = blk.data_min;
781+
blk.grayscale = false;
782782
}
783783

784784
int offset = ((z * yblocks + y) * xblocks + x) * 16;
785785
uint8_t *bp = buffer + offset;
786786
physical_compressed_block* pcb = reinterpret_cast<physical_compressed_block*>(bp);
787787
symbolic_compressed_block scb;
788-
compress_block(ctx, image, &pb, scb, *pcb, temp_buffers);
788+
compress_block(ctx, image, &blk, scb, *pcb, temp_buffers);
789789
}
790790

791791
ctx.manage_compress.complete_task_assignment(count);
@@ -943,7 +943,7 @@ astcenc_error astcenc_decompress_image(
943943
return ASTCENC_ERR_OUT_OF_MEM;
944944
}
945945

946-
imageblock pb;
946+
imageblock blk;
947947

948948
for (unsigned int z = 0; z < zblocks; z++)
949949
{
@@ -960,9 +960,9 @@ astcenc_error astcenc_decompress_image(
960960

961961
decompress_symbolic_block(context->config.profile, context->bsd,
962962
x * block_x, y * block_y, z * block_z,
963-
&scb, &pb);
963+
&scb, &blk);
964964

965-
write_imageblock(image_out, &pb, context->bsd,
965+
write_imageblock(image_out, &blk, context->bsd,
966966
x * block_x, y * block_y, z * block_z, swizzle);
967967
}
968968
}

Source/astcenc_ideal_endpoints_and_weights.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ void recompute_ideal_colors_2planes(
11051105
int plane2_color_component, // color component for 2nd plane of weights; -1 if the 2nd plane of weights is not present
11061106
const partition_info* pt,
11071107
const decimation_table* it,
1108-
const imageblock* pb, // picture-block containing the actual data.
1108+
const imageblock* blk, // picture-block containing the actual data.
11091109
const error_weight_block* ewb
11101110
) {
11111111
const quantization_and_transfer_table *qat = &(quant_and_xfer_tables[weight_quant_mode]);
@@ -1139,7 +1139,7 @@ void recompute_ideal_colors_2planes(
11391139
{
11401140
int tix = texel_indexes[j];
11411141

1142-
vfloat4 rgba = pb->texel(tix);
1142+
vfloat4 rgba = blk->texel(tix);
11431143
vfloat4 error_weight(ewb->texel_weight_r[tix], ewb->texel_weight_g[tix], ewb->texel_weight_b[tix], ewb->texel_weight_a[tix]);
11441144

11451145
rgba_sum = rgba_sum + (rgba * error_weight);
@@ -1179,7 +1179,7 @@ void recompute_ideal_colors_2planes(
11791179
{
11801180
int tix = texel_indexes[j];
11811181

1182-
vfloat4 rgba = pb->texel(tix);
1182+
vfloat4 rgba = blk->texel(tix);
11831183
vfloat4 color_weight(ewb->texel_weight_r[tix], ewb->texel_weight_g[tix], ewb->texel_weight_b[tix], ewb->texel_weight_a[tix]);
11841184

11851185
vfloat4 color_weight3 = color_weight.swz<0, 1, 2>();
@@ -1437,7 +1437,7 @@ void recompute_ideal_colors_1plane(
14371437
const uint8_t* weight_set8, // the current set of weight values
14381438
const partition_info* pt,
14391439
const decimation_table* it,
1440-
const imageblock* pb, // picture-block containing the actual data.
1440+
const imageblock* blk, // picture-block containing the actual data.
14411441
const error_weight_block* ewb
14421442
) {
14431443
int weight_count = it->weight_count;
@@ -1467,7 +1467,7 @@ void recompute_ideal_colors_1plane(
14671467
{
14681468
int tix = texel_indexes[j];
14691469

1470-
vfloat4 rgba = pb->texel(tix);
1470+
vfloat4 rgba = blk->texel(tix);
14711471
vfloat4 error_weight(ewb->texel_weight_r[tix], ewb->texel_weight_g[tix], ewb->texel_weight_b[tix], ewb->texel_weight_a[tix]);
14721472

14731473
rgba_sum = rgba_sum + (rgba * error_weight);
@@ -1501,7 +1501,7 @@ void recompute_ideal_colors_1plane(
15011501
{
15021502
int tix = texel_indexes[j];
15031503

1504-
vfloat4 rgba = pb->texel(tix);
1504+
vfloat4 rgba = blk->texel(tix);
15051505
vfloat4 color_weight(ewb->texel_weight_r[tix], ewb->texel_weight_g[tix], ewb->texel_weight_b[tix], ewb->texel_weight_a[tix]);
15061506

15071507
vfloat4 color_weight3 = color_weight.swz<0, 1, 2>();

0 commit comments

Comments
 (0)