diff options
Diffstat (limited to 'modules/cvtt/image_compress_cvtt.cpp')
-rw-r--r-- | modules/cvtt/image_compress_cvtt.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp index 9dbaa88202..2a4f836478 100644 --- a/modules/cvtt/image_compress_cvtt.cpp +++ b/modules/cvtt/image_compress_cvtt.cpp @@ -137,9 +137,9 @@ static void _digest_job_queue(void *p_job_queue) { } void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChannels p_channels) { - - if (p_image->get_format() >= Image::FORMAT_BPTC_RGBA) + if (p_image->get_format() >= Image::FORMAT_BPTC_RGBA) { return; //do not compress, already compressed + } int w = p_image->get_width(); int h = p_image->get_height(); @@ -154,16 +154,17 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann cvtt::Options options; uint32_t flags = cvtt::Flags::Fastest; - if (p_lossy_quality > 0.85) + if (p_lossy_quality > 0.85) { flags = cvtt::Flags::Ultra; - else if (p_lossy_quality > 0.75) + } else if (p_lossy_quality > 0.75) { flags = cvtt::Flags::Better; - else if (p_lossy_quality > 0.55) + } else if (p_lossy_quality > 0.55) { flags = cvtt::Flags::Default; - else if (p_lossy_quality > 0.35) + } else if (p_lossy_quality > 0.35) { flags = cvtt::Flags::Fast; - else if (p_lossy_quality > 0.15) + } else if (p_lossy_quality > 0.15) { flags = cvtt::Flags::Faster; + } flags |= cvtt::Flags::BC7_RespectPunchThrough; @@ -222,7 +223,6 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann Vector<CVTTCompressionRowTask> tasks; for (int i = 0; i <= mm_count; i++) { - int bw = w % 4 != 0 ? w + (4 - w % 4) : w; int bh = h % 4 != 0 ? h + (4 - h % 4) : h; @@ -280,7 +280,6 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann } void image_decompress_cvtt(Image *p_image) { - Image::Format target_format; bool is_signed = false; bool is_hdr = false; @@ -318,7 +317,6 @@ void image_decompress_cvtt(Image *p_image) { int dst_ofs = 0; for (int i = 0; i <= mm_count; i++) { - int src_ofs = p_image->get_mipmap_offset(i); const uint8_t *in_bytes = &rb[src_ofs]; |