cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure

himanshu.gautam a écrit:

"internal H264 parser" is a AMD propriatary Code, which I am not allowed to share. This code is used to generate the bitfiles which are fed as input to the OVDecodeRender Sample. There should probably be some opensource / free applications for this purpose, but I am not aware of them.

Just to add: I'm still not able to really test your bitstream because your OVDecodeRender is not compiling for the latest 2.8 sdk? It would help me to test the bitfiles that I would generate with my own app!

Tks

Aymeric

0 Likes
himanshu_gautam
Grandmaster

Re: How to fill H264_picture_parameter_2 structure

I though You were able to run OVDecodeRender Sample long back. I will try to post a sample code that works with SDK 2.8 soon.

0 Likes
amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure

I have modified the sample in order to read your bit files. But not to decode and render the files.

Also, If I'm correct, your baseline sample only have one slice for each NAL and only one i-slice for first frame? And also only one slice in each bit file... Not enough close to my real life!!!

I'm looking to receive your modified sample! It will help!

Regards

Aymeric

0 Likes
himanshu_gautam
Grandmaster

Re: How to fill H264_picture_parameter_2 structure

PFA the changed files in OVDecodeRender sample to make it work with SDK 2.8. You need to make sure that you use old SDKUtil library and header though.

amd wrote:

I have modified the sample in order to read your bit files. But not to decode and render the files.

Also, If I'm correct, your baseline sample only have one slice for each NAL and only one i-slice for first frame? And also only one slice in each bit file... Not enough close to my real life!!!

If the baseline profile was not enough, probably you can point me to some yuv file, for which I can run the parser and sent you the results.

0 Likes
amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure

Hi,

Tks for the update.

I originally had troubles to compile because another sdkutil include path was included in the OVDecodeRender vs2010 project...

I have finally compiled with your OVRender_fix, however, I'm still not able to run the project.

I have a windows 8 with 2 cards and 2 displays (one per card). OVDecodeRender shows:

Platform 0 : NVIDIA Corporation

Platform 1 : Advanced Micro Devices, Inc.

However, when testing I have 2 displays found being active, but both are failing

at line: 468 of OVDecodeRender.cpp:

status = clGetGLContextInfoKHR(properties,

                                      CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR,

                                      0,

                                      NULL,

                                      &deviceSize);

For both display (one with a window being opened on nvidia screen and the other on a window being opened on amd screen) , the returned deviceSize is 0

Any hints?

Aymeric

EDITING POST: I have managed to skip the "CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR" and replaced the code to search for "interopDevice" from

     status = clGetGLContextInfoKHR( properties,

                                    CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR,

                                    sizeof(cl_device_id),

                                    &interopDevice,

                                    NULL);

to:

     status = clGetGLContextInfoKHR( properties,

                                    CL_DEVICES_FOR_GL_CONTEXT_KHR,

                                    sizeof(cl_device_id),

                                    &interopDevice,

                                    NULL);

Now, I have a clDeviceID, but it is different compared to the one found by "OVDecodeGetDeviceInfo".

Later, the runRemovePitchKernel will fail there:

Error: Error: clEnqueueNDRangeKernel failed! (remove_pitch_kernel)

Error code : CL_INVALID_WORK_GROUP_SIZE

Location : OVDecodeRender.cpp:834

I guess the issue is coming from the initial error? It seems I cannot have CL_DEVICES_FOR_GL_CONTEXT_KHR returning a cl_device_id for my amd card?

tks again!

0 Likes
amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure

Today... After my test described above, I noticed there was a driver update for my "AMD Radeon HD 7700 Series"

Catalyst version 13.4 was installed

Driver Packaging Version: 12.104-130328a-155980C-ATI was  installed

And my non-IDR image... are now correctly rendered!!! At least from the initial test I've done.

As far as I can tell, I had installed the advised 12.x catalyst version (installed in February I think)

I hope the issue to be solved 100%...

Aymeric

0 Likes
lk_amd
Adept II

Re: How to fill H264_picture_parameter_2 structure

Hi,
can you give some sample or explain on OVDecodePicture() deal with multi slices?

My test have 4 silce in one frame , so I malloc 4 slice_data_control , set params, and send the begin address to OVDecodePicture,

Is this the right way ?

thanks

0 Likes
amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure

Hi,

I'm the author of this thread, however, I still got some troubles to decode!

This is what I'm doing to create and fill "ovd_slice_data_control" structure with nal_len

being my slice size:

