mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 06:59:10 +00:00
Make numerous improvements
- Python static hello world now 1.8mb - Python static fully loaded now 10mb - Python HTTPS client now uses MbedTLS - Python REPL now completes import stmts - Increase stack size for Python for now - Begin synthesizing posixpath and ntpath - Restore Python \N{UNICODE NAME} support - Restore Python NFKD symbol normalization - Add optimized code path for Intel SHA-NI - Get more Python unit tests passing faster - Get Python help() pagination working on NT - Python hashlib now supports MbedTLS PBKDF2 - Make memcpy/memmove/memcmp/bcmp/etc. faster - Add Mersenne Twister and Vigna to LIBC_RAND - Provide privileged __printf() for error code - Fix zipos opendir() so that it reports ENOTDIR - Add basic chmod() implementation for Windows NT - Add Cosmo's best functions to Python cosmo module - Pin function trace indent depth to that of caller - Show memory diagram on invalid access in MODE=dbg - Differentiate stack overflow on crash in MODE=dbg - Add stb_truetype and tools for analyzing font files - Upgrade to UNICODE 13 and reduce its binary footprint - COMPILE.COM now logs resource usage of build commands - Start implementing basic poll() support on bare metal - Set getauxval(AT_EXECFN) to GetModuleFileName() on NT - Add descriptions to strerror() in non-TINY build modes - Add COUNTBRANCH() macro to help with micro-optimizations - Make error / backtrace / asan / memory code more unbreakable - Add fast perfect C implementation of μ-Law and a-Law audio codecs - Make strtol() functions consistent with other libc implementations - Improve Linenoise implementation (see also github.com/jart/bestline) - COMPILE.COM now suppresses stdout/stderr of successful build commands
This commit is contained in:
parent
fa7b4f5bd1
commit
39bf41f4eb
806 changed files with 77494 additions and 63859 deletions
21
third_party/stb/stb_image_resize.c
vendored
21
third_party/stb/stb_image_resize.c
vendored
|
@ -394,9 +394,7 @@ static float stbir__support_trapezoid(float scale) {
|
|||
|
||||
static float stbir__filter_triangle(float x, float s) {
|
||||
STBIR__UNUSED_PARAM(s);
|
||||
|
||||
x = (float)fabs(x);
|
||||
|
||||
if (x <= 1.0f)
|
||||
return 1 - x;
|
||||
else
|
||||
|
@ -405,40 +403,31 @@ static float stbir__filter_triangle(float x, float s) {
|
|||
|
||||
static float stbir__filter_cubic(float x, float s) {
|
||||
STBIR__UNUSED_PARAM(s);
|
||||
|
||||
x = (float)fabs(x);
|
||||
|
||||
if (x < 1.0f)
|
||||
return (4 + x * x * (3 * x - 6)) / 6;
|
||||
else if (x < 2.0f)
|
||||
return (8 + x * (-12 + x * (6 - x))) / 6;
|
||||
|
||||
return (0.0f);
|
||||
}
|
||||
|
||||
static float stbir__filter_catmullrom(float x, float s) {
|
||||
STBIR__UNUSED_PARAM(s);
|
||||
|
||||
x = (float)fabs(x);
|
||||
|
||||
if (x < 1.0f)
|
||||
return 1 - x * x * (2.5f - 1.5f * x);
|
||||
else if (x < 2.0f)
|
||||
return 2 - x * (4 + x * (0.5f * x - 2.5f));
|
||||
|
||||
return (0.0f);
|
||||
}
|
||||
|
||||
static float stbir__filter_mitchell(float x, float s) {
|
||||
STBIR__UNUSED_PARAM(s);
|
||||
|
||||
x = (float)fabs(x);
|
||||
|
||||
if (x < 1.0f)
|
||||
return (16 + x * x * (21 * x - 36)) / 18;
|
||||
else if (x < 2.0f)
|
||||
return (32 + x * (-60 + x * (36 - 7 * x))) / 18;
|
||||
|
||||
return (0.0f);
|
||||
}
|
||||
|
||||
|
@ -1080,7 +1069,7 @@ static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info,
|
|||
ring_buffer = stbir__get_ring_buffer_entry(
|
||||
stbir_info->ring_buffer, ring_buffer_index,
|
||||
stbir_info->ring_buffer_length_bytes / sizeof(float));
|
||||
memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes);
|
||||
bzero(ring_buffer, stbir_info->ring_buffer_length_bytes);
|
||||
|
||||
return ring_buffer;
|
||||
}
|
||||
|
@ -1340,8 +1329,8 @@ static void stbir__decode_and_resample_downsample(stbir__info* stbir_info,
|
|||
// Decode the nth scanline from the source image into the decode buffer.
|
||||
stbir__decode_scanline(stbir_info, n);
|
||||
|
||||
memset(stbir_info->horizontal_buffer, 0,
|
||||
stbir_info->output_w * stbir_info->channels * sizeof(float));
|
||||
bzero(stbir_info->horizontal_buffer,
|
||||
stbir_info->output_w * stbir_info->channels * sizeof(float));
|
||||
|
||||
// Now resample it into the horizontal buffer.
|
||||
if (stbir__use_width_upsampling(stbir_info))
|
||||
|
@ -1584,7 +1573,7 @@ static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n) {
|
|||
|
||||
STBIR_ASSERT(stbir__use_height_upsampling(stbir_info));
|
||||
|
||||
memset(encode_buffer, 0, output_w * sizeof(float) * channels);
|
||||
bzero(encode_buffer, output_w * sizeof(float) * channels);
|
||||
|
||||
// I tried reblocking this for better cache usage of encode_buffer
|
||||
// (using x_outer, k, x_inner), but it lost speed. -- stb
|
||||
|
@ -2104,7 +2093,7 @@ static int stbir__resize_allocated(
|
|||
|
||||
if (tempmem_size_in_bytes < memory_required) return 0;
|
||||
|
||||
memset(tempmem, 0, tempmem_size_in_bytes);
|
||||
bzero(tempmem, tempmem_size_in_bytes);
|
||||
|
||||
info->input_data = input_data;
|
||||
info->input_stride_bytes = width_stride_input;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue