This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

disable_deblocking_filter_idc slice header field always 0

We are using HDVICP2 .h264 encoder version 02.00.06 and dvrrdk 4.1.

If we enable the loopfilter by making the following changes to encLink_h264.c, the disable_deblocking_filter_idc field in the slice header is still 0.  Shouldn't this be set to 1 if the loop filter is enabled?  If not, how can we configure the encoder to set this in the slice header.

Index: /dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c
===================================================================
--- dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c	(revision 525)
+++ dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c	(working copy)
@@ -1120,6 +1120,12 @@
     staticParams->vuiCodingParams.timingInfoPresentFlag = 1;
 #endif
 
+    // Enable deblocking filter
+    staticParams->loopFilterParams.loopfilterPreset = IH264_LOOPFILTER_USERDEFINED;
+    staticParams->loopFilterParams.loopfilterDisableIDC = IH264_DISABLE_FILTER_ALL_EDGES;
+    staticParams->loopFilterParams.filterOffsetA = 0;
+    staticParams->loopFilterParams.filterOffsetB = 0;
+
     return 0;
 }
 

Thanks,

  • Hi abadobid,

                 Below is the explanation for the disable_deblocking_filter_idc.

    (disable_deblocking_filter_idc = 0)  - Filtering is enabled                       

    (disable_deblocking_filter_idc = 1)  - Filtering is disabled(No Filtering)

    (disable_deblocking_filter_idc = 2)  - Filtering is disabled across slices

    Please refer standard for more details. 

                 Based on your mentioned configuration, in the slice header disable_deblocking_filter_idc should be 1( which is No filtering).

    Below is the configuration explanation -

     (loopfilterDisableIDC = 0)  - Filtering is enabled                       

    (loopfilterDisableIDC = 1)  - Filtering is disabled(No Filtering)

    (loopfilterDisableIDC = 2)  - Filtering is disabled across slices

    Regards

    Gajanan

  • Hello Gajanan,

    I'm a bit confused by the loopFIlterDisableIDC field.

    If I set it to 0, then it is very obvious from viewing the stream, that it is not being deblocked (filter disabled).  The video is very "blocky".

    If I set it to 1, then it is very obvious from viewing the stream that is is being deblocked (filter enabled).  The video is very "smooth".

    This was done with the receiving decoder having it's own deblocking filter forced off for test purposes.

    So I'm wondering if the loopFilterDisableIDC documentation is from the receiving end (decoder) perspective?

  • Hi Abadobid,

                I had mentioned in the previous mail about the understanding of the Deblocking filter according to standard(Decoder) and implemented in Codec.

    Can you please cross verify with your RDK application for the usage of the loopfilterDisableIDC. I feel that may the root cause for this confusion.

    Regards

    Gajanan

  • Hello Gajanan,

    Sorry, I think I misunderstood your post.
    So you are saying that you also think that disable_deblocking_filter_idc should be 1 with my configuration?

    Thanks
  • Hi Abadobid,

             Yes. In the Bitstream disable_deblocking_filter_idc should be 1 ( which means deblocking is disabled).

    Can you please cross verify with your RDK application for the usage of the loopfilterDisableIDC. I feel that may the root cause for this confusion.

    Regards

    Gajanan

  • Hello Gajanan,

    I'm not sure I understand what you mean by "cross verify with your RDK application for the usage of the loopfilterDisableIDC".  Do you mean the documentation of the loopFilterDisableIDC field in the RDK?


    The enumeration for it is

    /**
      
      @enum   IH264ENC_LoopFilterDisableIDC
      @brief  Control Parameter to disable loop filter at different places
      
    */
    typedef enum 
    {
      IH264_DISABLE_FILTER_NONE = 0,                              
        /**< Enable filtering of all the edges */
      IH264_DISABLE_FILTER_DEFAULT   = IH264_DISABLE_FILTER_NONE, 
        /**< Default is Loop filter enabled    */
      IH264_DISABLE_FILTER_ALL_EDGES,                             
        /**< Disable filtering of all the edge */
      IH264_DISABLE_FILTER_SLICE_EDGES,                           
        /**< Disable filtering of slice edges  */
      IH264_DISABLE_FILTER_MAX
    } IH264ENC_LoopFilterDisableIDC ;
    

    So the enumeration matches with your description from the .h264 standard.  At first this description seems very counter intuitive, since to have the encoder perform de-blocking, you have to set the field to IH264_DISABLE_FILTER_ALL_EDGES.  I assume this is because the naming used is referenced to the decoder and not the encoder.

    So with the configuration I have, the slice header disable_deblocking_filter_idc should be 1, but even though the encoder is performing the de-blocking, it is still reporting disable_deblocking_filter_id=0 when I look at the stream with an .h264 stream analyzer.

    Thanks,

  • Hi Abadobid,

            Can you send me full configuation parameters. And also upload the bitstream as well.

    Regards

    Gajanan