This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 26586c898fadd410989fa52f591dce3055e08e53 Author: Lynne <[email protected]> AuthorDate: Fri Jul 17 14:18:41 2026 +0800 Commit: Lynne <[email protected]> CommitDate: Sun Jul 19 20:41:48 2026 +0800 avcodec/psymodel: add pair-synced window switching hook and pair state Divergent block switching between the two channels of a CPE disables common_window, and with it every joint stereo tool, on exactly the frames that need them most; the lone short channel then codes its transient alone, which is audible as one-channel garble at beats. Add an optional window_pair() model hook so a psy model can decide both channels of a pair together, and encoder-fed per-pair state: the joint-tool candidacy fraction EMA and a Schmitt-gated decouple flag, letting the model fall back to independent per-channel switching on content whose joint tools are dead (diffuse, decorrelated pairs) where forcing a common grid only costs quality. --- libavcodec/psymodel.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavcodec/psymodel.h b/libavcodec/psymodel.h index 9dbce89780..302d25e1a2 100644 --- a/libavcodec/psymodel.h +++ b/libavcodec/psymodel.h @@ -106,6 +106,8 @@ typedef struct FFPsyContext { } bitres; void* model_priv_data; ///< psychoacoustic model implementation private data + float pair_joint[16]; ///< encoder-fed per-CPE joint-tool candidacy fraction EMA (bands M/S would adopt or I/S renders; ~0 = joint tools dead); 0 = unseeded + uint8_t pair_decoupled[16]; ///< Schmitt state over pair_joint: 1 = joint tools dead on this pair, joint windowing/M-S coupling suspended } FFPsyContext; /** @@ -128,6 +130,17 @@ typedef struct FFPsyModel { */ FFPsyWindowInfo (*window)(FFPsyContext *ctx, const float *audio, const float *la, int channel, int prev_type); + /** + * Suggest window sequences for both channels of a CPE with block switching + * synchronized across the pair (either channel's attack switches both), so + * common_window and the joint stereo tools stay available. Optional; when + * NULL the encoder decides each channel independently via window(). + */ + void (*window_pair)(FFPsyContext *ctx, const float *audio0, const float *la0, + const float *audio1, const float *la1, + int channel0, int channel1, + int prev_type0, int prev_type1, FFPsyWindowInfo wi[2]); + /** * Perform psychoacoustic analysis and set band info (threshold, energy) for a group of channels. * _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
