Skip to content

Commit 55f2a75

Browse files
authored
Codec-Compare version 0.2.6 (#16)
1 parent f923be3 commit 55f2a75

5 files changed

Lines changed: 24 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Changelog
22

3+
## v0.2.6
4+
5+
- Fix cross-batch source asset filtering by tag.
6+
37
## v0.2.5
48

59
- Add support for cross-batch individual source asset filtering.
6-
- Add support for cross-batch batch source asset filtering by tag.
10+
- Add support for cross-batch source asset filtering by tag.
711
- Add button to set the batch as the reference batch in the batch info panel.
812
- Add link to view only two batches in the batch info panel.
913

assets/demo_batch_other_codec_settingA.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{ "codec": "Name of the codec used to generate this data" },
55
{ "version": "Version of the codec used to generate this data" },
66
{ "time": "Timestamp of when this data was generated" },
7+
{ "source_data_set": "The origin of the images used as input" },
8+
{ "source_tags": "Input image tags" },
79
{ "original_path": "The path to the original image" },
810
{ "encoded_path": "The path to the encoded image" },
911
{ "decoded_path": "The path to the decoded image" },
@@ -15,6 +17,8 @@
1517
"other_codec",
1618
"0.1.2",
1719
"2023-05-16T16:15:24.174529673Z",
20+
"https://testimages.org/sampling/",
21+
"fruits=d040000018&with text=0d88068002",
1822
"/rainbow.png",
1923
"/rainbow_q50.webp",
2024
"/rainbow_q50.webp",

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.2.5",
3+
"version": "0.2.6",
44
"description": "Codec performance comparison tool",
55
"publisher": "Google LLC",
66
"author": "Yannis Guyon",

src/codec_compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class CodecCompare extends LitElement {
208208
</p>
209209
210210
<p id="credits">
211-
Codec Compare beta version 0.2.5<br>
211+
Codec Compare beta version 0.2.6<br>
212212
<a href="https://github.com/webmproject/codec-compare">
213213
Sources on GitHub
214214
</a>

src/common_field.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export function createCommonFields(batches: Batch[]): CommonField[] {
101101

102102
function sourceTagsFromBatchesAndAssetNames(
103103
batches: Batch[], assetNames: string[]): Map<string, Set<string>> {
104-
const sourceTags = new Map<string, Set<string>>();
104+
const tagToAssetNames = new Map<string, Set<string>>();
105+
const tagToBitmask = new Map<string, string>();
105106

106107
for (const batch of batches) {
107108
const constant =
@@ -117,24 +118,22 @@ function sourceTagsFromBatchesAndAssetNames(
117118
const tag = tagAndBitmaskSplit[0];
118119
const bitmask = tagAndBitmaskSplit[1];
119120

120-
const taggedAssetNames = new Set<string>();
121-
if (!applyBitmaskToStringArray(assetNames, bitmask, taggedAssetNames)) {
122-
// Mismatch between the asset names and a bitmask.
123-
return new Map<string, Set<string>>();
124-
}
125-
126-
const oldTaggedAssetNames = sourceTags.get(tag);
127-
if (oldTaggedAssetNames !== undefined) {
128-
if (oldTaggedAssetNames !== taggedAssetNames) {
129-
// Mismatch between batches about the meaning of a tag.
121+
const otherBitmask = tagToBitmask.get(tag);
122+
if (otherBitmask === undefined) {
123+
const taggedAssetNames = new Set<string>();
124+
if (!applyBitmaskToStringArray(assetNames, bitmask, taggedAssetNames)) {
125+
// Mismatch between the asset names and a bitmask.
130126
return new Map<string, Set<string>>();
131127
}
132-
} else {
133-
sourceTags.set(tag, taggedAssetNames);
128+
tagToAssetNames.set(tag, taggedAssetNames);
129+
tagToBitmask.set(tag, bitmask);
130+
} else if (otherBitmask !== bitmask) {
131+
// Mismatch between batches about the meaning of a tag.
132+
return new Map<string, Set<string>>();
134133
}
135134
}
136135
}
137-
return sourceTags;
136+
return tagToAssetNames;
138137
}
139138

140139
/**

0 commit comments

Comments
 (0)