)]}'
{
  "commit": "c106b816e25bc8b73c99b7417636364c05d43456",
  "tree": "826a69c071c4120c4e740695d106311282d23973",
  "parents": [
    "a0c87e28f64a977689e00d2b35af880cd872396f"
  ],
  "author": {
    "name": "Erik Språng",
    "email": "sprang@google.com",
    "time": "Thu Nov 19 20:47:36 2026 -0800"
  },
  "committer": {
    "name": "Erik Språng",
    "email": "sprang@google.com",
    "time": "Fri Dec 04 01:29:19 2026 -0800"
  },
  "message": "rtc: Track cyclic_refresh-\u003emap capacity on resize\n\nIn `av1_change_config()`, `realloc_segmentation_maps()` only runs when\nthe frame grows beyond `data_alloc_width`/`data_alloc_height` (or\nsuperblock size changes), while the separate resize block freed and\nshrunk `cpi-\u003ecyclic_refresh-\u003emap` and spatial-layer `lc-\u003emap` whenever\n`aq_mode \u003d\u003d CYCLIC_REFRESH_AQ`. Downscaling with `CYCLIC_REFRESH_AQ`,\ndisabling AQ, upscaling back within\n`data_alloc_width`/`data_alloc_height`, and re-enabling\n`CYCLIC_REFRESH_AQ` left `cyclic_refresh-\u003emap` undersized, causing\nheap-buffer-overflow accesses in `cyclic_refresh_update_map()`.\n\nSpatial SVC layer maps (`lc-\u003emap`) had the same issue and were never\ngrown when upscaling beyond initial dimensions while\n`aq_mode !\u003d CYCLIC_REFRESH_AQ`, so a subsequent keyframe could swap an\nundersized `lc-\u003emap` into `cpi-\u003ecyclic_refresh-\u003emap`.\n\nTrack the allocated capacity (`map_size`) on `CYCLIC_REFRESH` and\n`LAYER_CONTEXT`:\n\n- Add `get_cyclic_refresh_map_size()` and shared grow-or-clear helper\n  `ensure_cyclic_refresh_map_size()` in `encoder_alloc.h` (respecting\n  `frm_dim_cfg`, `data_alloc_width`/`height`, and\n  `forced_max_frame_width`/`height`).\n- In `av1_change_config()`, grow or clear `cpi-\u003ecyclic_refresh-\u003emap`\n  and reset counters in place without shrinking, and delegate spatial\n  SVC resize resets to `av1_svc_reset_cyclic_refresh_on_resize()`.\n- In `svc_layercontext.c`, size and grow `lc-\u003emap` via\n  `ensure_cyclic_refresh_map_size()` without shrinking, and replace\n  `swap_ptr()` with a typed `swap_cyclic_refresh_map()` helper.\n- Assert map non-null and capacity via\n  `assert_cyclic_refresh_map_valid()` (and on `lc-\u003emap` restore) and\n  clear `cr-\u003emap_size` elements in `cyclic_refresh_reset_resize()`.\n- Add regression tests:\n  - `EncodeAPI.CyclicRefreshMapResizeWithAqModeToggle`\n  - `EncodeAPI.SvcCyclicRefreshMapResizeWithAqModeToggle`\n  - `EncodeAPI.SvcCyclicRefreshMapKeyframeSwapAfterDownscale`\n\nBug: 588097961\nChange-Id: I6c19026d9e0053e095c8a2e19c3ce68eeb79873f\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b76fbf895cb3babdc8728088f2ae4607adf94311",
      "old_mode": 33188,
      "old_path": "av1/encoder/aq_cyclicrefresh.c",
      "new_id": "5620046a98afe2fc5f164906c4c4b40666feb851",
      "new_mode": 33188,
      "new_path": "av1/encoder/aq_cyclicrefresh.c"
    },
    {
      "type": "modify",
      "old_id": "7c71a69d896dfce060fd2c379c6d8b8480537cec",
      "old_mode": 33188,
      "old_path": "av1/encoder/aq_cyclicrefresh.h",
      "new_id": "5932e4d7a08513ee22ea21b6b7431c3aa7ecd11e",
      "new_mode": 33188,
      "new_path": "av1/encoder/aq_cyclicrefresh.h"
    },
    {
      "type": "modify",
      "old_id": "b210ff68a183d3d9e5d8592187632a6bfc9d4cb0",
      "old_mode": 33188,
      "old_path": "av1/encoder/encoder.c",
      "new_id": "5d1cee27d86145d15539e6380cde6c3e0f443381",
      "new_mode": 33188,
      "new_path": "av1/encoder/encoder.c"
    },
    {
      "type": "modify",
      "old_id": "7574ce83ad4bbf13cbcbd115a9c9fd5bf34f1536",
      "old_mode": 33188,
      "old_path": "av1/encoder/encoder_alloc.h",
      "new_id": "68b6dcdd5cbd3d654f0c33f2630397ebc7b8c09b",
      "new_mode": 33188,
      "new_path": "av1/encoder/encoder_alloc.h"
    },
    {
      "type": "modify",
      "old_id": "88d07e31c8ca393cf704773aefe6cce77838c667",
      "old_mode": 33188,
      "old_path": "av1/encoder/svc_layercontext.c",
      "new_id": "0f3d3977ad0198634381e4f809916d8214764be9",
      "new_mode": 33188,
      "new_path": "av1/encoder/svc_layercontext.c"
    },
    {
      "type": "modify",
      "old_id": "4425e76a563f737c62663077a819109360c855cf",
      "old_mode": 33188,
      "old_path": "av1/encoder/svc_layercontext.h",
      "new_id": "6612824d023c0c6df36d19649b65ac5e4ce5e94c",
      "new_mode": 33188,
      "new_path": "av1/encoder/svc_layercontext.h"
    },
    {
      "type": "modify",
      "old_id": "33bb20b4a4d78fd7c86d9f7be55c9e2a50a1e7e6",
      "old_mode": 33188,
      "old_path": "test/encode_api_test.cc",
      "new_id": "89fea87a34a7a7031c5b983b64c904d0b91caa53",
      "new_mode": 33188,
      "new_path": "test/encode_api_test.cc"
    }
  ]
}