For all slices:

    if (*count_slice==0)

      slice_data_control[*count_slice].SliceDataLocation = 0;

    else

      slice_data_control[*count_slice].SliceDataLocation = slice_data_control[(*count_slice)-1].SliceDataLocation+slice_data_control[(*count_slice)-1].SliceBytesInBuffer;

    slice_data_control[*count_slice].SliceBytesInBuffer = nal_len;

    slice_data_control[*count_slice].SliceBitsInBuffer = slice_data_control[*count_slice].SliceBytesInBuffer*8;

    (*count_slice)++;

All slices starts with :

    *dst++=0;

    *dst++=0;

    *dst++=1;

Then

         int size_of_slice_structure = count_slice*sizeof(ovd_slice_data_control);

        OVresult res = OVDecodePicture(d->session,

          &d->picture_parameter,

          &d->picture_parameter_2,

          sizeof(H264_picture_parameter_2),

          &p,

          (unsigned int)(end-p),

          slice_data_control,

          size_of_slice_structure,

          d->nv12_surface,

          num_event_in_wait_list,

          NULL,

          &eventRunVideoProgram,

          0);

About my previous post: I said that I was able to have video by upgrading the driver: I was wrong: in fact, I'm able to decode some stream made with some encoders and not others and don't think the driver was faulty. More tests needed to find out...

Regards

Aymeric

0 Likes
lk_amd
Adept II

Re: How to fill H264_picture_parameter_2 structure

Thanks Aymeric,

I did the same as you suggest, but I only get 1/4 picture on the top , the 3/4 below all green ( I convert the nv12_surface to YUV, checked  using yuv viewer )

I test a I frame frome a BD m2ts file,

the slice_data_controls are :

0x0027FA20  08 24 05 00 00 00 00 00 81 a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .$......??......................

0x0027FA40  18 52 05 00 81 a4 00 00 43 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .R..??..C?......................

0x0027FA60  80 68 05 00 c4 4e 01 00 10 ad 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  €h..?N...?......................

0x0027FA80  08 20 05 00 d4 fb 01 00 01 a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

code are:

slice_data_control[0].SliceDataLocation = 0;                   

slice_data_control[0].SliceBytesInBuffer = 42113;

slice_data_control[0].SliceBitsInBuffer = 42113 * 8;

slice_data_control[1].SliceDataLocation = 42113;                   

slice_data_control[1].SliceBytesInBuffer = 43587;

slice_data_control[1].SliceBitsInBuffer = 43587 * 8;

slice_data_control[2].SliceDataLocation = 85700;                   

slice_data_control[2].SliceBytesInBuffer = 44304;

slice_data_control[2].SliceBitsInBuffer = 44304 * 8;

slice_data_control[3].SliceDataLocation = 130004;                   

slice_data_control[3].SliceBytesInBuffer = 41985;

slice_data_control[3].SliceBitsInBuffer = 41985 * 8;

reserved part set 0

then  bitstream_data 

// first I slice

0x085E0040  00 00 01 65 88 80 00 0b 00 00 06 af ef 26 72 f4 37 5e 91 90 ee 47 e4 c5 b7 48 68 f4 17 11 11 7c  ...e?€.....??&r?7^???G???Hh?...|

//  2nd I slice

0x085EA4C0  b0 00 00 01 65 00 3f c8 88 00 00 b0 00 00 6a ef 34 9b 9b 38 61 91 29 c4 75 aa 9f 54 da 5e c1 46  ?...e.???..?..j?4??8a?)?u??T?^?F

// 3 I slice

0x085F4F00  e6 79 ff fa 00 00 01 65 00 1f e2 22 00 00 2c 00 00 12 bf cb 50 cf f5 78 6e 95 d8 e4 e4 06 04 9c  ?y.?...e..?"..,...??P??xn????..?

// 4 I slice

0x085FFC10  e8 6d 21 50 00 00 01 65 00 0b f4 88 80 00 0b 00 00 04 af ed f1 99 88 1b e3 15 0c a6 54 41 4d e6  ?m!P...e..??€.....?????.?..?TAM?

// end align 128

0x0860A000  de 3a 47 df c8 e1 a0 65 97 bd 58 f2 b7 eb 1b aa 72 4d 3a 37 b8 00 00 00 00 00 00 00 00 00 00 00  ?:G????e??X???.?rM:7?...........

original data size 171989 , so i make 172000 to do align,


Where is my mistake?

Please.

0 Likes
amd4
Journeyman III

Re: How to fill H264_picture_parameter_2 structure


lk_amd a écrit:



Thanks Aymeric,


I did the same as you suggest, but I only get 1/4 picture on the top , the 3/4 below all green ( I convert the nv12_surface to YUV, checked  using yuv viewer )


It looks like we have the very same issue!

This is one behavior I have when it doesn't work...

Regards

Aymeric

0 Likes