)]}'
{
  "commit": "4f402994f02a651fbdd073ce4c172bdea4ae0cc2",
  "tree": "70161996c214f99d8446405a699ab28caf28c151",
  "parents": [
    "bc9730fd53e1a00ef34b5b58e3e3f6f7fb0cfecc"
  ],
  "author": {
    "name": "Yuan Tong",
    "email": "tongyuan200097@gmail.com",
    "time": "Sat Feb 27 12:49:40 2021 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Feb 26 20:49:40 2021 -0800"
  },
  "message": "Fail on reformat Identity with subsampling, make avifenc correct this before reformat (#517)\n\nAccording to [AV1 Spec](https://aomediacodec.github.io/av1-spec/#color-config-semantics), Identity is only valid with YUV444:\r\n\u003e If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of bitstream conformance that subsampling_x is equal to 0 and subsampling_y is equal to 0.\r\n\r\nBut `avifImageRGBToYUV` still tries to do the reformat. avifenc tries to correct this, but after reformat, which will produce an valid image but with wrong color.\r\n\r\nThis PR lets `avifImageRGBToYUV` failed on `image-\u003ematrixCoefficients \u003d\u003d AVIF_MATRIX_COEFFICIENTS_IDENTITY \u0026\u0026 image-\u003eyuvFormat !\u003d AVIF_PIXEL_FORMAT_YUV444` so that libavif won\u0027t produce corrupted file. This PR also makes avifenc correct MC before reformat so that the output image has correct color.\r\n\r\nI\u0027m still thinking should we change MC or yuvFormat in this case? If user wants lossless, then maybe we should change yuvFormat instead, which makes output lossless as requested.\r\n\r\nBy the way, if we try to make an Identity monochrome image (forbid by spec), libavif, Chrome and Firefox all wouldn\u0027t reject decoding it. However libavif and Firefox will copy the Y(G) value to U(B) and V(R), but Chrome will fill U(B) and V(R) with 128.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b4ba23873643ca54f748da20b598f6113c853461",
      "old_mode": 33188,
      "old_path": "apps/avifenc.c",
      "new_id": "73706613b57eacf04eeb164562773491190471e3",
      "new_mode": 33188,
      "new_path": "apps/avifenc.c"
    },
    {
      "type": "modify",
      "old_id": "be035c4a73884cacaad9109f4eb13cbb28b3b027",
      "old_mode": 33188,
      "old_path": "src/reformat.c",
      "new_id": "e318487f93440a16385dc6dc954525afdfeb5268",
      "new_mode": 33188,
      "new_path": "src/reformat.c"
    }
  ]
}
