Bug 1705847 - Use the input_gamma_table_gray as an array. r=aosmond

Cleaner, safer and just as fast.

Differential Revision: https://phabricator.services.mozilla.com/D112446
This commit is contained in:
Jeff Muizelaar 2021-04-19 18:14:47 +00:00
Родитель de7f8edd6f
Коммит d0d3ba387d
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -405,11 +405,7 @@ unsafe extern "C" fn qcms_transform_data_gray_template_lut<I: GrayFormat, F: For
length: usize,
) {
let components: u32 = if F::kAIndex == 0xff { 3 } else { 4 } as u32;
let input_gamma_table_gray = (*transform)
.input_gamma_table_gray
.as_ref()
.unwrap()
.as_ptr();
let input_gamma_table_gray = transform.input_gamma_table_gray.as_ref().unwrap();
let mut i: u32 = 0;
while (i as usize) < length {
@ -422,7 +418,7 @@ unsafe extern "C" fn qcms_transform_data_gray_template_lut<I: GrayFormat, F: For
src = src.offset(1);
alpha = *fresh1
}
let linear: f32 = *input_gamma_table_gray.offset(device as isize);
let linear: f32 = input_gamma_table_gray[device as usize];
let out_device_r: f32 = lut_interp_linear(
linear as f64,