Skip to content

Add per-frame RC state slots and u64 total_bits fix (from PR #228) - #234

Merged
kpchoi merged 2 commits into
AcademySoftwareFoundation:mainfrom
mss-park:rc-per-frame
Aug 6, 2026
Merged

Add per-frame RC state slots and u64 total_bits fix (from PR #228)#234
kpchoi merged 2 commits into
AcademySoftwareFoundation:mainfrom
mss-park:rc-per-frame

Conversation

@mss-park

@mss-park mss-park commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Extract the rate-control-only changes from PR #228 (TMV multi-mip work)

…oftwareFoundation#228)

Extract the rate-control-only changes from PR AcademySoftwareFoundation#228 (TMV multi-mip work):

- Per-frame RC state: oapve_ctx gains rc_param_frm[OAPV_MAX_NUM_FRAMES].
  At the start of each frame in an AU, ctx->rc_param is loaded from the
  frame-index slot and saved back after oapve_rc_update_after_pic, so
  alpha/beta adaptation stays per frame index (0 = primary, 1..N =
  non-primary) instead of drifting across frames of different
  resolutions/characteristics within a multi-frame AU.
- oapve_rc_update_after_pic: total_bits becomes u64. A 16k 10-bit 4:2:2
  frame at high quality can exceed INT_MAX bits, which wrapped negative
  and turned the subsequent log() into NaN, corrupting alpha/beta.

Single-frame-per-AU encoding is behaviorally unchanged (slot 0 mirrors
the previous single rc_param). ctest 16/16 pass.

Signed-off-by: Minsoo Park <mss.park@samsung.com>

@cpncf cpncf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread src/oapv.c Outdated
Signed-off-by: Minsoo Park <mss.park@samsung.com>
@kpchoi
kpchoi merged commit a5312e4 into AcademySoftwareFoundation:main Aug 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants