Skip to content

quantize::quadtree::QuadtreeEncoder

More...

Public Functions

Name
init(self self, Dict] thresholds[int, Dict[str, float], float ternary_delta, Callable fit_fp4, Callable fit_t158, laplacian laplacian, int min_block_size =4)
List[dict] encode(self self, np.ndarray superblock_64x64)

Protected Functions

Name
List[dict] _try_block(self self, np.ndarray superblock, int y, int x, int size, bool parent_accepted, int depth =0)
float _combined_gate_error(np.ndarray region, float selected_error, float max_mse, max_relative max_relative)
np.ndarray _reconstruct(np.ndarray region, dict result, CodeMode mode =CodeMode.FP4_AFFINE)
bool _t158_has_outlier(np.ndarray region, dict t158_result)

Protected Attributes

Name
_thresholds
_ternary_delta
_fit_fp4
_fit_t158
_laplacian
_min_block_size

Detailed Description

class quantize::quadtree::QuadtreeEncoder;
Encode one 64x64 macroblock into adaptive square leaves.```

## Public Functions Documentation

### function __init__

```python
__init__(
    self self,
    Dict] thresholds[int, Dict[str, float],
    float ternary_delta,
    Callable fit_fp4,
    Callable fit_t158,
    laplacian laplacian,
    int min_block_size =4
)

function encode

List[dict] encode(
    self self,
    np.ndarray superblock_64x64
)
Return a deterministic, complete leaf cover for a 64x64 macroblock.```


## Protected Functions Documentation

### function _try_block

```python
List[dict] _try_block(
    self self,
    np.ndarray superblock,
    int y,
    int x,
    int size,
    bool parent_accepted,
    int depth =0
)
Recursively accept or split one square region.```


### function _combined_gate_error

```python
static float _combined_gate_error(
    np.ndarray region,
    float selected_error,
    float max_mse,
    max_relative max_relative
)
Apply both absolute and relative gates on one comparable scale.```


### function _reconstruct

```python
static np.ndarray _reconstruct(
    np.ndarray region,
    dict result,
    CodeMode mode =CodeMode.FP4_AFFINE
)
Reconstruct a candidate using its own normative codebook.```


### function _t158_has_outlier

```python
static bool _t158_has_outlier(
    np.ndarray region,
    dict t158_result
)
Return true when ternary reconstruction violates the outlier veto.```


## Protected Attributes Documentation

### variable _thresholds

```python
_thresholds;

variable _ternary_delta

_ternary_delta;

variable _fit_fp4

_fit_fp4;

variable _fit_t158

_fit_t158;

variable _laplacian

_laplacian;

variable _min_block_size

_min_block_size;

Updated on 2026-10-09 at 03:59:43 +0000