diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc b/third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc index 07601a2221..b71bb07bc9 100644 --- a/third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc +++ b/third_party/jpeg-xl/lib/jxl/enc_entropy_coder.cc @@ -90,8 +90,8 @@ int32_t NumNonZeroExceptLLF(const size_t cx, const size_t cy, } // We want area - sum_zero, add because neg_sum_zero is already negated. - const int32_t nzeros = - int32_t(cx * cy * kDCTBlockSize) + GetLane(SumOfLanes(di, neg_sum_zero)); + const int32_t nzeros = static_cast<int32_t>(cx * cy * kDCTBlockSize) + + GetLane(SumOfLanes(di, neg_sum_zero)); const int32_t shifted_nzeros = static_cast<int32_t>( (nzeros + covered_blocks - 1) >> log2_covered_blocks); @@ -139,8 +139,8 @@ int32_t NumNonZero8x8ExceptDC(const int32_t* JXL_RESTRICT block, } // We want 64 - sum_zero, add because neg_sum_zero is already negated. - const int32_t nzeros = - int32_t(kDCTBlockSize) + GetLane(SumOfLanes(di, neg_sum_zero)); + const int32_t nzeros = static_cast<int32_t>(kDCTBlockSize) + + GetLane(SumOfLanes(di, neg_sum_zero)); *nzeros_pos = nzeros; @@ -157,7 +157,7 @@ void TokenizeCoefficients(const coeff_order_t* JXL_RESTRICT orders, const Rect& rect, const int32_t* JXL_RESTRICT* JXL_RESTRICT ac_rows, const AcStrategyImage& ac_strategy, - YCbCrChromaSubsampling cs, + const YCbCrChromaSubsampling& cs, Image3I* JXL_RESTRICT tmp_num_nzeroes, std::vector<Token>* JXL_RESTRICT output, const ImageB& qdc, const ImageI& qf, @@ -236,7 +236,7 @@ void TokenizeCoefficients(const coeff_order_t* JXL_RESTRICT orders, log2_covered_blocks, prev); uint32_t u_coeff = PackSigned(coeff); output->emplace_back(ctx, u_coeff); - prev = coeff != 0; + prev = (coeff != 0) ? 1 : 0; nzeros -= prev; } JXL_DASSERT(nzeros == 0); @@ -258,14 +258,14 @@ void TokenizeCoefficients(const coeff_order_t* JXL_RESTRICT orders, const Rect& rect, const int32_t* JXL_RESTRICT* JXL_RESTRICT ac_rows, const AcStrategyImage& ac_strategy, - YCbCrChromaSubsampling cs, + const YCbCrChromaSubsampling& cs, Image3I* JXL_RESTRICT tmp_num_nzeroes, std::vector<Token>* JXL_RESTRICT output, const ImageB& qdc, const ImageI& qf, const BlockCtxMap& block_ctx_map) { - return HWY_DYNAMIC_DISPATCH(TokenizeCoefficients)( - orders, rect, ac_rows, ac_strategy, cs, tmp_num_nzeroes, output, qdc, qf, - block_ctx_map); + HWY_DYNAMIC_DISPATCH(TokenizeCoefficients) + (orders, rect, ac_rows, ac_strategy, cs, tmp_num_nzeroes, output, qdc, qf, + block_ctx_map); } } // namespace jxl |