In This Topic ▼

ILMFVDeinterlace Interface

This is the interface for the LEAD Video Deinterlace Transform.

Data Types

SEGMENT_OPERATION_MODE

Summary

The SEGMENT_OPERATION_MODE constants describe how segment frames will be processed.

Syntax

typedef enum SEGMENT_OPERATION_MODE 
{ 
   MODE_NO_DEINTERLACE = 0, 
   MODE_DEINTERLACE_ALL, 
   MODE_DEINTERLACE_PATTERN, 
} SEGMENT_OPERATION_MODE; 

Members

MODE_NO_DEINTERLACE

Do not deinterlace any frame in the segment.

MODE_DEINTERLACE_ALL

Deinterlace all frames in the segment.

MODE_DEINTERLACE_PATTERN

Deinterlacing pattern is used. A frame will be deinterlaced if it lies in a deinterlace section in the pattern.

SEGMENT_TIME_FORMAT

Summary

The SEGMENT_TIME_FORMAT constants describe the time format used for all segments.

Syntax

typedef enum sSEGMENT_TIME_FORMAT 
{ 
   SEGMENT_TIME_FORMAT_FRAME = 0, 
   SEGMENT_TIME_FORMAT_TIME, 
} SEGMENT_TIME_FORMAT; 

Members

SEGMENT_TIME_FORMAT_FRAME

Segment time format is frames. Frame numbering is zero-based and begins at the start of the stream.

SEGMENT_TIME_FORMAT_TIME

Segment time format is time, defined as hours, minutes, seconds, and milliseconds.

LMVDeinterlace_APILEVEL

Summary

Lists the valid values for the ApiLevel parameter that can be passed to the ResetToDefaultsEx method.

Syntax

typedef enum 
{ 
   LMVDeinterlace_APILEVEL_1 = 0, 
   LMVDeinterlace_APILEVEL_2 = 1, 
} _LMVDeinterlace_APILEVEL; 
Constant Description
LMVDeinterlace_APILEVEL_1 Use the defaults from the previous versions of the deinterlace transform.
LMVDeinterlace_APILEVEL_2 Use the defaults from the current version of the deinterlace transform.

Properties

Type Name Description
VARIANT_BOOL Enabled Indicates whether deinterlacing is enabled (TRUE) or not (FALSE).
VARIANT_BOOL Even Indicates whether to start with even lines (TRUE) or odd lines (FALSE).
VARIANT_BOOL MergeFields Indicates whether to use merge even and odd fields into a single frame.
VARIANT_BOOL StartWithEvenFrame Indicates whether to start with an even frame (TRUE) or an odd frame (FALSE) when the DoubleFrameRate property is set to TRUE.
long InWidth Read only; the input stream width.
long InHeight Read only; the input stream height.
long OutWidth Read only; the output stream width.
long OutHeight Read only; the output stream height.
long InBits Read only; the input stream bits per pixel.
long OutBits Read only; the output stream bits per pixel.
VARIANT_BOOL EnableROI Enables or disables the Region Of Interest. When an ROI is defined, the transform acts only on it, ignoring all pixels outside the region. Currently, the region is a rectangle defined by the ROILeft, ROITop, ROIRight and ROIBottom properties.
long ROILeft The left boundary of the ROI rectangle.
long ROITop The top boundary of the ROI rectangle.
long ROIRight The right boundary of the ROI rectangle.
long ROIBottom The bottom boundary of the ROI rectangle.
VARIANT_BOOL EnableGlobalPattern Enables or disables the global deinterlacing pattern. The global pattern affects all the frames in the stream. With patterns, either global or segment specific, you can define what frames will be deinterlaced or ignored.The pattern is defined using 3 parameters:1.The preamble frames: a group of frames at the beginning of the stream or segment. You can choose whether the preamble frames will be deinterlaced.2.No-Deinterlace frames: a group of frames, following the preamble frames, that will be ignored. No deinterlacing is applied.3.Deinterlace frames: a group of frames, following the No-Deinterlace frames, that will be deinterlaced.
SEGMENT_TIME_FORMAT SegmentsTimeFormat Value that specifies the time format used to define segments. Possible values are:SEGMENT_TIME_FORMAT_FRAME: The time format is Frames, which is zero based.SEGMENT_TIME_FORMAT_TIME: The time format is Time, defined by hours, minutes, seconds, and milliseconds. The time of the first frame is zero (all fields).
long SegmentsCount (Read only) This property is updated with the number of available segments.
VARIANT_BOOL EnableProtectedArea Enables or disables the protected area. The protected area, a rectangle, is defined by its 4 boundaries, and is an area that will be excluded from deinterlacing. The protected area is independent of the ROI and the 2 regions can have any settings in the allowed range.
VARIANT_BOOL AutoDeinterlace Enable/Disable the auto deinterlace option. This will automatically deinterlace frames that need deinterlacing.
double AutoDeinterlaceSensitivity Specifies when deinterlacing is necessary. Values range between 0.001 and 8.000. The default is 1.000. Values lower than 1.000 increase the chance a frame will be considered interlaced. With low values, deinterlacing may be performed even when the interlaced effect is on a small portion of the image.

Methods

HRESULT ResetToDefaults()

Resets all the Deinterlace options to the default values.

HRESULT ResetToDefaultsEx (long ApiLevel)

Parameters

long ApiLevel.

Description

Resets deinterlacing to default values. The ApiLevel determines which default values to use. Current applications should set ApiLevel to LMVDeinterlace_APILEVEL_2 = 1.

The deinterlace transform might change in the future and have different properties or default behavior. Calling this method ensures the transform will have the same default values as they were at the time you developed your application.

It is recommended you call ResetToDefaultsEx(LMVDeinterlace_APILEVEL_2) before you start setting properties and start calling other methods for this interface.

Returns

S_OK if connected; otherwise, S_FALSE.

HRESULT SetGlobalPattern(long PreambleFrames, long NoDeinterlaceFrames, long DeinterlaceFrames, VARIANT_BOOL DeintPreamble)

Parameters

Value Meaning
PreambleFrames The number of preamble frames of the global pattern.
NoDeinterlaceFrames The number of No-Deinterlace frames of the global pattern.
DeinterlaceFrames The number of Deinterlace frames of the global pattern.
DeintPreamble A Boolean value that indicates whether to deinterlace the preamble frames (TRUE) or not (FALSE).

Description

Sets the global pattern parameters.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetGlobalPattern(long* pPreambleFrames,long * pNoDeinterlaceFrames, long *pDeinterlaceFrames, VARIANT_BOOL *pDeintPreamble)

Parameters

Value Meaning
pPreambleFrames Pointer to a variable that will receive the number of preamble frames of the global pattern.
pNoDeinterlaceFrames Pointer to a variable that will receive the number of No-Deinterlace frames of the global pattern.
pDeinterlaceFrames Pointer to a variable that will receive the number of Deinterlace frames of the global pattern.
pDeintPreamble Pointer to a variable that will receive the state of preamble frames deinterlacing; TRUE indicates that the preamble frames will be deinterlaced, and FALSE indicates that the preamble frames will not be deinterlaced (passed untouched).

Description

Retrieves the global pattern parameters.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT AddSegment(long Index);

Parameters

Value Meaning
Index Index of the segment before which the new segment will be added. Valid indexes range from zero to SegmentsCount - 1. If an invalid index is passed, the segment will be added to the end of the list.

Description

Adds a new segment before the segment at the specified index.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT RemoveSegment(long Index);

Parameters

Value Meaning
Index Index of the segment to remove.

Description

Removes the segment at the specified index.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SetSegmentData(long Index, long SegmentData)

Parameters

Value Meaning
Index The zero based index of the segment for which to set the data.
SegmentData A 4-byte chunk of user data. The saved user data can be retrieved using the GetSegmentData method.

Description

Attaches a 4-bytes user data to the segment whose index is passed.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetSegmentData(long Index, long *pSegmentData)

Parameters

Value Meaning
Index The zero based index of the segment.
pSegmentData Pointer to a variable that will receive the user data saved using SetSegmentData, or zero if no data was attached to the segment.

Description

Retrieves the user data attached to the segment whose index is passed.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetSegmentStartTime (long Index, long *pHours, long *pMinutes, long *pSeconds, long *pMilliSeconds)

Parameters

Value Meaning
Index The zero based index of the segment.
pHour Pointer to a variable that will receive the hours portion of the segment start time.
pMinutes Pointer to a variable that will receive the minutes portion of the segment start time.
pSeconds Pointer to a variable that will receive the seconds portion of the segment start time.
pMilliSeconds Pointer to a variable that will receive the milliseconds portion of the segment start time.

Description

Retrieves the start time of the segment whose index is passed. If the segments time format is not SEGMENT_TIME_FORMAT_TIME, then the provided values are undefined.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SetSegmentStartTime(long Index, long Hours, long Seconds, long Minutes,long MilliSeconds)

Parameters

Value Meaning
Index The zero based index of the segment for which to set the start time.
Hour The hours portion of the segment start time.
Minutes The minutes portion of the segment start time. Valid values range from 0 to 59.
Seconds The seconds portion of the segment start time. Valid values range from 0 to 59.
MilliSeconds The milliseconds portion of the segment start time. Valid values range from 0 to 999.

Description

Sets the start time for the segment at the specified index. If the SegmentsTimeFormat property is not SEGMENT_TIME_FORMAT_TIME, then changing the start time will not have any effect.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetSegmentStartFrame(long Index,LONGLONG *pStartFrame)

Parameters

Value Meaning
Index The zero based index of the segment.
pllStartFrame Pointer to a variable that will receive the position of the first frame in the segment. Zero based frame counting from the start of the stream, is used.

Description

Retrieves the position of the first frame in the segment. If the SegmentsTimeFormat property is not SEGMENT_TIME_FORMAT_FRAME, then the provided value is undefined.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SetSegmentStartFrame(long Index, LONGLONG StartFrame)

Parameters

Value Meaning
Index The zero based index of the segment.
StartFrame The position of the first frame in the segment. Frame numbering is zero-based and starts at the beginning of the stream.

Description

Sets the position of the first frame in the segment. If the SegmentsTimeFormat property is not SEGMENT_TIME_FORMAT_FRAME, then changing the start frame will not have any effect.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetSegmentOperationMode(long Index, SEGMENT_OPERATION_MODE *pOperationMode)

Parameters

Index

The zero based index of the segment.

pOperationMode

Pointer to a value that will receive the currently used segment operation mode.

Possible values are:

Mode Description
MODE_NO_DEINTERLACE No frame in the segment will be deinterlaced.
MODE_DEINTERLACE_ALL All frames in the segment will be deinterlaced.
MODE_DEINTERLACE_PATTERN Deinterlace according to a pattern. A frame will be deinterlaced if it lies in a deinterlace section in the pattern.

Description

Gets the operation mode of the segment whose index is passed.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SetSegmentOperationMode(long Index, SEGMENT_OPERATION_MODE OperationMode)

Parameters

Value Meaning
Index The zero based index of the segment.

OperationMode

The operation mode to set.

Possible values are:

| Mode | Description | | MODE_NO_DEINTERLACE | Do not interlace any frame in the segment. | | MODE_DEINTERLACE_ALL | Deinterlace all frames in the segment. | | MODE_DEINTERLACE_PATTERN | Deinterlace according to a pattern. A frame will be deinterlaced if it lies in a deinterlace section in the pattern being used. |

