MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / format_solo_result

Function format_solo_result

Test/astc_test_image.py:121–148  ·  view source on GitHub ↗

Format a metrics string for a single (no compare) result. Args: image: The image being tested. result: The test result. Return: The metrics report.

(image: TestImage, result: Record)

Source from the content-addressed store, hash-verified

119
120
121def format_solo_result(image: TestImage, result: Record) -> str:
122 '''
123 Format a metrics string for a single (no compare) result.
124
125 Args:
126 image: The image being tested.
127 result: The test result.
128
129 Return:
130 The metrics report.
131 '''
132 del image # Unused
133
134 name = f'{result.block_size:>5} {result.name}'
135 psnr = f'{result.psnr:2.3f} dB'
136 total_time = f'{result.total_time:.3f} s'
137 coding_time = f'{result.coding_time:.3f} s'
138 coding_rate = f'{result.coding_rate:.3f} MT/s'
139
140 fields = (
141 f'{name:<32}',
142 f'{psnr:>11}',
143 f'{total_time:>9}',
144 f'{coding_time:>9}',
145 f'{coding_rate:>11}',
146 )
147
148 return ' | '.join(fields)
149
150
151def format_compare_result(image: TestImage, reference: Record,

Callers 1

run_test_imageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected