About AVC encoding DPB size problem

About AVC encoding DPB size problem

Hi, I'm a developer for remote view by using Media SDK to compress. Now, I faced a problem that I can't control the DPB size by setting MaxDecFrameBuffering.
My test stream resolution is 320x160, and setting is below.
GOP flag: closed
GOP size:30
Distance between I frame/P frame: 4
Idr interval: 6
Platform : i5-2300

other is default
Setting MaxDecFrameBuffering or not is nothing different.

I found some rules for DPB size, it's determined by level_idc and resolution.
Does it mean when level_idc and resolution is decided and the DPB size is decided, too?
Or we still could set a DPB size we want?

Is anything wrong or forgot?

Thanks for any kindly help!!

Stanely Hsu

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Stanley,
The value of MaxDecFrameBuffering parameter should lie within the following range:
NumRefFrames <= MaxDecFrameBuffering <= Min(Floor(MaxDpbMbs / (PicWidthInMbs * FrameHeightInMbs)), 16)
Otherwise the value will be ignored.
Please also note that profile matters (quoting medaisdk_man.pdf):If the H.264 profile is High 10 Intra, High 4:2:2 Intra or High 4:4:4 Intra, this parameter is ignored. In these cases, the H.264 specification requires that the parameter be zero.
Please check your experiment. If you still see issues let me know.
Best regards,Nina

Hi Nina,

Thanks for your reply.
According your information, I have checked some parameters in encoded bitstream(176x144, NV12).
The NumRefFrames is 2, level_idc is 11, and I got DPB size = 4.
It's strange that why is it 9 ?(MaxDpbMbs = 900, floor(900/99) = 9)

BTW, base on this parameter, I try to set DPB size is 3, but the DPB size is still 4.
The used profile is not these profiles ignored MaxDecFrameBuffering for sure, because of NumRefframes!=0.

These parameters are set in my experiment ...
AVC codec,
Balanced usage,
Max 128 Kbps
Constant bit rate control
frame rate 30
MaxDecFrameBuffering is 3

Is setting this parameter depend on other parameters or do I miss, misunderstand something?

Stanley Hsu

Hi Stanley,
Your usage seems correct to me. Let me check the same parameters set at my side. The only question I have is are you using hardware Media SDK dll or software?
Best regards,Nina

Hi Nina,

Yes, I use hardware media sdk dll with v2.0.

I have tried software media sdk dll, and there is the same issue.

Thanks a lot!

Stanley Hsu

Update some information.

The dpb size(4) of encoded bitstream is revealed by tool(H264Visa).
But the JM tool reveals this value as 9, in fact this value is calculated by JM, instead of extracting from bitstream, bacause max_dec_frame_buffering is not set in VUI parameters.

Stanley Hsu

Hi Stanley,
I did some experiments and it seems that it is impossible to set MaxDecFrameBuffering using Media SDK 2.0 software lib, Sandy Bridge hardware lib and 3.0 Beta software lib. This is a real bug in libraries, thank you so much for finding and reporting it. I will propagate it to the developer team.
This issue will get fixed in the upcoming Media SDK 3.0 Beta update (software library, the release will be posted on the web quite soon) and with one of the Sandy Bridge graphics driver updates (hardware library).
Best regards,Nina

Hi Nina,

OK! This parameter would be useful, thanks for fixing it!

I appreciated your kindly help very much.

Stanley Hsu

Leave a Comment

Please sign in to add a comment. Not a member? Join today