mfxExtVPPComposite

Definition

 

 

typedef struct mfxVPPCompInputStream {

        mfxU32  DstX;

        mfxU32  DstY;

        mfxU32  DstW;

        mfxU32  DstH;

 

        mfxU16  LumaKeyEnable;

        mfxU16  LumaKeyMin;

        mfxU16  LumaKeyMax;

 

        mfxU16  GlobalAlphaEnable;

        mfxU16  GlobalAlpha;

 

        mfxU16  PixelAlphaEnable;

 

        mfxU16  reserved2[18];

} mfxVPPCompInputStream;

 

typedef struct {

    mfxExtBuffer    Header;

 

    /* background color*/

    union {

        mfxU16   Y;

        mfxU16   R;

    };

    union {

        mfxU16   U;

        mfxU16   G;

    };

    union {

        mfxU16   V;

        mfxU16   B;

    };

 

    mfxU16      reserved1[24];

 

    mfxU16      NumInputStream;

    mfxVPPCompInputStream *InputStream;    

} mfxExtVPPComposite;

 

Description

 

 

The mfxExtVPPComposite structure is used to control composition of several input surfaces in the one output. In this mode, the VPP skips any other filters. The VPP returns error if any mandatory filter is specified and filter skipped warning for optional filter. The only supported filters are deinterlacing and interlaced scaling. The only supported combinations of input and output color formats are:

·        RGB to RGB,

·        NV12 to NV12,

·        RGB and NV12 to NV12, for per pixel alpha blending use case.

The VPP returns MFX_ERR_MORE_DATA for additional input until an output is ready. When the output is ready, VPP returns MFX_ERR_NONE. The application must process the output frame after synchronization.

Composition process is controlled by:

·        mfxFrameInfo::CropXYWH in input surface- defines location of picture in the input frame,

·        InputStream[i].DstXYWH - defines location of the cropped input picture in the output frame,

·        mfxFrameInfo::CropXYWH in output surface - defines actual part of output frame. All pixels in output frame outside this region will be filled by specified color.

If the application uses composition process on video streams with different frame sizes, the application should provide maximum frame size in mfxVideoParam during initialization, reset or query operations.

If the application uses composition process, MFXVideoVPP_QueryIOSurf function returns cumulative number of input surfaces, i.e. number required to process all input video streams. The function sets frame size in the mfxFrameAllocRequest equal to the size provided by application in the mfxVideoParam. 

Composition process supports all types of surfaces, but opaque type has next limitations:

·        all input surfaces should have the same size,

·        all input surfaces should have the same color format,

·        all input surfaces should be described in one mfxExtOpaqueSurfaceAlloc structure.

All input surfaces should have the same type and color format, except per pixel alpha blending case, where it is allowed to mix NV12 and RGB surfaces.

There are three different blending use cases:

1.    Luma keying. In this case, all input surfaces should have NV12 color format specified during VPP initialization. Part of each surface, including first one, may be rendered transparent by using LumaKeyEnable, LumaKeyMin and LumaKeyMax values.

2.    Global alpha blending. In this case, all input surfaces should have the same color format specified during VPP initialization. It should be either NV12 or RGB. Each input surface, including first one, can be blended with underling surfaces by using GlobalAlphaEnable and GlobalAlpha values.

3.    Per pixel alpha blending. In this case, it is allowed to mix NV12 and RGB input surfaces. Each RGB input surface, including first one, can be blended with underling surfaces by using PixelAlphaEnable value.

It is not allowed to mix different blending use cases in the same function call.

 

Members

 

 

Header.BufferId

Must be MFX_EXTBUFF_VPP_COMPOSITE

 

 

Y, U, V

R, G, B

background color, may be changed dynamically through Reset. No default value. YUV black is (0;128;128) or (16;128;128) depending on the sample range. The SDK uses YUV or RGB triple depending on output color format.

 

 

NumInputStream

Number of input surfaces to compose one output. May be changed dynamically at runtime through Reset. Number of surfaces can be decreased or increased, but should not exceed number specified during initialization. Query mode 2 should be used to find maximum supported number.

 

 

InputStream

This array of mfxVPPCompInputStream structures describes composition of input video streams. It should consist of exactly NumInputStream elements.

 

 

  DstX,
  DstY,
  DstW,
  DstH

Location of input stream in output surface.

 

 

  LumaKeyEnable

None zero value enables luma keying for the input stream. Luma keying is used to mark some of the areas of the frame with specified luma values as transparent. It may be used for closed captioning, for example.

 

 

  LumaKeyMin,
  LumaKeyMax

Minimum and maximum values of luma key, inclusive. Pixels whose luma values fit in this range are rendered transparent.

 

 

  GlobalAlphaEnable

None zero value enables global alpha blending for this input stream.

 

 

  GlobalAlpha

Alpha value for this stream in [0..255] range. 0 – transparent, 255 – opaque.

 

 

  PixelAlphaEnable

None zero value enables per pixel alpha blending for this input stream. The stream should have RGB color format.

 

Change History

 

This structure is available since SDK API 1.8.

The SDK API 1.9 adds LumaKeyEnable, LumaKeyMin, LumaKeyMax, GlobalAlphaEnable, GlobalAlpha and PixelAlphaEnable fields.

 

 

For more complete information about compiler optimizations, see our Optimization Notice.