speccpu/x264: add a new function to disable weight->i_scale mul
This commit is contained in:
@@ -48,6 +48,23 @@ class MCBuilder:
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def with_disabled_iscale_mul(self):
|
||||||
|
"""
|
||||||
|
Disable the i_scale multiplication in the mc_weight function.
|
||||||
|
Find: "src[x] * weight->i_scale", replace it to src[x]
|
||||||
|
|
||||||
|
>>> builder = MCBuilder()
|
||||||
|
>>> 'src[x] * weight->i_scale' in builder.mc_src
|
||||||
|
True
|
||||||
|
>>> builder = builder.with_disabled_iscale_mul()
|
||||||
|
>>> 'src[x] * weight->i_scale' in builder.mc_src
|
||||||
|
False
|
||||||
|
>>> 'src[x]' in builder.mc_src
|
||||||
|
True
|
||||||
|
"""
|
||||||
|
self.mc_src = self.mc_src.replace("src[x] * weight->i_scale", "src[x]")
|
||||||
|
return self
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
return self.mc_src
|
return self.mc_src
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user