[x265] [PATCH 1 of 2] TComPic: add m_qpAqOffset to store qp offsets per CU when Aq is enabled

Steve Borho steve at borho.org
Wed Oct 16 22:34:30 CEST 2013


On Wed, Oct 16, 2013 at 12:55 PM, <aarthi at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Aarthi Thirumalai<aarthi at multicorewareinc.com>
> # Date 1381945688 -19800
> #      Wed Oct 16 23:18:08 2013 +0530
> # Node ID 46cdbe43d903c23169593f70c28b5d32d8f397e9
> # Parent  4b1716b232e56399cdc11abf5abb3c0b37d1c9ee
> TComPic: add m_qpAqOffset to store qp offsets per CU when Aq is enabled
>
> diff -r 4b1716b232e5 -r 46cdbe43d903 source/Lib/TLibCommon/TComPic.cpp
> --- a/source/Lib/TLibCommon/TComPic.cpp Wed Oct 16 02:35:57 2013 -0500
> +++ b/source/Lib/TLibCommon/TComPic.cpp Wed Oct 16 23:18:08 2013 +0530
> @@ -61,6 +61,7 @@
>      memset(&m_lowres, 0, sizeof(m_lowres));
>      m_next = NULL;
>      m_prev = NULL;
> +    m_qpAqOffset = NULL;
>      m_SSDY = 0;
>      m_SSDU = 0;
>      m_SSDV = 0;
> @@ -114,6 +115,7 @@
>      }
>
>      m_lowres.destroy(bframes);
> +    X265_FREE(m_qpAqOffset);
>  }
>
>  //! \}
> diff -r 4b1716b232e5 -r 46cdbe43d903 source/Lib/TLibCommon/TComPic.h
> --- a/source/Lib/TLibCommon/TComPic.h   Wed Oct 16 02:35:57 2013 -0500
> +++ b/source/Lib/TLibCommon/TComPic.h   Wed Oct 16 23:18:08 2013 +0530
> @@ -84,7 +84,7 @@
>
>      TComPic*              m_next;
>      TComPic*              m_prev;
> -
> +    double*               m_qpAqOffset;         // store qp offsets for AQ
>      UInt64                m_SSDY;
>      UInt64                m_SSDU;
>      UInt64                m_SSDV;
> diff -r 4b1716b232e5 -r 46cdbe43d903 source/encoder/encoder.cpp
> --- a/source/encoder/encoder.cpp        Wed Oct 16 02:35:57 2013 -0500
> +++ b/source/encoder/encoder.cpp        Wed Oct 16 23:18:08 2013 +0530
> @@ -174,6 +174,11 @@
>                  // NOTE: the SAO pointer from m_frameEncoder for read
> m_maxSplitLevel, etc, we can remove it later
>                  pic->getPicSym()->allocSaoParam(m_frameEncoder->getSAO());
>              }
> +
> +            if (param.rc.aqMode)
> +            {
> +                CHECKED_MALLOC(pic->m_qpAqOffset, double,
> pic->getPicSym()->getNumberOfCUsInFrame());
> +            }
>

Using CHECKED_MALLOC here is a misfeature; a malloc failure would cause the
encoder to deadlock.  it's better to use a simple x265_malloc() here and
check for malloc failures downstream, or disable aqMode here if it failed.

It would probably be simpler to move this malloc to TComPic init; where
most of the mallocs happen and where failure could be more cleanly dealt
with.


>          }
>          else
>              pic = m_freeList.popBack();
> @@ -277,6 +282,8 @@
>      }
>
>      return ret;
> +fail:
> +    return 0;
>  }
>
>  double Encoder::printSummary()
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131016/208804e9/attachment-0001.html>


More information about the x265-devel mailing list