Report downsample progress by when we empty the ring buffer, it's more accurate that way.
This commit is contained in:
parent
084baed15c
commit
d510d70b6a
@ -1500,6 +1500,7 @@ static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_necessar
|
|||||||
int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes;
|
int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes;
|
||||||
float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length);
|
float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length);
|
||||||
stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode);
|
stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode);
|
||||||
|
STBIR_PROGRESS_REPORT((float)stbir_info->ring_buffer_first_scanline / output_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline)
|
if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline)
|
||||||
@ -1556,8 +1557,6 @@ static void stbir__buffer_loop_downsample(stbir__info* stbir_info)
|
|||||||
|
|
||||||
// Now the horizontal buffer is ready to write to all ring buffer rows.
|
// Now the horizontal buffer is ready to write to all ring buffer rows.
|
||||||
stbir__resample_vertical_downsample(stbir_info, y, out_first_scanline, out_last_scanline, out_center_of_in);
|
stbir__resample_vertical_downsample(stbir_info, y, out_first_scanline, out_last_scanline, out_center_of_in);
|
||||||
|
|
||||||
STBIR_PROGRESS_REPORT((float)(y + pixel_margin) / (stbir_info->input_h + pixel_margin * 2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stbir__empty_ring_buffer(stbir_info, stbir_info->output_h);
|
stbir__empty_ring_buffer(stbir_info, stbir_info->output_h);
|
||||||
|
Loading…
Reference in New Issue
Block a user