Menu

#841 QuickTime field order detection 'wrong'

Incorrect_result
closed-fixed
None
7
2015-01-24
2014-04-07
No

This is related to bug [#822] but hopefully nailing the actual cause of the problem.

Jerome I think you've implemented exactly what Table 4.2 of the QuickTime File Format states regarding the 'fiel' atom, unfortunately that text is contradicted by common practice and by Apple's own Technical Note TN2162, which gives much more detail on how to interpret the 'fiel' atom.

Based on Technical Note TN2162, I offer the re-worded interpretation of 'detail' when fields==2:
detail==1: Fields separate, TFF
detail==6: Fields separate, BFF
detail==9: Fields interleaved, TFF
detail==14: Fields interleaved, BFF

Figure 4 in Technical Note TN2162 is confusing because it has not only Temporal and Spatial orders but also "Address" order, which is the in-memory layout of the coded frame.

Please check out the Technical Note. I believe that it should take priority over the simplified (and wrong) explanation in the QuickTime File Format document (i.e. "9 – B is displayed earliest, T is stored first in the file."). Apple's own FCP will write out a 'fiel' atom with fields=2,detail=9 in the case of TFF interlaced ProRes.

Unfortunately I think your recent attribute "Stored Scan Order" is based on the same literal interpretation of the QuickTime File Format document and is not really meaningful in the intended sense.

Thanks!

Related

Bugs: #822
Discussion: v7.69 vs 7.73 for Mac
Discussion: v7.69 vs 7.73 for Mac

Discussion

  • Jerome Martinez

    Jerome Martinez - 2014-04-07

    After a big headache, you convinced me.
    There was definitely a problem with the Table 4.2 compared to the usage (and I use this table for current implementation, because it was the only source of information), so let's try this method.

    If I understand well, it is like MPEG Video possibilities (stored as it is a frame or stored as to separate fields)

    Is it logical for you if I changed to 2 MediaInfo fields:
    Scan order: detail==1/9 --> "Top field first", detail==6/14 --> "Bottom field first"
    Scan mode (new MediaInfo field): detail==1/6 --> "Separated fields", detail=9/14 --> "Interleaved fields"

    I also plan to add "Segmented frame" as a scan mode possibility for PsF issue, I also plan to add this piece of information for MPEG Video (structure is "frame structure" or 2 fields) and for MXF "Frame Layout" ("Separated fields" wording is taken from MXF / SMPTE ST 377). "Scan mode" wording is taken from PsF ("Progressive scan mode (Sony)" when they speak about how is stored data).

    "Interleaved fields" could also be changed to "Mixed fields" (MXF specs: "MIXED_FIELDS: An interlaced lattice as for SEPARATE_FIELDS above, stored as a single matrix of interleaved lines. The duration of a Sampled Rectangle shall be a Frame").

    Your thoughts?

     
    • Pete Chapman

      Pete Chapman - 2014-04-08

      Is it logical for you if I changed to 2 MediaInfo fields:
      Scan order: detail==1/9 --> "Top field first", detail==6/14 --> "Bottom Field first"
      Scan mode (new MediaInfo field): detail==1/6 --> "Separated fields", detail=9/14 --> "Interleaved fields"

      That makes sense based on my understanding of Technical Note TN2162, and the samples I have for ProRes, DV and MJPEG.

      I also plan to add "Segmented frame" as a scan mode possibility for PsF issue

      Would PsF be better as a "scan order" enum? It seems to relate more to the relative display order of the fields (TFF=top first / BFF=bottom first / Psf=together) than to whether the fields are stored interleaved or separated.

      "Interleaved fields" could also be changed to "Mixed fields"

      I think interleaved is a more specific term, but I don't have a strong opinion on the terminology!

       
      • Jerome Martinez

        Jerome Martinez - 2014-04-08

        Would PsF be better as a "scan order" enum? It seems to relate more to the relative display order of the fields (TFF=top first / BFF=bottom first / Psf=together)

        If I understand well, PsF is an hack for putting Progressive frame in a interlaced stream, so the scan order of the interlaced stream is still present (if Psf stream is present, stream may be TFF or BFF), am I wrong somewhere?
        Hum... After reading again all, PsF seems to be exactly like a an interlaced stream, so it could also be Separated/Interleaved fields, so it does not work. PsF is a special case :(.

        So:
        Scan order: detail==1/9 --> "Top field first", detail==6/14 --> "Bottom field first", and other possibilities "PsF / Top field first" and "PsF / Bottom field first" (meaning that if PsF is not supported, decoder uses TFF or BFF depending of the config)
        Scan storage order (new MediaInfo field): detail==1/6 --> "Separated fields", detail=9/14 --> "Interleaved fields"

        Does it make sense?

        I think interleaved is a more specific term

        Let's go with "Interleaved fields".

         
  • Jerome Martinez

    Jerome Martinez - 2014-04-07
    • status: open --> open-accepted
    • Priority: 5 --> 7
     
  • Jerome Martinez

    Jerome Martinez - 2014-05-16

    in v0.7.69

     
  • Jerome Martinez

    Jerome Martinez - 2014-05-16
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.