Description

Gets the operation mode of the segment at the specified index.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetSegmentPattern(long Index, long* pPreambleFrames, long * pIgnoreFrames, long *pDeinterlaceFrames, VARIANT_BOOL *pDeintPreamble)

Parameters

Value Meaning
Index The zero based index of the segment.
pPreambleFrames Pointer to a variable that will receive the number of preamble frames of the segment's pattern.
pIgnoreFrames Pointer to a variable that will receive the number of No-Deinterlace frames of the segment's pattern.
pDeinterlaceFrames Pointer to a variable that will receive the number of Deinterlace frames of the segment's pattern.
*pDeintPreamble Pointer to a variable that will receive the state of preamble frames deinterlacing; TRUE indicates that the preamble frames will be deinterlaced, and FALSE indicates that the preamble frames will not be deinterlaced (passed untouched).

Description

Retrieves the segment pattern parameters.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SetSegmentPattern(long Index, long PreambleFrames, long IgnoreFrames, long DeinterlaceFrames, VARIANT_BOOL DeintPreamble)

Parameters

Value Meaning
Index The zero based index of the segment.
PreambleFrames The number of preamble frames in the segment pattern.
IgnoreFrames The number of No-Deinterlace frames in the segment pattern.
DeinterlaceFrames The number of Deinterlace frames in the segment pattern.
DeintPreamble A Boolean value that indicates whether to deinterlace the preamble frames (TRUE) or not (FALSE).

Description

Sets the segment pattern parameters.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT GetProtectedAreaParams(long *Left, long *Right, long *Top, long *Bottom)

Parameters

Value Meaning
Left Pointer to a variable to be updated with the left boundary of the protected area. The possible range for the left boundary is from zero to the right boundary minus one.
Right Pointer to a variable to be updated with the right boundary of the protected area. The possible range for the right boundary is from the left boundary plus one to the current video width.
Top Pointer to a variable that will receive the top boundary of the protected area. The possible range for the top boundary is from zero to the bottom boundary minus one.
Bottom Pointer to a variable that will receive the bottom boundary of the protected area. The possible range for the bottom boundary is from the top boundary plus one to the current video height.

Description

Retrieves the protected area boundaries.

Returns

S_OK if successful, an error code otherwise.

HRESULT SetProtectedAreaParams(long Left, long Right, long Top, long Bottom)

Parameters

Value Meaning
Left Value that represents the left boundary of the protected area. The possible range for the left boundary is from zero to the right boundary minus one. Use -1 to keep the current left boundary value.
Right Value that represents the right boundary of the protected area. The possible range for the right boundary is from the left boundary plus one to the current video width. Use -1 to keep the current right boundary value.
Top Value that represents the top boundary of the protected area. The possible range for the top boundary is from zero to the bottom boundary minus one. Use -1 to keep the current top boundary value.
Bottom Value that represents the bottom boundary of the protected area. The possible range for the bottom boundary is from the top boundary plus one to the current video height. Use -1 to keep the current bottom boundary value.

Description

Sets the protected area boundaries. If the protected area is not enabled when this method is called, the new boundaries will be set and will take effect the next time the protected area is enabled.

Returns

S_OK if successful, an error code otherwise.

HRESULT LoadAttributes()

Parameters

None.

Description

Loads transform settings from the registry. The Media Foundation transforms import the settings from the registry only at creation time. This method will force the transform to re-load its settings from the registry. If the transform has no settings to load from the registry, E_NOTIMPL is returned.

Return

S_OK if successful, S_FALSE otherwise.

HRESULT SaveAttributes()

Parameters

None.

Description

Writes transform settings to the registry. This MF Transform save his settings to the registry only at destruction time, This method will force the transform to save its settings to the registry before its released.

If the transform has no settings to write to the registry, E_NOTIMPL is returned.

Return

S_OK if successful, S_FALSE otherwise.

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Transforms C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.