oscarbarenys1

Please provide documentation and source code sample using ovdecode library!

Discussion created by oscarbarenys1 on Jan 4, 2011
Latest reply on Jan 10, 2011 by ljbade

 

Hi,

for me is pretty extraordinary how AMD can ship a new library (OVD) saying:

"Support for UVD video hardware component through OpenCL"

without documentation exceptuating headers.. and also without a simple source code sample..

Well let's compare to nvidia similar library cuvid.. they ship headers, documentation and source code

sample using both ogl and dx interop..

so what I ask is similar to cuvid for ovd i.e. ship documentation and sample using ogl and dx interop..

ah and they support on linux also since cuda 3.2 so I would want also linux support if it's not much 

 

to ask..

well it has something better to cuvid namely that stereo profile seems is exposed so I ask is stereo 

 

profile exposed in ovd working on uvd 3 hardware?

 

Another finding  well ovd seems a simple wrapper around a opencl extension: cl_amd_open_video

with following functions:

 

clEnqueueRunVideoProgramAMD clGetVideoSessionInfoAMD    clReleaseVideoSessionAMD       clRetainVideoSessionAMD clCreateVideoSessionAMD 

 

so why can't you document/expose this function directly and avoid using ovd and linking to another dll..

 

 

Well I have from header inferred a simple test sample.. 

but even before trying to use the meat of the library namely the  OVDecodePicture function which 

 

requires more knowledge about codecs than I know it still fails to work..

basically it fails in OVAcquireObject which seems to not like a object created like

clCreateBuffer(cxGPUContext, CL_MEM_READ_WRITE, 1920*1080*4*16, NULL, &ciErr1)

so what's the fail here is the size of the buffer?..

also some of the release/destroy functions is returning an error seems..

please help wanted..

 

 

unsigned int num=2;

ovdecode_device_info inf[10];

OVresult res=false;

    res=OVDecodeGetDeviceInfo ( &num,   inf);

printf("device %d ",num);

char *frase[]={"","OVD_H264_BASELINE_41",

"OVD_H264_MAIN_41", // H.264 bitstream acceleration main profile up to level 4.1

"OVD_H264_HIGH_41", // H.264 bitstream acceleration high profile up to level 4.1

"OVD_H264_BASELINE_51", // H.264 bitstream acceleration baseline profile up to level 5.1

"OVD_H264_MAIN_51", // H.264 bitstream acceleration main profile up to level 5.1

"OVD_H264_HIGH_51", // H.264 bitstream acceleration high profile up to level 5.1

"OVD_H264_STEREO_HIGH", // H.264 bitstream acceleration stereo high profile

"OVD_VC1_SIMPLE", // VC-1 bitstream acceleration simple profile

"OVD_VC1_MAIN", // VC-1 bitstream acceleration main profile

"OVD_VC1_ADVANCED", // VC-1 bitstream acceleration advanced profile}

};

for(int i=0; i<num; i++)

{

printf("device %d ",i);

printf("max_decode_stream %d\n",inf.max_decode_stream);

//cdDevice

ovdecode_cap *caps=(ovdecode_cap *)malloc(sizeof(ovdecode_cap)*inf.decode_cap_size);

//

{

res= OVDecodeGetDeviceCap (inf.device_id, inf.max_decode_stream, caps);

for(int j=0; j<inf.max_decode_stream; j++)

{

printf("%s ",frase[caps[j].profile]);

switch(caps[j].output_format) 

{

case OVD_NV12_INTERLEAVED_AMD: printf("OVD_NV12_INTERLEAVED_AMD"); break; 

case OVD_YV12_INTERLEAVED_AMD: printf("OVD_YV12_INTERLEAVED_AMD"); break;

}

printf("\n");

}

 

}

free(caps);

 

ov_handle h=OVCreateOVDHandleFromOPHandle(cmDevSrcA);

 

ov_session ses=OVDecodeCreateSession (cxGPUContext/*:cpPlatform*/, inf.device_id, 

 

OVD_H264_HIGH_41, OVD_NV12_INTERLEAVED_AMD, 1920, 1080);

 

cmDevSrcA = clCreateBuffer(cxGPUContext, CL_MEM_READ_WRITE, 1920*1080*4*16, NULL, &ciErr1);

    if (ciErr1 != CL_SUCCESS)

    {

        shrLog("Error in clCreateBuffer, Line %u in file %s !!!\n\n", __LINE__, __FILE__);

        Cleanup(EXIT_FAILURE);

    }

 

res=OVAcquireObject(ses, 1, &h, 0, NULL, NULL);

 

/*res= OVDecodePicture (ses, ovd_picture_parameter  *picture_parameter_1,

        void                   *picture_parameter_2,

        unsigned int            picture_parameter_2_size,

        ovd_bitstream_data     *bitstream_data,

        unsigned int            bitstream_data_size,

        ovd_slice_data_control *slice_data_control,

        unsigned int            slice_data_control_size,

        h, NULL, NULL, NULL, picture_id);*/

 res=OVReleaseObject(ses,1, &h, 0, NULL, NULL);

 res=OVReleaseOVDHandle ( h);

 res=OVDecodeDestroySession (ses);



Outcomes