[VDPAU] ffmpeg and HEVC: NumLongTermPicturesSlcieHeaderBits

Philip Langdale philipl at overt.org
Fri May 22 15:16:42 PDT 2015


Hi all,

I've started working on exposing the VDPAU HEVC functionality in ffmpeg, 
and this means
mapping all the metadata from ffmpeg structures to VDPAU. I've managed 
to, I believe,
map most of the fields at this point - some were obvious, some I could 
borrow from the
dxva equivalent code and one time, there was a helper function inside 
ffmpeg that did the
necessary calculation, but this one has me stumped:

     /** Second, VDPAU requires the number of bits used for long term 
reference
         pictures in the slice_segment_header. This is equal to the 
number
         of bits used for the contents of the block beginning with
         "if(long_term_ref_pics_present_flag)". */
     uint32_t NumLongTermPictureSliceHeaderBits;

I've found the code in ffmpeg that does the calculation described in the 
spec, but I still
don't understand how to get from there to this bit count. Is this 
supposed to reflect how
many bits are extracted and read by the code fragment? In other words, 
would I need to modify
the ffmpeg code to track how many bits it's reading as it goes and then 
expose that total to
me to pass on? This bit count concept isn't used by dxva or by the 
software decoder so I
don't have anything to compare with.

ffmpeg code is here: 
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/hevc.c;h=df6cce6f8a2cf5dba6bfb1e3bc258462a6b97a3f;hb=HEAD#l231

Thanks,

--phil



More information about the VDPAU mailing list