Subject: [Cellar] Display area clarification question

From: Tobias Rapp <[email-masked]>
Date: Fri, 26 Feb 2016 12:27:54 +0100

Hello,

when archiving SD material lines of the vertical blanking interval (VBI) 
are sometimes stored at the top of the frame. For PAL the typical stored 
size is 608x720 pixels with the bottom 576x720 area containing the 
actual image content.

 From looking at the Matroska specs this can be mapped into:

PixelWidth      = 720
PixelHeight     = 608
PixelCropBottom = 0
PixelCropTop    = 32
PixelCropLeft   = 0
PixelCropRight  = 0

I guess that the definition of the display area (DisplayWidth, 
DisplayHeight) applies to the pixel frame size *after* cropping?

In that case it would be great if this would be made more explicit in 
the documentation of DisplayWidth and DisplayHeight. Also the defaults 
should reflect that (i.e. default DisplayWidth = PixelWidth - 
PixelCropLeft - PixelCropRight).

Best regards,
Tobias

---

From: Moritz Bunkus <[email-masked]>
Date: Sun, 28 Feb 2016 12:11:17 +0100

Hey,

it's true that we've never clarified this. I'm not even sure whether or
not we've had a consensus on how to interpret the values.

For me PixelCrop* applies directly to the PixelWidth/Height values. And
Display* determines the intended size for displaying the video after the
cropping parameters have been applied. So yes, your interpretation is
the one I'm favoring as well.

Kind regards,
mosu

---

From: Steve Lhomme <[email-masked]>
Date: Sun, 28 Feb 2016 15:31:11 +0100

> not we've had a consensus on how to interpret the values.

Correct, but trust me, it was in my head the whole time ;) Although
the name PixelCrop* imply that it happens on Pixel*, unlike Display*
values.

> the one I'm favoring as well.

Yes, the cropping happens on the pixels, the display size are just how
to display those remaining pixels.

> Kind regards,
> mosu
>
> _______________________________________________
> Cellar mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cellar
>

-- 
Steve Lhomme
Matroska association Chairman

---

From: Tobias Rapp <[email-masked]>
Date: Mon, 29 Feb 2016 15:27:27 +0100

> the name PixelCrop* imply that it happens on Pixel*, unlike Display*

One could (in theory) invent similar DisplayCrop* elements that apply on 
top of DisplayWidth/Height values which could be used to describe 
letterboxed/pillarboxed material. This would be somehow similar to the 
AFD flag [1] in MPEG but globally on the stream/track.

> to display those remaining pixels.

OK, have tried to make a patch, see attached file.

Note that I have changed the default value of DisplayWidth/Height to 
take the cropping into regard. Not sure how critical this is regarding 
backwards compatibility. It affects files which have at least one 
PixelCrop* element value > 0 and no DisplayWidth/Height element.

Best regards,
Tobias

Links:
[1] https://en.wikipedia.org/wiki/Active_Format_Description
>From 29ae82f471e52f3cd8dd21141fdc6d17560de22c Mon Sep 17 00:00:00 2001
From: Tobias Rapp <[email-masked]>
Date: Mon, 29 Feb 2016 15:12:46 +0100
Subject: [PATCH] Clarify processing order of PixelCrop elements

---
 spectool/specdata.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/spectool/specdata.xml b/spectool/specdata.xml
index 59557e6..edd6fbe 100644
--- a/spectool/specdata.xml
+++ b/spectool/specdata.xml
@@ -118,8 +118,8 @@ between two successive fields at the output of the decoding process (see <a href
   <element name="PixelCropTop" cppname="VideoPixelCropTop" level="4" id="0x54BB" type="uinteger" minver="1" default="0">The number of video pixels to remove at the top of the image.</element>
   <element name="PixelCropLeft" cppname="VideoPixelCropLeft" level="4" id="0x54CC" type="uinteger" minver="1" default="0">The number of video pixels to remove on the left of the image.</element>
   <element name="PixelCropRight" cppname="VideoPixelCropRight" level="4" id="0x54DD" type="uinteger" minver="1" default="0">The number of video pixels to remove on the right of the image.</element>
-  <element name="DisplayWidth" cppname="VideoDisplayWidth" level="4" id="0x54B0" type="uinteger" minver="1" default="PixelWidth" range="not 0">Width of the video frames to display. The default value is only valid when <a href="http://www.matroska.org/technical/specs/index.html#DisplayUnit">DisplayUnit</a> is 0.</element>
-  <element name="DisplayHeight" cppname="VideoDisplayHeight" level="4" id="0x54BA" type="uinteger" minver="1" default="PixelHeight" range="not 0">Height of the video frames to display. The default value is only valid when <a href="http://www.matroska.org/technical/specs/index.html#DisplayUnit">DisplayUnit</a> is 0.</element>
+  <element name="DisplayWidth" cppname="VideoDisplayWidth" level="4" id="0x54B0" type="uinteger" minver="1" default="PixelWidth - PixelCropLeft - PixelCropRight" range="not 0">Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* elements). The default value is only valid when <a href="http://www.matroska.org/technical/specs/index.html#DisplayUnit">DisplayUnit</a> is 0.</element>
+  <element name="DisplayHeight" cppname="VideoDisplayHeight" level="4" id="0x54BA" type="uinteger" minver="1" default="PixelHeight - PixelCropTop - PixelCropBottom" range="not 0">Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* elements). The default value is only valid when <a href="http://www.matroska.org/technical/specs/index.html#DisplayUnit">DisplayUnit</a> is 0.</element>
   <element name="DisplayUnit" cppname="VideoDisplayUnit" level="4" id="0x54B2" type="uinteger" minver="1" default="0">How DisplayWidth &amp; DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio).</element>
   <element name="AspectRatioType" cppname="VideoAspectRatio" level="4" id="0x54B3" type="uinteger" minver="1" default="0">Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).</element>
   <element name="ColourSpace" cppname="VideoColourSpace" level="4" id="0x2EB524" type="binary" minver="1" webm="0" bytesize="4">Same value as in AVI (32 bits).</element>
-- 
1.9.1