cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

oscarbarenys1
Adept II

Please provide documentation and source code sample using ovdecode library!

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.profile]);

switch(caps.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);



0 Likes
4 Replies
oscarbarenys1
Adept II

Ah and I also remember 

OVDecodeGetDeviceCap returns for a 5850 only h.264 profiles and not vc1 but passing a 

OVDecodeCreateSession with a VC1 profile like 

OVD_VC1_SIMPLE seems to return without error so it's currently working VC1 decode but not advertised or will fail when decodepicture function?

0 Likes

oscarbarenys1,

I found this documentation at http://developer.amd.com/gpu/ATIStreamSDK/documentation/Pages/default.aspx about ovDecode.

We are having a sample which we plan to post at this link in near future:http://developer.amd.com/gpu/ATIStreamSDK/samples/Pages/default.aspx

I hope above information will help. Please post code in case the problem is still not resolved.

0 Likes
Dave_M
Journeyman III

"oscarbarenys1 said: 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 Your Lucky You also got the required library  

it seems it's not more extraordinary than actually providing the headers In the Linux version, But NOT Actually Providing the required Open Decode so library so Linux developers cant even actually try it, never mind try and write some cross platform OpenDECODE code.

and apparently Not even an AMD  date is set to tell you if it will even make it to that OS when they obviously and desperately Need Something official to try and Hardware decode their H.264 Linux video content on all this AMD gfx UVD Kit flooding the holiday season markets TODAY.

0 Likes

To let everyone know the same is now up on the above mentioned page.

It would have to be by far the most complicated OpenCL sample I have seen so far. Good luck pulling it apart.

One thing that is slightly disappointing is the fact that they pre-decoded the bitstream into the OVD structure format inside thousands of *.bit files.

So you can't see how to actually get the right values for the structures in the first place. That is why I am now working on FFmpeg as it decodes the bitstream nicely and I only need to modify the DXVA code to work with OVD.

0 Likes