Skip to content

Ccso: Split parameter search into sub-functions - #5336

Open
ram-mohan wants to merge 1 commit into
AOMediaCodec:av2-encfrom
ram-mohan:refactor_ccso
Open

Ccso: Split parameter search into sub-functions#5336
ram-mohan wants to merge 1 commit into
AOMediaCodec:av2-encfrom
ram-mohan:refactor_ccso

Conversation

@ram-mohan

Copy link
Copy Markdown
Contributor
  • Split per-plane ccso parameter search into focused sub-functions.
  • Introduce CcsoCtx/CcsoCtxCommon to carry per-plane-search state, replacing long function-argument lists.
  • Replace raw memset/memcpy with av2_zero_array/av2_copy_array, and narrow several of them from the full CCSO_BAND_NUM/ CCSO_CLASS_STATS_ENTRIES range down to the max_band/ max_edge_interval range actually used by the current search iteration.
  • corrects two places that used the horizontal filter-unit log2 for a vertical quantity (derive_blk_md(), get_sb_reuse_dist() and ccso_compute_class_err).

no stats changed

- Split per-plane ccso parameter search into focused sub-functions.
- Introduce CcsoCtx/CcsoCtxCommon to carry per-plane-search state,
  replacing long function-argument lists.
- Replace raw memset/memcpy with av2_zero_array/av2_copy_array, and
  narrow several of them from the full CCSO_BAND_NUM/
  CCSO_CLASS_STATS_ENTRIES range down to the max_band/
  max_edge_interval range actually used by the current search
  iteration.
- corrects two places that used the horizontal filter-unit log2 for a
  vertical quantity (derive_blk_md(), get_sb_reuse_dist() and
  ccso_compute_class_err).

no stats changed
@ram-mohan
ram-mohan marked this pull request as ready for review August 31, 2026 05:37
@urvangjoshi
urvangjoshi requested a review from leolzhao August 31, 2026 18:08
@ram-mohan

Copy link
Copy Markdown
Contributor Author

@yunqingwang1 @urvangjoshi when you get a chance can you please review
cc: @harishdm @ranjit-tulabandu @cherma-a @deepa-kg @RemyaPrakasan @vikasprasad10

Comment thread av2/encoder/pickccso.c
(1 << s->log2_filter_unit_size_x >> (MI_SIZE_LOG2 - ss_x));
const int sb_unit_size_y =
(1 << log2_filter_unit_size >> (MI_SIZE_LOG2 - ss_y));
(1 << s->log2_filter_unit_size_y >> (MI_SIZE_LOG2 - ss_y));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the fix? Would it potentially change the encoder result (have STATS CHANGE)? Thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yunqingwang1 , yes this is the typo fix made. This fix is relevant only for subsampling formats with ss_x != ss_y. For 444 and 420 this change is no-op. For 422 this is relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants