gpac / ComplianceWarden

A pluggable compliance checker (ISOBMFF, HEIF/MIAF/AVIF, AV1 HDR10+)
https://gpac.github.io/ComplianceWarden-wasm/
Other
16 stars 7 forks source link

ComplianceWarden does not correctly interpret this file #34

Closed leo-barnes closed 2 years ago

leo-barnes commented 2 years ago

See https://github.com/AOMediaCodec/av1-avif/pull/175

The animals_00_multilayer_grid_lsel.avif file is outputting errors that seem to indicate that the ComplianceWarden is misinterpreting the structure of the file.

[miaf][Rule #5] Error: construction_method=1 on a coded image item

This is the contents of the iinf and iloc:

  ('iinf' "Item Information Box", size = 224) {
    Version: 0, Flags: 0x000000
    Entry count: 10
      ('infe' "Item Info Entry", (condensed)) {
        Item ID: 1-2
        Item protection index: 0
        Item type: 'grid'
      }
      ('infe' "Item Info Entry", (condensed)) {
        Item ID: 3-10 (Hidden)
        Item protection index: 0
        Item type: 'av01'
      }
  }
...
  ('iloc' "Item Location Box", size = 240) {
    Version: 1, Flags: 0x000000
    Offset size: 4
    Length size: 4
    Base offset size: 0
    Index size: 0
    Item count: 10
      Item ID: 1
        Construction method: 1, Data reference index: 0
        Extent 1/1: Offset 0, Length 8
      Item ID: 2
        Construction method: 1, Data reference index: 0
        Extent 1/1: Offset 8, Length 8
      Item ID: 3
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 914, Length 22374
        Extent 2/2: Offset 577666, Length 422411
      Item ID: 4
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 23288, Length 151066
        Extent 2/2: Offset 1000077, Length 314112
      Item ID: 5
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 174354, Length 183418
        Extent 2/2: Offset 1314189, Length 482385
      Item ID: 6
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 357772, Length 219894
        Extent 2/2: Offset 1796574, Length 510504
      Item ID: 7
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 914, Length 22374
        Extent 2/2: Offset 577666, Length 422411
      Item ID: 8
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 23288, Length 151066
        Extent 2/2: Offset 1000077, Length 314112
      Item ID: 9
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 174354, Length 183418
        Extent 2/2: Offset 1314189, Length 482385
      Item ID: 10
        Construction method: 0, Data reference index: 0
        Extent 1/2: Offset 357772, Length 219894
        Extent 2/2: Offset 1796574, Length 510504
  }

This looks correct to me.

[heif][Rule #5] Error: Tile [itemId=1]: the value of reference_count(4) shall be equal to rows(1)*columns(0)=29
[heif][Rule #5] Error: Tile [itemId=2]: the value of reference_count(4) shall be equal to rows(106)*columns(0)=103
[heif][Rule #8] Error: grid (itemID=1) height(3) not covered by tile (ItemId=31088) height(768)*numRows(1)=768
[heif][Rule #8] Error: grid (itemID=1) height(4) not covered by tile (ItemId=31088) height(768)*numRows(1)=768
[heif][Rule #8] Error: grid (itemID=1) height(5) not covered by tile (ItemId=31088) height(768)*numRows(1)=768
[heif][Rule #8] Error: grid (itemID=1) height(6) not covered by tile (ItemId=31088) height(768)*numRows(1)=768
[heif][Rule #19] Error: 'grid' version shall be equal to 0, found 97 (itemId=2)
[heif][Rule #32] Error: 'mif1' brand: this file shall conform to HEIF section 6, check the other errors for details

These errors make no sense. It looks like ComplianceWarden is not interpreting the idat contents correctly. The contents of the idat is:

0000 0101 0800 0600
0000 0101 0400 0300

Which corresponds to:

  ('idat' "Item Data Box", size = 24) {
    Version: 0, Flags: 0
    Grid size: 2x2
    Output canvas size: 2048x1536

    Version: 0, Flags: 0
    Grid size: 2x2
    Output canvas size: 1024x768
  }

Which does not match the errors I get from ComplianceWarden.

rbouqueau commented 2 years ago

Thanks for the detailed report. That's because construction_method=1 support is incomplete. I'm on it but it has side effects which forces to modify many tests.

rbouqueau commented 2 years ago

Should be fixed. Could you retry on the command-line (wasm not updated)?

leo-barnes commented 2 years ago

Thanks, that seems to have solved it!