Rule. Do not directly invoke unoptimized C fallback (*_c) RTCD or DSP functions in production code or architecture-specific wrapper implementations:
Why. In libaom, RTCD (Run-Time CPU Detection) dynamically selects optimized SIMD implementations at runtime. Directly calling *_c functions in production code bypasses CPU detection and forces unoptimized C execution. Similarly, invoking *_c routines inside architecture-specific SIMD wrappers silently defeats SIMD acceleration and degrades codec performance.
Bad:
// In general codec code: directly calling _c bypasses RTCD aom_lpf_horizontal_14_dual_c(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, lfin->mblim, lfin->lim, lfin->hev_thr); // In architecture wrappers: calling _c defeats SIMD acceleration void aom_lpf_vertical_6_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1) { aom_lpf_vertical_6_c(s, pitch, blimit0, limit0, thresh0); aom_lpf_vertical_6_c(s + 4 * pitch, pitch, blimit1, limit1, thresh1); }
Good:
// In general codec code: use base RTCD dispatch symbol aom_lpf_horizontal_14_dual(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, lfin->mblim, lfin->lim, lfin->hev_thr); // In architecture wrappers: invoke matching architecture SIMD kernels void aom_lpf_vertical_6_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1) { aom_lpf_vertical_6_neon(s, pitch, blimit0, limit0, thresh0); aom_lpf_vertical_6_neon(s + 4 * pitch, pitch, blimit1, limit1, thresh1); }