You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(*): eliminate flickering in interpolated output and improve color consistency with input
Add a virtual `Interpolator::normalize()` method that runs pass-through frames
through the same pixel-format round-trip as interpolated frames, eliminating
temporal colour inconsistencies and flickering in alternating frames (assuming 2x interpolation).
Refactor `in_time_base_`, `out_time_base_`, and `out_pix_fmt_` from
`InterpolatorRIFE` private members into `Interpolator` protected members to avoid
duplication in future derived classes.
Capture authoritative color properties (color_space, color_range, color_primaries,
color_trc) from the decoder context once during `init()` and store them in the
`Processor` base class. Introduce `make_color_hint()`, which creates a metadata-only
`AVFrame` carrying these properties and forwards it to `avframe_to_ncnn_mat()` and
`ncnn_mat_to_avframe()`, ensuring `sws_scale` always uses a consistent colour matrix
instead of falling back to BT.601 defaults whenever a frame carries
`AVCOL_SPC_UNSPECIFIED`.
Additional changes in `src/conversions.cpp`:
- Add `avcol_spc_to_sws_cs()` to map `AVColorSpace` to SWS colorspace constants
with a BT.601 fallback and a thread-safe one-shot warning via `std::once_flag`.
- Replace hardcoded `SWS_BILINEAR` with `static constexpr int SWS_FILTER = SWS_BICUBIC`.
- Extract `apply_sws_colorspace()` helper to deduplicate the two
`sws_setColorspaceDetails` call sites; failures emit a one-time `warn` on the
first occurrence followed by `debug` logs with a running count thereafter.
- Validate the return value of `sws_scale()` against `dst_frame->height` before
returning.
Register `src/interpolator.cpp` in `CMakeLists.txt`.
0 commit comments