Skip to content

Commit

Permalink
Codec-Compare version 0.2.6 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-guyon authored Oct 31, 2024
1 parent f923be3 commit 55f2a75
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Changelog

## v0.2.6

- Fix cross-batch source asset filtering by tag.

## v0.2.5

- Add support for cross-batch individual source asset filtering.
- Add support for cross-batch batch source asset filtering by tag.
- Add support for cross-batch source asset filtering by tag.
- Add button to set the batch as the reference batch in the batch info panel.
- Add link to view only two batches in the batch info panel.

Expand Down
4 changes: 4 additions & 0 deletions assets/demo_batch_other_codec_settingA.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
{ "codec": "Name of the codec used to generate this data" },
{ "version": "Version of the codec used to generate this data" },
{ "time": "Timestamp of when this data was generated" },
{ "source_data_set": "The origin of the images used as input" },
{ "source_tags": "Input image tags" },
{ "original_path": "The path to the original image" },
{ "encoded_path": "The path to the encoded image" },
{ "decoded_path": "The path to the decoded image" },
Expand All @@ -15,6 +17,8 @@
"other_codec",
"0.1.2",
"2023-05-16T16:15:24.174529673Z",
"https://testimages.org/sampling/",
"fruits=d040000018&with text=0d88068002",
"/rainbow.png",
"/rainbow_q50.webp",
"/rainbow_q50.webp",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codec_compare",
"version": "0.2.5",
"version": "0.2.6",
"description": "Codec performance comparison tool",
"publisher": "Google LLC",
"author": "Yannis Guyon",
Expand Down
2 changes: 1 addition & 1 deletion src/codec_compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class CodecCompare extends LitElement {
</p>
<p id="credits">
Codec Compare beta version 0.2.5<br>
Codec Compare beta version 0.2.6<br>
<a href="https://github.com/webmproject/codec-compare">
Sources on GitHub
</a>
Expand Down
27 changes: 13 additions & 14 deletions src/common_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export function createCommonFields(batches: Batch[]): CommonField[] {

function sourceTagsFromBatchesAndAssetNames(
batches: Batch[], assetNames: string[]): Map<string, Set<string>> {
const sourceTags = new Map<string, Set<string>>();
const tagToAssetNames = new Map<string, Set<string>>();
const tagToBitmask = new Map<string, string>();

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

const taggedAssetNames = new Set<string>();
if (!applyBitmaskToStringArray(assetNames, bitmask, taggedAssetNames)) {
// Mismatch between the asset names and a bitmask.
return new Map<string, Set<string>>();
}

const oldTaggedAssetNames = sourceTags.get(tag);
if (oldTaggedAssetNames !== undefined) {
if (oldTaggedAssetNames !== taggedAssetNames) {
// Mismatch between batches about the meaning of a tag.
const otherBitmask = tagToBitmask.get(tag);
if (otherBitmask === undefined) {
const taggedAssetNames = new Set<string>();
if (!applyBitmaskToStringArray(assetNames, bitmask, taggedAssetNames)) {
// Mismatch between the asset names and a bitmask.
return new Map<string, Set<string>>();
}
} else {
sourceTags.set(tag, taggedAssetNames);
tagToAssetNames.set(tag, taggedAssetNames);
tagToBitmask.set(tag, bitmask);
} else if (otherBitmask !== bitmask) {
// Mismatch between batches about the meaning of a tag.
return new Map<string, Set<string>>();
}
}
}
return sourceTags;
return tagToAssetNames;
}

/**
Expand Down

0 comments on commit 55f2a75

Please sign in to comment.