Skip to content

MCSTF optimization - #923

Merged
kirithika7 merged 23 commits into
Multicorewareinc:masterfrom
GUNASRIJ11:MCSTF-Optimization-updated
Jul 28, 2026
Merged

MCSTF optimization#923
kirithika7 merged 23 commits into
Multicorewareinc:masterfrom
GUNASRIJ11:MCSTF-Optimization-updated

Conversation

@GUNASRIJ11

Copy link
Copy Markdown
Contributor

Summary

Adds multi-threaded execution and AVX2 SIMD kernels to Motion-Compensated Spatio-Temporal Filtering (MCSTF), decouples it from the badapt (B-adaptive) flow so it can run independently, and adds a noise-based selective mode plus test bench coverage.

Key changes

Multi-threading

  • Implemented multithreaded motion estimation for MCSTF to process ME rows in parallel.
  • Implemented a multi-threaded workflow for bilateralFilter
  • Added CLI --mcstf-ref-range to control param->mcstfFrameRange

AVX2 SIMD kernels

  • motionErrorLumaFrac (2.81x) , applyMotion (4.44x) , computeBlockStats (4.19x) and bilateralFilter (1.38x)

Algorithm/pipeline changes

  • Generate lowres planes using HM-equivalent averaging
  • Pruned unused computations in the MCSTF path
  • Decoupled MCSTF's HME (hierarchical motion estimation) from the b-adapt flow so MCSTF no longer depends on B-adaptive lookahead state

Selective MCSTF (noise-based)

  • Added --selective-mcstf CLI option to enable noise-based MCSTF filtering — skips filtering on frames whose estimated noise is low, saving cycles.

Testing

  • Added test bench support for MCSTF
  • Enabled profiling stats for MCSTF

@kirithika7
kirithika7 force-pushed the MCSTF-Optimization-updated branch 4 times, most recently from 6b26de1 to 40a49a2 Compare July 24, 2026 12:51
Logaprakash-mcw and others added 19 commits July 28, 2026 15:01
The m_useSADinME conditionals are no longer required because m_useSADinME is always set to 0, causing the SSD-based motion error path to be selected unconditionally. Remove the unused SAD branches and invoke the SSD path directly. Also remove the unused average/variance computation and the associated leastError adjustment, as they do not affect motion vector selection or the final encoding result.
Generate low-resolution planes using the HM averaging method only when MCSTF is enabled. Otherwise, preserve the existing low-res pipeline.
This commit fixes segfault that occurs due to inadequate frames in
lookahead(zerolatency / ultrafast case)
This commit reuses the existing variance computation and remove redundant
Allocate/Free up gradMag buffer once per encode
@Logaprakash-mcw
Logaprakash-mcw force-pushed the MCSTF-Optimization-updated branch from 40a49a2 to c824ad9 Compare July 28, 2026 09:44
@kirithika7
kirithika7 force-pushed the MCSTF-Optimization-updated branch from 1d9efd2 to e88d474 Compare July 28, 2026 12:08
@kirithika7
kirithika7 merged commit 032c373 into Multicorewareinc:master Jul 28, 2026
15 of 17 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