Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 2185

Buffer Alignment Requirement For Video Preprocessor (VPP)

$
0
0

Hi,

While working on H264 transcode use case using Intel Media SDK, we noticed that the Video Preprocessorcomponent (Hardware implementation) of the SDK was causing a memory corruption at the output surface, specifically when the output resolution is 426x240. According to the Media SDK documentation, the width of the video frame must be a multiple of 16 and height must be a multiple of 16 (for progressive) or 32 (for interlaced). As we are currently dealing with only progressive video, we have used 16 byte alignment for both the height and the width. Also, the width and height of the surface buffers have the same alignment, i.e, 16 byte alignment. If done so, we see that the Video Preprocessorcomponent writes more than the allocated surface buffer, thus causing memory corruption. To check if there was a problem with the configuration of VPP, we used the “MFXVideoVPP_Query” call, which did not return any errors.

On the other side, the sample “tutorial” applications that come bundled with the SDK have implementations wherein a 32 byte alignment (for both width and height) is used for the input and output surfaces, for both progressive and interlaced video. Doing this however does not corrupt memory outside the surface buffer as a larger than required value of buffer is used. The issue is reproducible if we change the surface buffer alignment to 16 byte in the sample tutorials as well. Please note that we are using hardware acceleration with system memory I/O.

Thus, we wanted to understand the necessity of  32 byte surface buffer alignment (for height) at the output side of the Video Preprocessor. Also, we would like to understand the buffer alignment requirements for other Intel Media SDK components like H264 decoder/H264 encoder for different implementations (hardware/software) and for different IO patterns (system/video/opaque). Currently the documentation is not very clear in this regard.

Kindly let us know your views on the same.

Additional information:

  1. VPP configuration parameters:

Input-

    FourCC = MFX_FOURCC_NV12;

    ChromaFormat = MFX_CHROMAFORMAT_YUV420;

    CropX = 0;

    CropY = 0;

    CropW = 854;

    CropH = 480;

    PicStruct = MFX_PICSTRUCT_PROGRESSIVE;

    FrameRateExtN = 30;

    FrameRateExtD = 1;

    Width = 864;

    Height = 480;

                    Surface buffer width : 864

                    Surface buffer height: 480

Output-

    FourCC = MFX_FOURCC_NV12;

    ChromaFormat = MFX_CHROMAFORMAT_YUV420;

    CropX = 0;

    CropY = 0;

    CropW = 426;

    CropH = 240;

    PicStruct = MFX_PICSTRUCT_PROGRESSIVE;

    FrameRateExtN = 30;

    FrameRateExtD = 1;

    Width = 432;

    Height =  240;

                    Surface buffer width : 432

                    Surface buffer height: 240

IO Pattern-

    IOPattern =

        MFX_IOPATTERN_IN_SYSTEM_MEMORY | MFX_IOPATTERN_OUT_SYSTEM_MEMORY;

  1. System configuration

SDK version        : MediaServerStudioEssentials2015R6

OS                          : Centos 7.1

Kernel version  : 3.10.0-229.1.2.39163.MSSr4.el7.centos.x86_64

Processor            : Intel(R) Core(TM) i7-4770R

Thank you,


Viewing all articles
Browse latest Browse all 2185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>