roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 21d7cf44b1cd83bb0d847515e28ca550404b0033 Mon Sep 17 00:00:00 2001
  2. From: Wan-Teh Chang <wtc@google.com>
  3. Date: Tue, 22 Aug 2023 19:39:04 +0000
  4. Subject: [PATCH] Roll src/third_party/libavif/src/ b33d9ebfc..676aded35 (3
  5. commits)
  6. https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git/+log/b33d9ebfc961..676aded3501f
  7. $ git log b33d9ebfc..676aded35 --date=short --no-merges --format='%ad %ae %s'
  8. 2023-08-22 wtc Change imir.mode back to imir.axis
  9. 2023-08-22 wtc Don't use Identity matrix coefficients with 4:0:0
  10. 2023-08-21 yguyon Increase test values in avifstreamtest
  11. Created with:
  12. roll-dep src/third_party/libavif/src
  13. R=dalecurtis@chromium.org,jzern@google.com
  14. Note that imir.mode is renamed imir.axis.
  15. Change-Id: Ie13972640969f123b7e4580f36d6d6bab913c0f8
  16. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4803347
  17. Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
  18. Commit-Queue: Wan-Teh Chang <wtc@google.com>
  19. Cr-Commit-Position: refs/heads/main@{#1186746}
  20. ---
  21. .../image-decoders/avif/avif_image_decoder.cc | 14 +++++++-------
  22. 1 file changed, 7 insertions(+), 7 deletions(-)
  23. diff --git a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
  24. index deb3e66d66f..c9f1b185417 100644
  25. --- a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
  26. +++ b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
  27. @@ -1005,22 +1005,22 @@ bool AVIFImageDecoder::UpdateDemuxer() {
  28. angle = container->irot.angle;
  29. CHECK_LT(angle, 4);
  30. }
  31. - // |mode| specifies how the mirroring is performed.
  32. + // |axis| specifies how the mirroring is performed.
  33. // -1: No mirroring.
  34. // 0: The top and bottom parts of the image are exchanged.
  35. // 1: The left and right parts of the image are exchanged.
  36. - int mode = -1;
  37. + int axis = -1;
  38. if (container->transformFlags & AVIF_TRANSFORM_IMIR) {
  39. - mode = container->imir.mode;
  40. - CHECK_LT(mode, 2);
  41. + axis = container->imir.axis;
  42. + CHECK_LT(axis, 2);
  43. }
  44. // MIAF Section 7.3.6.7 (Clean aperture, rotation and mirror) says:
  45. // These properties, if used, shall be indicated to be applied in the
  46. // following order: clean aperture first, then rotation, then mirror.
  47. //
  48. - // In the kModeAngleToOrientation array, the first dimension is mode (with an
  49. + // In the kAxisAngleToOrientation array, the first dimension is axis (with an
  50. // offset of 1). The second dimension is angle.
  51. - constexpr ImageOrientationEnum kModeAngleToOrientation[3][4] = {
  52. + constexpr ImageOrientationEnum kAxisAngleToOrientation[3][4] = {
  53. // No mirroring.
  54. {ImageOrientationEnum::kOriginTopLeft,
  55. ImageOrientationEnum::kOriginLeftBottom,
  56. @@ -1037,7 +1037,7 @@ bool AVIFImageDecoder::UpdateDemuxer() {
  57. ImageOrientationEnum::kOriginBottomLeft,
  58. ImageOrientationEnum::kOriginLeftTop},
  59. };
  60. - orientation_ = kModeAngleToOrientation[mode + 1][angle];
  61. + orientation_ = kAxisAngleToOrientation[axis + 1][angle];
  62. // Determine whether the image can be decoded to YUV.
  63. // * Alpha channel is not supported.