[x264-devel] Temporal layers with x264

Eymen Kurdoglu eymenkurdoglu at gmail.com
Thu Aug 20 07:38:56 CEST 2015


On 08/14/2015 09:34 PM, Loren Merritt wrote:
> On Fri, 14 Aug 2015, Krzysztof Hebel wrote:
>
>> I am interested in obtaining a bitstream with 2 temporal layers using
>> x264. My understanding is, that it should be possible with
>> "--b-pyramid strict" option and by limiting the number of reference
>> frames. Is that correct? Would it be possible with the current
>> implementation to obtain a bitstream with hierarchical P frames only
>> (my suspicion is no)?
> "--b-pyramid strict --b-adapt 0" is necessary and sufficient.
> You do not need to change the number of reference frames.
> x264 does not support hierarchical P frames.

I have been trying to modify x264 (in a very primitive way: works only 
with 1 thread, sliced threads should be off) to support hierarchical-P 
coding structure (this is for my research as a student, I have zero 
commercial interests)

What I did is to rewrite "int x264_reference_update( x264_t *h )" 
function, so that the referencing structure could result in 3 temporal 
layers, where frames 0,4,8... form the base layer, frames 2,6,10,... 
form the first enhancement layer and the odd numbered frames form the 
highest layer (Figure 2 in this paper: 
http://iphome.hhi.de/wiegand/assets/pdfs/2010_12_PCS_h264.pdf)

You can find my clumsy code here: 
https://docs.google.com/document/d/1mI0hXfohpLIstKVFLQBxEJbIkJWvi2X32xK_NcdLlv8/edit?usp=sharing

I also changed the nal_ref_idc of the P frames encoded as (line 3392 in 
encode.c):

         if ( h->fenc->i_frame%4 == 0 )
             i_nal_ref_idc = NAL_PRIORITY_HIGH;
         else if ( h->fenc->i_frame%2 == 0 )
             i_nal_ref_idc = NAL_PRIORITY_LOW;
         else
             i_nal_ref_idc = NAL_PRIORITY_DISPOSABLE;

However, with these changes, even though I believe I set the reference 
pictures correctly, the decoded video has a lot of artifacts. What can I 
be doing wrong? Can the reference frames be not written correctly into 
the Macroblock headers?

Eymen Kurdoglu
>
> --Loren Merritt
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> https://mailman.videolan.org/listinfo/x264-devel



More information about the x264-devel mailing list