GRD

class randd.model.GRD(r, d, d_measure='psnr', ndim=1)

Base rate-distortion function estimator.

Any generalized rate-distortion function model should be its subclass. The inherited class should provide the implementation of __init__() and __call__().

__init__() takes the RD samples, and produces a continuous RD function at each encoding attribute other than bitrate. The function at each encoding attribute is represented by a dictionary self.f.

__call__() employs self.f to predict the distortion level at the given r.

Parameters
  • r (NDArray) – Encoding representations.

  • d (NDArray) – Corresponding distortions.

  • d_measure (str) – Name of the distortion measure. Defaults to psnr.

  • ndim (int) – Number of dimensions of the RD function domain. Defaults to 1.

__call__(r)

Call self as a function.

Return type

ndarray[Any, dtype[TypeVar(ScalarType, bound= generic, covariant=True)]]