add an API to reset cached variables so CTU size can be changed

Issue #110 closed
Steve Borho created an issue

libx265 caches the CTU size and pre-calculates several variables structures based on that size. This prevents an encode within the same process from using a different CTU size. This is especially problematic for tools like Handbrake that want to perform multiple encodes in series and do not want to limit the presets available.

Currently they are patching x265 to work around this behavior but it has proved to be fragile. We need to provide an API to reset these structures so that the next encoder created has no limits, this includes the global variables and tables in constants.cpp and class statics like those in CUData

Comments (1)

  1. Deepthi Nandakumar

    api: allow x265_cleanup() to reset the configured CTU size (closes #110)

    x265_cleanup() is intended to be called after all encoders are closed, so it is safe to 'forget' the global CTU configuration.

    → <<cset 5859f8ef1c23>>

  2. Log in to comment