This testbench was tested with GNU Octave v4.2.1

The main entry is qmat_test, which compares scaling_list_data bit counts with different encoding methods:
- HEVC with HEVC test set
- JVET-N0847 (same as VVC draft 6), JVET-O0223, and current proposal with VVC test set

Test execution can take several minutes.
For JVET-O0223 and related, unused high-frequency coefficients of size-64 QMs may be optimized, which is indicated in the report by [+x*] symbols (+: INTRA, x:INTER, *:both). When a tolerance is specified, average error is also reported.

To enable direct comparison between HEVC and VVC, the VVC test set is automatically generated from the HEVC one present in testset-hevc folder. VVC matrices are derived by extending HEVC ones using qmat_test_extend (see also make_testset_hevc2vvc).

Custom test matrices can be added to testset-hevc folder, and referred to in the "testset" variable of qmat_test.m.
VVC test set should then be regenerated by calling make_testset_hevc2vvc.
If adding custom matrices directly in VVC format in testset-vvc folder, then corresponding HEVC matrices should be generated by calling make_testset_vvc2hevc (drops size-2 and size-16 QMs then squeezes the result).

Note: make_testset_vvc("hard"), not used by default, generates an harder-to-code VVC test set by making an average of size-8 and size-32 QM for size-16 instead of copies of size-32, so that all matrices are potentially different.


Other features can be adjusted in qmat_test.m:
- 'verbose' enables bit count report for each QM of each test
- 'check_decode' enables actual encode/decode instead of just bit count, and verifies match (reported by [OK] or [failed])
- 'use_default' enables use of default QMs as predictors (see qmat_default.m for definition, which can be customized)
- 'TOL' can be used to repeat the test with different error tolerance values, and observe the impact on bit count

Digging further and executing separately qmat_compress_xxx with a single entry in "testset" provides more details about QM encoding, like how they are modified by error tolerance, and what references, coefficients numbers, scales, were chosen for each QM.

---
Copyright (c) 2019-Present InterDigital R&D France. All rights reserved.
This project is made available under the Clear BSD license found in the LICENSE.md file in the root directory of this package.

