Skip to content

Commit b2531e5

Browse files
authored
Codec-Compare version 0.1.8 (#1)
Add CHANGELOG.md
1 parent 31c49e3 commit b2531e5

19 files changed

Lines changed: 213 additions & 103 deletions

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
## v0.1.8
4+
5+
- Add matcher warning display capability.
6+
- Add metric warning display capability.
7+
- Replace the Settings page by a Settings section in the left menu.
8+
- Fix various scroll bars.
9+
- Hide the bits-per-pixel matcher.
10+
- Hide the bits-per-pixel metric.
11+
- Pick two objective quality metrics by default.
12+
- The two plot axis can be set directly.
13+
- Fit the image to the viewport in the visualizer.
14+
15+
## v0.1.2
16+
17+
Initial release of the Codec-Compare static front-end framework.

assets/demo_batch_some_codec_exp.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,35 @@
2525
{ "effort": "Compression effort parameter" },
2626
{ "quality": "Compression quality parameter" },
2727
{
28-
"psnr": "Quality metric Peak Signal-to-Noise Ratio. See https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio"
28+
"psnr": "Quality metric Peak Signal-to-Noise Ratio. See https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio. Warning: There is no scientific consensus on which objective quality metric to use."
2929
},
3030
{
31-
"ssim": "Quality metric Structural Similarity Index Measure. See https://en.wikipedia.org/wiki/Structural_similarity"
31+
"ssim": "Quality metric Structural Similarity Index Measure. See https://en.wikipedia.org/wiki/Structural_similarity. Warning: There is no scientific consensus on which objective quality metric to use."
3232
},
3333
{
34-
"msssim": "Quality metric Multi-Scale Structural Similarity Index Measure. See https://en.wikipedia.org/wiki/Structural_similarity#Multi-Scale_SSIM"
34+
"msssim": "Quality metric Multi-Scale Structural Similarity Index Measure. See https://en.wikipedia.org/wiki/Structural_similarity#Multi-Scale_SSIM. Warning: There is no scientific consensus on which objective quality metric to use."
3535
},
3636
{
37-
"butteraugli": "Quality metric Butteraugli. See https://en.wikipedia.org/wiki/Guetzli#Butteraugli"
37+
"butteraugli": "Quality metric Butteraugli. See https://en.wikipedia.org/wiki/Guetzli#Butteraugli. Warning: There is no scientific consensus on which objective quality metric to use."
3838
},
3939
{
40-
"ciede2000": "Quality metric CIEDE 2000. See https://en.wikipedia.org/wiki/Color_difference#CIEDE2000"
40+
"ciede2000": "Quality metric CIEDE 2000. See https://en.wikipedia.org/wiki/Color_difference#CIEDE2000. Warning: There is no scientific consensus on which objective quality metric to use."
4141
},
42-
{ "encoding_time": "Encoding duration in seconds (approximate)" },
43-
{ "decoding_time": "Decoding duration in seconds (approximate)" },
4442
{
45-
"ssimulacra": "Quality metric SSIMULACRA. See https://github.com/cloudinary/ssimulacra"
43+
"encoding_time": "Encoding duration in seconds. Warning: Timings are environment-dependent and inaccurate."
44+
},
45+
{
46+
"decoding_time": "Decoding duration in seconds. Warning: Timings are environment-dependent and inaccurate."
47+
},
48+
{
49+
"ssimulacra": "Quality metric SSIMULACRA. See https://github.com/cloudinary/ssimulacra. Warning: There is no scientific consensus on which objective quality metric to use."
4650
},
4751
{ "encoded_size": "Size of the encoded image file in bytes" },
4852
{
49-
"lpips": "Learned Perceptual Image Patch Similarity. See https://arxiv.org/abs/1801.03924"
53+
"lpips": "Learned Perceptual Image Patch Similarity. See https://arxiv.org/abs/1801.03924. Warning: There is no scientific consensus on which objective quality metric to use."
5054
},
5155
{
52-
"flip": "Difference evaluator for alternating images. See https://research.nvidia.com/publication/2020-07_lip-difference-evaluator-alternating-images"
56+
"flip": "Difference evaluator for alternating images. See https://research.nvidia.com/publication/2020-07_lip-difference-evaluator-alternating-images. Warning: There is no scientific consensus on which objective quality metric to use."
5357
}
5458
],
5559
"field_values": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codec_compare",
3-
"version": "0.1.2",
3+
"version": "0.1.8",
44
"description": "Codec performance comparison tool",
55
"publisher": "Google LLC",
66
"author": "Yannis Guyon",

readme_preview.png

922 Bytes
Loading

src/codec_compare.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ export class CodecCompare extends LitElement {
110110
<mwc-icon>share</mwc-icon> Copy URL to clipboard
111111
</mwc-button-fit>
112112
113-
<mwc-button-fit @click=${() => {
114-
this.settingsUi.onOpen();
115-
}}>
113+
<mwc-button-fit disabled>
116114
<mwc-icon>settings</mwc-icon> Settings
117115
</mwc-button-fit>
118116
117+
<settings-ui .state=${this.state}></settings-ui>
118+
119119
<mwc-button-fit id="helpButton" @click=${() => {
120120
this.helpUi.onOpen();
121121
}}>
@@ -143,7 +143,7 @@ export class CodecCompare extends LitElement {
143143
</p>
144144
145145
<p id="credits">
146-
Codec Compare beta version 0.1.2<br>
146+
Codec Compare beta version 0.1.8<br>
147147
<a href="https://github.com/webmproject/codec-compare">
148148
Sources on GitHub
149149
</a>
@@ -155,7 +155,6 @@ export class CodecCompare extends LitElement {
155155
<batch-selection-ui .state=${this.state}></batch-selection-ui>
156156
<matches-ui .state=${this.state}></matches-ui>
157157
<match-ui .state=${this.state}></match-ui>
158-
<settings-ui .state=${this.state}></settings-ui>
159158
<help-ui></help-ui>
160159
${this.isLoaded ? html`` : html`<loading-ui></loading-ui>`}
161160
`;
@@ -184,6 +183,8 @@ export class CodecCompare extends LitElement {
184183

185184
private async onAllBatchesLoaded() {
186185
this.state.initialize();
186+
this.urlState.setDefaultValues(this.state);
187+
this.state.initializePostUrlStateDefaultValues();
187188
this.urlState.load(this.state);
188189
this.state.initializePostUrlStateLoad();
189190
listen(EventType.MATCHED_DATA_POINTS_CHANGED, () => {
@@ -259,7 +260,11 @@ export class CodecCompare extends LitElement {
259260
flex-direction: column;
260261
gap: 12px;
261262
padding: 0px 20px 0px 74px;
262-
overflow: auto;
263+
overflow-y: auto;
264+
overflow-x: hidden;
265+
}
266+
batch-selections-ui {
267+
overflow-x: auto;
263268
}
264269
#truncatedResults {
265270
background: orange;

src/entry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ const NAME_TO_FIELD_ID = new Map<string, FieldId>([
108108
* by decreasing preference of which matcher is enabled by default.
109109
*/
110110
export const QUALITY_METRIC_FIELD_IDS = [
111-
FieldId.SSIM, FieldId.MSSSIM, FieldId.PSNR, FieldId.BUTTERAUGLI,
112-
FieldId.SSIMULACRA2, FieldId.SSIMULACRA, FieldId.CIEDE2000, FieldId.FLIP,
111+
FieldId.SSIM, FieldId.SSIMULACRA2, FieldId.MSSSIM, FieldId.PSNR,
112+
FieldId.BUTTERAUGLI, FieldId.SSIMULACRA, FieldId.CIEDE2000, FieldId.FLIP,
113113
FieldId.LPIPS, FieldId.P3NORM
114114
];
115115

116116
function fieldNameToFieldId(name: string): FieldId {
117-
return NAME_TO_FIELD_ID.get(name.toLowerCase().replace('_', ' ')) ??
117+
return NAME_TO_FIELD_ID.get(name.toLowerCase().replaceAll('_', ' ')) ??
118118
FieldId.CUSTOM;
119119
}
120120

@@ -131,7 +131,7 @@ function fieldPrettyName(id: FieldId, name: string): string {
131131
}
132132
}
133133
// Custom properties are displayed too.
134-
return name.replace('_', ' ');
134+
return name.replaceAll('_', ' ');
135135
}
136136

137137
/** Data column in a Batch. For example: source_image, encoding_time etc. */

src/help_ui.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ export class HelpUi extends LitElement {
151151
others against.<br>
152152
The statistics relative to the reference batch for the fields selected
153153
as metrics are displayed in the right-most columns. The aggregation
154-
method can be changed in the Settings page.
154+
method can be changed in the Settings.
155155
</p>
156156
</div>
157157
158158
<div class="descriptionHolder" id="graphDescription">
159159
<p>
160-
The codecs are plotted on this graph as large circles, with the metric
160+
The codecs are plotted on this graph as large disks, with the metric
161161
fields as axes. If any, batches sharing the same codec are linked with
162162
straight lines, usually to represent multiple encoding efforts.<br>
163163
If enabled in the Settings page, each matched pair is displayed as a

src/match_image_ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class MatchImageUi extends LitElement {
8888

8989
static override styles = css`
9090
:host {
91-
overflow: auto;
91+
overflow: hidden;
9292
display: flex;
9393
justify-content: center;
9494
}

src/match_ui.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class MatchUi extends LitElement {
193193
/* Rely on margin:auto for distributing the space. */
194194
justify-content: flex-start;
195195
gap: 20px;
196-
overflow: hidden;
196+
overflow: auto;
197197
}
198198
199199
#closeButton {
@@ -220,5 +220,8 @@ export class MatchUi extends LitElement {
220220
constants-table-ui {
221221
max-width: 50%;
222222
}
223+
match-image-ui {
224+
min-height: 78px; /* 64px + 7px*2 margin as in match_image_ui.ts */
225+
}
223226
`;
224227
}

src/matcher.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ export function createMatchers(batches: Batch[]): FieldMatcher[] {
100100
if (field.id === FieldId.DECODED_IMAGE_NAME) continue;
101101
// Same source image, so these will always match. Remove them from the UI.
102102
if (field.id === FieldId.WIDTH || field.id === FieldId.HEIGHT) continue;
103+
// If bpp values are available, encoded sizes probably are too.
104+
// Skip the former which brings nothing as a matcher over the latter.
105+
if (field.id === FieldId.ENCODED_BITS_PER_PIXEL) continue;
103106

104107
// Try to guess a good default tolerance.
105108
let defaultTolerance = 0;
@@ -140,15 +143,18 @@ export function enableDefaultMatchers(
140143
}
141144

142145
// Find any quality metric suggesting that it is not a lossless comparison and
143-
// use it as a match criterion.
146+
// use it as a match criterion. To be somewhat fairer, pick the first two in
147+
// the QUALITY_METRIC_FIELD_IDS order, at the expense of fewer data points.
148+
let numQualityMetrics = 0;
144149
for (const id of QUALITY_METRIC_FIELD_IDS) {
145150
const qualityMatcher = matchers.find(
146151
(matcher) => firstBatch.fields[matcher.fieldIndices[0]].id === id);
147152
if (qualityMatcher !== undefined) {
148153
const qualityField = firstBatch.fields[qualityMatcher.fieldIndices[0]];
149154
if (qualityField.isNumber && qualityField.uniqueValuesArray.length > 1) {
150155
qualityMatcher.enabled = true;
151-
break;
156+
++numQualityMetrics;
157+
if (numQualityMetrics === 2) break;
152158
}
153159
}
154160
}

0 commit comments

Comments
 (0)