vc2-bundle

Create, or query a compressed bundle containing a set of static filter analyses (from vc2-static-filter-analysis) and optimised synthesis test patterns (from vc2-optimise-synthesis-test-patterns).

Example usage

Creating a bundle

$ # Create some files
$ vc2-static-filter-analysis \
    --wavelet-index le_gall_5_3 \
    --dwt-depth 2 \
    --output static_analysis.json
$ vc2-maximum-quantisation-index \
    static_analysis.json \
    --picture-bit-width 10 \
    --custom-quantisation-matrix \
        0 LL 1 \
        1 HL 2   1 LH 0   1 HH 4 \
        2 HL 1   2 LH 3   2 HH 3 \
    --output optimised_patterns.json

$ # Bundle the files together
$ vc2-bundle \
    create \
    bundle.zip \
    static_analysis.json \
    optimised_patterns.json \
    # ...

Listing bundle contents

$ vc2-bundle list bundle.zip
Static filter analyses
======================

0.
    * wavelet_index: le_gall_5_3
    * wavelet_index_ho: le_gall_5_3
    * dwt_depth: 2
    * dwt_depth_ho: 0

Optimised synthesis test patterns
=================================

0.
    * wavelet_index: le_gall_5_3
    * wavelet_index_ho: le_gall_5_3
    * dwt_depth: 2
    * dwt_depth_ho: 0
    * picture_bit_width: 10
    * custom_quantisation_matrix:
      {
          0: {'LL': 1},
          1: {'HL': 2, 'LH': 0, 'HH' 4},
          2: {'HL': 1, 'LH': 3, 'HH' 3},
      }

Extracting files from a bundle

$ # Extract a static analysis file from the bundle
$ vc2-bundle \
    extract-static-filter-analysis \
    bundle.zip \
    extracted.json \
    --wavelet-index le_gall_5_3 \
    --dwt-depth 2

$ # Extract a set of optimised synthesis test patterns from the bundle
$ vc2-bundle \
    extract-optimised-synthesis-test-pattern \
    bundle.zip \
    extracted.json \
    --wavelet-index le_gall_5_3 \
    --dwt-depth 2
    --picture-bit-width 10 \
    --custom-quantisation-matrix \
        0 LL 1 \
        1 HL 2   1 LH 0   1 HH 4 \
        2 HL 1   2 LH 3   2 HH 3 \

Arguments

The complete set of arguments can be listed using --help for each subcommand.

usage: vc2-bundle [-h] [--verbose]
                  {create,list,extract-static-filter-analysis,extract-optimised-synthesis-test-patterns}
                  ...

Create, or query a compressed bundle containing a set of static filter
analyses (from vc2-static-filter-analysis) and optimised synthesis test
patterns (from vc2-optimise-synthesis-test-patterns).

positional arguments:
  {create,list,extract-static-filter-analysis,extract-optimised-synthesis-test-patterns}
    create              Create a bundle file.
    list                List the contents of a bundle file.
    extract-static-filter-analysis
                        Extract a static filter analysis from the bundle.
    extract-optimised-synthesis-test-patterns
                        Extract a set of optimised synthesis test patterns
                        from the bundle.

optional arguments:
  -h, --help            show this help message and exit
  --verbose, -v         Show more detailed status information during
                        execution.
usage: vc2-bundle create [-h]
                         [--static-filter-analysis JSON_FILE [JSON_FILE ...]]
                         [--optimised-synthesis-test-patterns JSON_FILE [JSON_FILE ...]]
                         bundle_file

positional arguments:
  bundle_file           Filename for the bundle file to create/overwrite.

optional arguments:
  -h, --help            show this help message and exit
  --static-filter-analysis JSON_FILE [JSON_FILE ...], -s JSON_FILE [JSON_FILE ...]
                        Filenames of the JSON files containing static filter
                        analyses produced by vc2-static-filter-analysis.
  --optimised-synthesis-test-patterns JSON_FILE [JSON_FILE ...], -o JSON_FILE [JSON_FILE ...]
                        Filenames of the JSON files containing optimised
                        synthesis test patterns produced by vc2-optimise-
                        synthesis-test-patterns.
usage: vc2-bundle list [-h] bundle_file

positional arguments:
  bundle_file  Filename for the bundle file to list.

optional arguments:
  -h, --help   show this help message and exit
usage: vc2-bundle extract-static-filter-analysis [-h] [--output OUTPUT]
                                                 --wavelet-index WAVELET_INDEX
                                                 [--wavelet-index-ho WAVELET_INDEX_HO]
                                                 [--dwt-depth DWT_DEPTH]
                                                 [--dwt-depth-ho DWT_DEPTH_HO]
                                                 bundle_file

positional arguments:
  bundle_file           Filename for the bundle file to query.

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Filename for the extracted JSON file. Defaults to
                        stdout.
  --wavelet-index WAVELET_INDEX, -w WAVELET_INDEX
                        The VC-2 wavelet index for the wavelet transform. One
                        of: 0 or deslauriers_dubuc_9_7, 1 or le_gall_5_3, 2 or
                        deslauriers_dubuc_13_7, 3 or haar_no_shift, 4 or
                        haar_with_shift, 5 or fidelity, 6 or daubechies_9_7.
  --wavelet-index-ho WAVELET_INDEX_HO, -W WAVELET_INDEX_HO
                        The VC-2 wavelet index for the horizontal parts of the
                        wavelet transform. If not specified, assumed to be the
                        same as --wavelet-index/-w.
  --dwt-depth DWT_DEPTH, -d DWT_DEPTH
                        The VC-2 transform depth. Defaults to 0 if not
                        specified.
  --dwt-depth-ho DWT_DEPTH_HO, -D DWT_DEPTH_HO
                        The VC-2 horizontal-only transform depth. Defaults to
                        0 if not specified.
usage: vc2-bundle extract-optimised-synthesis-test-patterns
       [-h] [--output OUTPUT] --wavelet-index WAVELET_INDEX
       [--wavelet-index-ho WAVELET_INDEX_HO] [--dwt-depth DWT_DEPTH]
       [--dwt-depth-ho DWT_DEPTH_HO] --picture-bit-width PICTURE_BIT_WIDTH
       [--custom-quantisation-matrix CUSTOM_QUANTISATION_MATRIX [CUSTOM_QUANTISATION_MATRIX ...]]
       bundle_file

positional arguments:
  bundle_file           Filename for the bundle file to query.

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Filename for the extracted JSON file. Defaults to
                        stdout.
  --wavelet-index WAVELET_INDEX, -w WAVELET_INDEX
                        The VC-2 wavelet index for the wavelet transform. One
                        of: 0 or deslauriers_dubuc_9_7, 1 or le_gall_5_3, 2 or
                        deslauriers_dubuc_13_7, 3 or haar_no_shift, 4 or
                        haar_with_shift, 5 or fidelity, 6 or daubechies_9_7.
  --wavelet-index-ho WAVELET_INDEX_HO, -W WAVELET_INDEX_HO
                        The VC-2 wavelet index for the horizontal parts of the
                        wavelet transform. If not specified, assumed to be the
                        same as --wavelet-index/-w.
  --dwt-depth DWT_DEPTH, -d DWT_DEPTH
                        The VC-2 transform depth. Defaults to 0 if not
                        specified.
  --dwt-depth-ho DWT_DEPTH_HO, -D DWT_DEPTH_HO
                        The VC-2 horizontal-only transform depth. Defaults to
                        0 if not specified.
  --picture-bit-width PICTURE_BIT_WIDTH, -b PICTURE_BIT_WIDTH
                        The number of bits in the picture signal.
  --custom-quantisation-matrix CUSTOM_QUANTISATION_MATRIX [CUSTOM_QUANTISATION_MATRIX ...], -q CUSTOM_QUANTISATION_MATRIX [CUSTOM_QUANTISATION_MATRIX ...]
                        Use a custom quantisation matrix for the search.
                        Optional except for filters without a default
                        quantisation matrix defined. Should be specified as a
                        series 3-argument tuples giving the level, orientation
                        and quantisation matrix value for every entry in the
                        quantisation matrix.