diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2022-03-24 12:39:24 -0700 |
---|---|---|
committer | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2022-03-24 22:41:23 -0700 |
commit | 3529141b4bf548218f70a713b4328220a566802d (patch) | |
tree | a9e0ba416efc19eda40193522f52659feb865256 /thirdparty/basis_universal/encoder/jpgd.cpp | |
parent | d250f12243a74fd36905f46b983e3c142e3b2e67 (diff) | |
download | redot-engine-3529141b4bf548218f70a713b4328220a566802d.tar.gz |
Update basis universal to version 1.16.3.
Enable basis universal uastc internal storage instead of etc1s for better quality.
Diffstat (limited to 'thirdparty/basis_universal/encoder/jpgd.cpp')
-rw-r--r-- | thirdparty/basis_universal/encoder/jpgd.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/thirdparty/basis_universal/encoder/jpgd.cpp b/thirdparty/basis_universal/encoder/jpgd.cpp index 460834409d..fec8b71439 100644 --- a/thirdparty/basis_universal/encoder/jpgd.cpp +++ b/thirdparty/basis_universal/encoder/jpgd.cpp @@ -23,17 +23,6 @@ // v1.04, May. 19, 2012: Code tweaks to fix VS2008 static code analysis warnings // v2.00, March 20, 2020: Fuzzed with zzuf and afl. Fixed several issues, converted most assert()'s to run-time checks. Added chroma upsampling. Removed freq. domain upsampling. gcc/clang warnings. // -#ifdef _MSC_VER -#ifndef BASISU_NO_ITERATOR_DEBUG_LEVEL -#if defined(_DEBUG) || defined(DEBUG) -#define _ITERATOR_DEBUG_LEVEL 1 -#define _SECURE_SCL 1 -#else -#define _SECURE_SCL 0 -#define _ITERATOR_DEBUG_LEVEL 0 -#endif -#endif -#endif #include "jpgd.h" #include <string.h> @@ -2085,7 +2074,7 @@ namespace jpgd { if (setjmp(m_jmp_state)) return JPGD_FAILED; - const bool chroma_y_filtering = (m_flags & cFlagLinearChromaFiltering) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2)); + const bool chroma_y_filtering = (m_flags & cFlagLinearChromaFiltering) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2)) && (m_image_x_size >= 2) && (m_image_y_size >= 2); if (chroma_y_filtering) { std::swap(m_pSample_buf, m_pSample_buf_prev); @@ -2114,7 +2103,7 @@ namespace jpgd { if (m_total_lines_left == 0) return JPGD_DONE; - const bool chroma_y_filtering = (m_flags & cFlagLinearChromaFiltering) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2)); + const bool chroma_y_filtering = (m_flags & cFlagLinearChromaFiltering) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2)) && (m_image_x_size >= 2) && (m_image_y_size >= 2); bool get_another_mcu_row = false; bool got_mcu_early = false; @@ -2144,7 +2133,7 @@ namespace jpgd { { case JPGD_YH2V2: { - if (m_flags & cFlagLinearChromaFiltering) + if ((m_flags & cFlagLinearChromaFiltering) && (m_image_x_size >= 2) && (m_image_y_size >= 2)) { if (m_num_buffered_scanlines == 1) { @@ -2173,7 +2162,7 @@ namespace jpgd { } case JPGD_YH2V1: { - if (m_flags & cFlagLinearChromaFiltering) + if ((m_flags & cFlagLinearChromaFiltering) && (m_image_x_size >= 2) && (m_image_y_size >= 2)) H2V1ConvertFiltered(); else H2V1Convert(); |