Fields are evil, but until the world decides to adopt sensible video standard and casts the current ones into the same pit as 2 inch video tape, we are stuck with them.
Before we start, some nomenclature. The Y-Axis is considerred to be up, so in a fielded image,
We don't call them odd and even, so as to avoid confusion with video standard, which have scanline 0 at the top, and so have the opposite sense of our 'odd' and 'even'.
Clips and images from those clips are flagged as to whether they are fielded or not, and if so what is the spatial/temporal ordering of the fields in that image. The
clip and image instance property can be...
kOfxImageFieldNone- the material is unfielded
kOfxImageFieldLower- the material is fielded, with scan line 0,2,4.... occuring first in a frame
kOfxImageFieldUpper- the material is fielded, with scan line 1,3,5.... occuring first in a frame
Images extracted from a clip flag what their fieldedness is with the property
, this can be....
kOfxImageFieldNone- the image is an unfielded frame
kOfxImageFieldBoth- the image is fielded and contains both interlaced fields
kOfxImageFieldLower- the image is fielded and contains a single field, being the lower field (lines 0,2,4...)
kOfxImageFieldUpper- the image is fielded and contains a single field, being the upper field (lines 1,3,5...)
The plugin specifies how it deals with fielded imagery by setting the
property. This can be,
The reason for this is an optimisation. Imagine a text generator with no animation being asked to render into a fielded output clip, it can treat an interlaced fielded image as an unfielded frame. So the host can get the effect to render both fields in one hit and save on the overhead required to do the rendering in two passes.
If called twice per frame, the time passed to the render action will be frame and frame+0.5. So 0.0 0.5 1.0 1.5 etc...
When rendering unfielded footage, the host will only ever call the effect's render action once per frame, with the time being at the integers, 0.0, 1.0, 2.0 and so on.
The render action's argument property
tells the effect which field it should render, this can be one of...
kOfxImageFieldNone- there are no fields to deal with, the image is full frame
kOfxImageFieldBoth- the imagery is fielded and both scan lines should be renderred
kOfxImageFieldLower- the lower field is being rendered (lines 0,2,4...)
kOfxImageFieldUpper- the upper field is being rendered (lines 1,3,5...)
A plugin can specify how it wishes fielded footage to be fetched from a clip via the clip descriptor property
. This can be one of...
kOfxImageFieldBothfetch a full frame interlaced image
kOfxImageFieldSinglefetch a single field, making a half height image
kOfxImageFieldDoubledfetch a single field, but doubling each line and so making a full height image (default)
If fetching a single field, the actual field fetched from the source frame is...
To illustrate this last behaviour, the two examples below show an output with twice the frame rate of the input and how clipGetImage maps to the input. The .0 and .5 mean first and second temporal fields.
Behaviour with unfielded footage output 0 1 2 3 source 0 0 1 1Behaviour with fielded footage output 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 source 0.0 0.0 0.5 0.5 1.0 1.0 1.5 1.5