diff --git a/.arcconfig b/.arcconfig --- a/.arcconfig +++ b/.arcconfig @@ -1,5 +1,5 @@ { - "phabricator.uri" : "https://phabricator.services.mozilla.com/", - "repository.callsign": "MOZILLACENTRAL", + "phabricator.uri" : "https://phabricator-dev.allizom.org/", +"repository.callsign": "MOZILLACENTRAL", "history.immutable": false } diff --git a/media/libjxl/moz.yaml b/media/libjxl/moz.yaml --- a/media/libjxl/moz.yaml +++ b/media/libjxl/moz.yaml @@ -18,16 +18,16 @@ # Usually different from repository url url: https://gitlab.com/wg1/jpeg-xl # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: commit 30ea86ab4c1f1b98c21967a2e3d72a51fe77e454 (2021-05-12T21:50:20.000+02:00). + release: commit 100e3c7e8a051b7399d0505c22640488287a31a8 (2021-05-18T15:01:53.000+02:00). # Revision to pull in # Must be a long or short commit SHA (long preferred) # NOTE(krosylight): Update highway together when updating this! - revision: 30ea86ab4c1f1b98c21967a2e3d72a51fe77e454 + revision: 100e3c7e8a051b7399d0505c22640488287a31a8 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ # Multiple licenses can be specified (as a YAML list) # A "LICENSE" file must exist containing the full license text diff --git a/third_party/jpeg-xl/lib/extras/codec_apng.cc b/third_party/jpeg-xl/lib/extras/codec_apng.cc --- a/third_party/jpeg-xl/lib/extras/codec_apng.cc +++ b/third_party/jpeg-xl/lib/extras/codec_apng.cc @@ -220,10 +220,11 @@ CHUNK chunkIHDR; std::vector chunksInfo; bool isAnimated = false; bool skipFirst = false; bool hasInfo = false; + bool all_dispose_bg = true; APNGFrame frameRaw = {}; if (!(f = fmemopen((void*)bytes.data(), bytes.size(), "rb"))) { return JXL_FAILURE("Failed to fmemopen"); } @@ -290,23 +291,25 @@ ImageBundle bundle(&io->metadata.m); bundle.duration = delay_num * 1000 / delay_den; bundle.origin.x0 = x0; bundle.origin.y0 = y0; // TODO(veluca): this could in principle be implemented. - if (last_base_was_none && + if (last_base_was_none && !all_dispose_bg && (x0 != 0 || y0 != 0 || w0 != w || h0 != h || bop != 0)) { return JXL_FAILURE( "APNG with dispose-to-0 is not supported for non-full or " "blended frames"); } switch (dop) { case 0: bundle.use_for_next_frame = true; last_base_was_none = false; + all_dispose_bg = false; break; case 2: bundle.use_for_next_frame = false; + all_dispose_bg = false; break; default: bundle.use_for_next_frame = false; last_base_was_none = true; } diff --git a/third_party/jpeg-xl/lib/jxl/chroma_from_luma.h b/third_party/jpeg-xl/lib/jxl/chroma_from_luma.h --- a/third_party/jpeg-xl/lib/jxl/chroma_from_luma.h +++ b/third_party/jpeg-xl/lib/jxl/chroma_from_luma.h @@ -59,11 +59,11 @@ // since the CfL denominator is 84, this leaves 12 bits of mantissa to be used. // For extra caution, we use 11. static constexpr uint8_t kCFLFixedPointPrecision = 11; static constexpr U32Enc kColorFactorDist(Val(kDefaultColorFactor), Val(256), - BitsOffset(2, 8), BitsOffset(258, 12)); + BitsOffset(8, 2), BitsOffset(16, 258)); struct ColorCorrelationMap { ColorCorrelationMap() = default; // xsize/ysize are in pixels // set XYB=false to do something close to no-op cmap (needed for now since diff --git a/third_party/jpeg-xl/lib/jxl/dec_patch_dictionary.cc b/third_party/jpeg-xl/lib/jxl/dec_patch_dictionary.cc --- a/third_party/jpeg-xl/lib/jxl/dec_patch_dictionary.cc +++ b/third_party/jpeg-xl/lib/jxl/dec_patch_dictionary.cc @@ -191,12 +191,10 @@ const Rect& image_rect) const { JXL_CHECK(SameSize(opsin_rect, image_rect)); size_t num_ec = shared_->metadata->m.num_extra_channels; std::vector fg_ptrs(3 + num_ec); std::vector bg_ptrs(3 + num_ec); - BlendingInfo color_blending; - std::vector ec_blending(num_ec); for (size_t y = image_rect.y0(); y < image_rect.y0() + image_rect.ysize(); y++) { if (y + 1 >= patch_starts_.size()) continue; for (size_t id = patch_starts_[y]; id < patch_starts_[y + 1]; id++) { const PatchPosition& pos = positions_[sorted_patches_[id]]; diff --git a/third_party/jpeg-xl/lib/jxl/decode.cc b/third_party/jpeg-xl/lib/jxl/decode.cc --- a/third_party/jpeg-xl/lib/jxl/decode.cc +++ b/third_party/jpeg-xl/lib/jxl/decode.cc @@ -1018,12 +1018,18 @@ dec->sections.reset( new Sections(dec->frame_dec.get(), dec->frame_size, sections_begin)); JXL_API_RETURN_IF_ERROR(dec->sections->Init()); - dec->frame_dec_in_progress = true; - dec->frame_stage = FrameStage::kDC; + // If we don't need pixels, we can skip actually decoding the frames + // (kFull / kDC / kFullOut / kDCOut). By not updating frame_stage, none of + // these stages will execute, and the loop will continue from the next + // frame. + if (dec->events_wanted & (JXL_DEC_DC_IMAGE | JXL_DEC_FULL_IMAGE)) { + dec->frame_dec_in_progress = true; + dec->frame_stage = FrameStage::kDC; + } } if (dec->frame_stage == FrameStage::kDC) { if (!(dec->events_wanted & JXL_DEC_DC_IMAGE)) { dec->frame_stage = FrameStage::kFull; diff --git a/third_party/jpeg-xl/lib/jxl/passes_state.h b/third_party/jpeg-xl/lib/jxl/passes_state.h --- a/third_party/jpeg-xl/lib/jxl/passes_state.h +++ b/third_party/jpeg-xl/lib/jxl/passes_state.h @@ -88,11 +88,11 @@ // the CodecInOut, or can point to an existing ImageBundle. // TODO(veluca): pointing to ImageBundles in CodecInOut is not possible for // now, as they are stored in a vector and thus may be moved. Fix this. ImageBundle* JXL_RESTRICT frame = &storage; // ImageBundle doesn't yet have a simple way to state it is in XYB. - bool ib_is_in_xyb = true; + bool ib_is_in_xyb = false; } reference_frames[4] = {}; // Number of pre-clustered set of histograms (with the same ctx map), per // pass. Encoded as num_histograms_ - 1. size_t num_histograms = 0;