Skip to content

Commit 9ca2fe6

Browse files
committed
Init block_mode before decimation_mode
1 parent a9568c1 commit 9ca2fe6

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Source/astcenc_block_sizes.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,13 @@ static void construct_block_size_descriptor_2d(
949949
}
950950

951951
auto& bm = bsd.block_modes[packed_bm_idx];
952+
953+
bm.decimation_mode = static_cast<uint8_t>(decimation_mode);
954+
bm.quant_mode = static_cast<uint8_t>(quant_mode);
955+
bm.is_dual_plane = static_cast<uint8_t>(is_dual_plane);
956+
bm.weight_bits = static_cast<uint8_t>(weight_bits);
957+
bm.mode_index = static_cast<uint16_t>(i);
958+
952959
auto& dm = bsd.decimation_modes[decimation_mode];
953960

954961
if (is_dual_plane)
@@ -960,12 +967,6 @@ static void construct_block_size_descriptor_2d(
960967
dm.set_ref_1_plane(bm.get_weight_quant_mode());
961968
}
962969

963-
bm.decimation_mode = static_cast<uint8_t>(decimation_mode);
964-
bm.quant_mode = static_cast<uint8_t>(quant_mode);
965-
bm.is_dual_plane = static_cast<uint8_t>(is_dual_plane);
966-
bm.weight_bits = static_cast<uint8_t>(weight_bits);
967-
bm.mode_index = static_cast<uint16_t>(i);
968-
969970
bsd.block_mode_packed_index[i] = static_cast<uint16_t>(packed_bm_idx);
970971

971972
packed_bm_idx++;

0 commit comments

Comments
 (0)