[x265-commits] [x265] rc: Bug fixes for ABR.

Aarthi at videolan.org Aarthi at videolan.org
Wed Oct 23 02:06:10 CEST 2013


details:   http://hg.videolan.org/x265/rev/f8ab02273bdb
branches:  
changeset: 4593:f8ab02273bdb
user:      Aarthi Thirumalai
date:      Tue Oct 22 12:05:23 2013 +0530
description:
rc: Bug fixes for ABR.

remove uninitialized local variables and use values from cfg.param.rc as required.
Subject: [x265] TEncCu: nits

details:   http://hg.videolan.org/x265/rev/f1bdacac6497
branches:  
changeset: 4594:f1bdacac6497
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Tue Oct 22 15:32:06 2013 +0530
description:
TEncCu: nits
Subject: [x265] rc: Bug fixes for ABR.

details:   http://hg.videolan.org/x265/rev/e2dc3ec294a8
branches:  stable
changeset: 4595:e2dc3ec294a8
user:      Aarthi Thirumalai
date:      Tue Oct 22 12:05:23 2013 +0530
description:
rc: Bug fixes for ABR.

remove uninitialized local variables and use values from cfg.param.rc as required.
Subject: [x265] ratecontrol: use cfg->param.frameNumThreads directly; nit cleanups

details:   http://hg.videolan.org/x265/rev/cd65a3311df5
branches:  stable
changeset: 4596:cd65a3311df5
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 22 10:17:26 2013 -0500
description:
ratecontrol: use cfg->param.frameNumThreads directly; nit cleanups
Subject: [x265] Eliminating decreament in pointer index in weightp primitives

details:   http://hg.videolan.org/x265/rev/49849de33234
branches:  stable
changeset: 4597:49849de33234
user:      Shazeb Nawaz Khan <shazeb at multicorewareinc.com>
date:      Tue Oct 22 17:36:18 2013 +0530
description:
Eliminating decreament in pointer index in weightp primitives


could have been a source of possible crash
Subject: [x265] encoder: auto-padding to min CU size and set conformance window

details:   http://hg.videolan.org/x265/rev/27a149b2062c
branches:  stable
changeset: 4598:27a149b2062c
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Tue Oct 22 12:40:12 2013 +0530
description:
encoder: auto-padding to min CU size and set conformance window
Subject: [x265] ratecontrol: consistent comment style

details:   http://hg.videolan.org/x265/rev/27265ca6dd90
branches:  stable
changeset: 4599:27265ca6dd90
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 22 11:00:54 2013 -0500
description:
ratecontrol: consistent comment style
Subject: [x265] remove reduce register copy in FILTER_H4_w2_2 and FILTER_H4_w4_2 (update for linux build error)

details:   http://hg.videolan.org/x265/rev/f1045bead3b5
branches:  stable
changeset: 4600:f1045bead3b5
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 22 19:01:12 2013 +0800
description:
remove reduce register copy in FILTER_H4_w2_2 and FILTER_H4_w4_2 (update for linux build error)
Subject: [x265] cleanup: remove unused getNumberOfWrittenBits() from TEncBinCABAC::getNumWrittenBits()

details:   http://hg.videolan.org/x265/rev/af1695e1808c
branches:  stable
changeset: 4601:af1695e1808c
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 22 19:01:34 2013 +0800
description:
cleanup: remove unused getNumberOfWrittenBits() from TEncBinCABAC::getNumWrittenBits()
Subject: [x265] cleanup:remove unused base class TEncBinIf

details:   http://hg.videolan.org/x265/rev/b6427fa01195
branches:  stable
changeset: 4602:b6427fa01195
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 22 19:02:03 2013 +0800
description:
cleanup:remove unused base class TEncBinIf
Subject: [x265] cleanup: merge header operator from TEncCavlc into class TEncSbac

details:   http://hg.videolan.org/x265/rev/4ec21109440b
branches:  stable
changeset: 4603:4ec21109440b
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 22 19:02:51 2013 +0800
description:
cleanup: merge header operator from TEncCavlc into class TEncSbac
Subject: [x265] cabac: improvement performance by use negative cabac counter

details:   http://hg.videolan.org/x265/rev/88b3831ab799
branches:  stable
changeset: 4604:88b3831ab799
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 22 19:03:46 2013 +0800
description:
cabac: improvement performance by use negative cabac counter
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/88de242f7530
branches:  
changeset: 4605:88de242f7530
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 22 12:02:38 2013 -0500
description:
Merge with stable
Subject: [x265] intra-sse3.cpp: replace intraPredAng8x8 vector class function with intrinsic

details:   http://hg.videolan.org/x265/rev/de32b76c391d
branches:  
changeset: 4606:de32b76c391d
user:      Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
date:      Tue Oct 22 15:23:10 2013 +0530
description:
intra-sse3.cpp: replace intraPredAng8x8 vector class function with intrinsic
Subject: [x265] intra-sse3.cpp: replace intraPredAng32x32 vector class function with intrinsic

details:   http://hg.videolan.org/x265/rev/9827c0129014
branches:  
changeset: 4607:9827c0129014
user:      Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
date:      Tue Oct 22 12:50:46 2013 +0530
description:
intra-sse3.cpp: replace intraPredAng32x32 vector class function with intrinsic
Subject: [x265] intra: move 32x32 angular prediction function into non-vector portion

details:   http://hg.videolan.org/x265/rev/41aa6dd645ed
branches:  
changeset: 4608:41aa6dd645ed
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 22 11:41:00 2013 -0500
description:
intra: move 32x32 angular prediction function into non-vector portion
Subject: [x265] intra: rename intra-sse3.cpp to intra-ssse3.cpp

details:   http://hg.videolan.org/x265/rev/20bf892451db
branches:  
changeset: 4609:20bf892451db
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 22 12:42:52 2013 -0500
description:
intra: rename intra-sse3.cpp to intra-ssse3.cpp
Subject: [x265] pixel: converted some sad_avx2 vector class functions to intrinsic

details:   http://hg.videolan.org/x265/rev/0bb1d7221938
branches:  
changeset: 4610:0bb1d7221938
user:      Yuvaraj Venkatesh <yuvaraj at multicorewareinc.com>
date:      Tue Oct 22 13:18:21 2013 +0530
description:
pixel: converted some sad_avx2 vector class functions to intrinsic
Subject: [x265] slicetype: calculate weighted frame costs for Aq

details:   http://hg.videolan.org/x265/rev/6d96d64c4e9a
branches:  
changeset: 4611:6d96d64c4e9a
user:      Aarthi Thirumalai<aarthi at multicorewareinc.com>
date:      Tue Oct 22 23:36:36 2013 +0530
description:
slicetype: calculate weighted frame costs for Aq

diffstat:

 source/Lib/TLibCommon/TComPicYuv.cpp         |   101 +-
 source/Lib/TLibCommon/TComPicYuv.h           |     2 +-
 source/Lib/TLibEncoder/TEncBinCoder.h        |    81 -
 source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp |    44 +-
 source/Lib/TLibEncoder/TEncBinCoderCABAC.h   |    19 +-
 source/Lib/TLibEncoder/TEncCavlc.cpp         |  1345 ---------
 source/Lib/TLibEncoder/TEncCavlc.h           |   155 -
 source/Lib/TLibEncoder/TEncCu.cpp            |     5 -
 source/Lib/TLibEncoder/TEncSbac.cpp          |  1116 +++++++-
 source/Lib/TLibEncoder/TEncSbac.h            |    36 +-
 source/common/CMakeLists.txt                 |    10 +-
 source/common/common.cpp                     |     4 -
 source/common/pixel.cpp                      |    12 +-
 source/common/vec/intra-sse3.cpp             |  3800 --------------------------
 source/common/vec/intra-ssse3.cpp            |  3737 +++++++++++++++++++++++++
 source/common/vec/pixel-avx2.cpp             |   459 +-
 source/common/vec/vec-primitives.cpp         |     4 +-
 source/common/x86/ipfilter8.asm              |     8 +-
 source/encoder/CMakeLists.txt                |     3 -
 source/encoder/encoder.cpp                   |    34 +-
 source/encoder/frameencoder.cpp              |    12 +-
 source/encoder/frameencoder.h                |     2 -
 source/encoder/ratecontrol.cpp               |    85 +-
 source/encoder/ratecontrol.h                 |    33 +-
 source/encoder/slicetype.cpp                 |    50 +-
 25 files changed, 5401 insertions(+), 5756 deletions(-)

diffs (truncated from 12058 to 300 lines):

diff -r 9245a882ccee -r 6d96d64c4e9a source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Mon Oct 21 22:45:55 2013 -0500
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Tue Oct 22 23:36:36 2013 +0530
@@ -357,7 +357,7 @@ void TComPicYuv::dump(char* pFileName, b
  * Upscale pixels from 8bits to 16 bits when required, but do not modify pixels.
  * This new routine is GPL
  */
-void TComPicYuv::copyFromPicture(const x265_picture_t& pic)
+void TComPicYuv::copyFromPicture(const x265_picture_t& pic, int *pad)
 {
     Pel *Y = getLumaAddr();
     Pel *U = getCbAddr();
@@ -367,15 +367,22 @@ void TComPicYuv::copyFromPicture(const x
     uint8_t *u = (uint8_t*)pic.planes[1];
     uint8_t *v = (uint8_t*)pic.planes[2];
 
+    int padx = pad[0];
+    int pady = pad[1];
+
 #if HIGH_BIT_DEPTH
     if (sizeof(Pel) * 8 > pic.bitDepth)
     {
         assert(pic.bitDepth == 8);
 
+        /* width and height - without padsize */
+        int width = m_picWidth - padx;
+        int height = m_picHeight - pady;
+
         // Manually copy pixels to up-size them
-        for (int r = 0; r < m_picHeight; r++)
+        for (int r = 0; r < height; r++)
         {
-            for (int c = 0; c < m_picWidth; c++)
+            for (int c = 0; c < width; c++)
             {
                 Y[c] = (Pel)y[c];
             }
@@ -384,9 +391,9 @@ void TComPicYuv::copyFromPicture(const x
             y += pic.stride[0];
         }
 
-        for (int r = 0; r < m_picHeight >> 1; r++)
+        for (int r = 0; r < height >> 1; r++)
         {
-            for (int c = 0; c < m_picWidth >> 1; c++)
+            for (int c = 0; c < width >> 1; c++)
             {
                 U[c] = (Pel)u[c];
                 V[c] = (Pel)v[c];
@@ -397,30 +404,108 @@ void TComPicYuv::copyFromPicture(const x
             u += pic.stride[1];
             v += pic.stride[2];
         }
+
+        /* Extend the right if width is not multiple of minimum CU size */
+
+        if (padx)
+        {
+            Y = getLumaAddr();
+            U = getCbAddr();
+            V = getCrAddr();
+
+            for (int r = 0; r < height; r++)
+            {
+                for (int x = 0; x < padx; x++)
+                    Y[width + x] = Y[width - 1];
+                Y += getStride();
+            }
+
+            for (int r = 0; r < height >> 1; r++)
+            {
+                for (int x = 0; x < padx >> 1; x++)
+                {
+                    U[(width >> 1) + x] = U[(width >> 1) - 1];
+                    V[(width >> 1) + x] = V[(width >> 1) - 1];
+                }
+                U += getCStride();
+                V += getCStride();
+            }
+        }
+
+        /* extend the bottom if height is not multiple of the minimum CU size */
+        if (pady)
+        {
+            width = m_picWidth;
+            Y = getLumaAddr() + (height - 1) * getStride();
+            U = getCbAddr() + ((height >> 1) - 1) * getCStride();
+            V = getCrAddr() + ((height >> 1) - 1) * getCStride();
+
+            for (uint32_t i = 1; i <= pady; i++)
+                memcpy(Y + i * getStride(), Y, width * sizeof(Pel));
+
+            for (uint32_t j = 1; j <= pady >> 1; j++)
+            {
+                memcpy(U + j * getCStride(), U, (width >> 1) * sizeof(Pel));
+                memcpy(V + j * getCStride(), V, (width >> 1) * sizeof(Pel));
+            }
+        }
     }
     else
 #endif // if HIGH_BIT_DEPTH
     {
-        int width = m_picWidth * (pic.bitDepth > 8 ? 2 : 1);
+
+        /* width and height - without padsize */
+        int width = (m_picWidth * (pic.bitDepth > 8 ? 2 : 1)) - padx;
+        int height = m_picHeight - pady;
 
         // copy pixels by row into encoder's buffer
-        for (int r = 0; r < m_picHeight; r++)
+        for (int r = 0; r < height; r++)
         {
             memcpy(Y, y, width);
 
+            /* extend the right if width is not multiple of the minimum CU size */
+            if (padx)
+                ::memset(Y + width, Y[width - 1], padx);
+
             Y += getStride();
             y += pic.stride[0];
+
         }
 
-        for (int r = 0; r < m_picHeight >> 1; r++)
+        for (int r = 0; r < height >> 1; r++)
         {
             memcpy(U, u, width >> 1);
             memcpy(V, v, width >> 1);
 
+            /* extend the right if width is not multiple of the minimum CU size */
+            if (padx)
+            {
+                ::memset(U + (width >> 1), U[(width >> 1) - 1], padx >> 1);
+                ::memset(V + (width >> 1), V[(width >> 1) - 1], padx >> 1);
+            }
+
             U += getCStride();
             V += getCStride();
             u += pic.stride[1];
             v += pic.stride[2];
         }
+
+        /* extend the bottom if height is not multiple of the minimum CU size */
+        if (pady)
+        {
+            width = m_picWidth;
+            Y = getLumaAddr() + (height - 1) * getStride();
+            U = getCbAddr() + ((height >> 1) - 1) * getCStride();
+            V = getCrAddr() + ((height >> 1) - 1) * getCStride();
+
+            for (uint32_t i = 1; i <= pady; i++)
+                memcpy(Y + i * getStride(), Y, width * sizeof(pixel));
+
+            for (uint32_t j = 1; j <= pady >> 1; j++)
+            {
+                memcpy(U + j * getCStride(), U, (width >> 1) * sizeof(pixel));
+                memcpy(V + j * getCStride(), V, (width >> 1) * sizeof(pixel));
+            }
+        }
     }
 }
diff -r 9245a882ccee -r 6d96d64c4e9a source/Lib/TLibCommon/TComPicYuv.h
--- a/source/Lib/TLibCommon/TComPicYuv.h	Mon Oct 21 22:45:55 2013 -0500
+++ b/source/Lib/TLibCommon/TComPicYuv.h	Tue Oct 22 23:36:36 2013 +0530
@@ -178,7 +178,7 @@ public:
     void  copyToPicLuma(TComPicYuv* destYuv);
     void  copyToPicCb(TComPicYuv* destYuv);
     void  copyToPicCr(TComPicYuv* destYuv);
-    void  copyFromPicture(const x265_picture_t&);
+    void  copyFromPicture(const x265_picture_t&, int *pad);
 
     MotionReference* generateMotionReference(wpScalingParam *w);
 
diff -r 9245a882ccee -r 6d96d64c4e9a source/Lib/TLibEncoder/TEncBinCoder.h
--- a/source/Lib/TLibEncoder/TEncBinCoder.h	Mon Oct 21 22:45:55 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* The copyright in this software is being made available under the BSD
- * License, included below. This software may be subject to other third party
- * and contributor rights, including patent rights, and no such rights are
- * granted under this license.
- *
- * Copyright (c) 2010-2013, ITU/ISO/IEC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
- *    be used to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** \file     TEncBinCoder.h
-    \brief    binary entropy encoder interface
-*/
-
-#ifndef X265_TENCBINCODER_H
-#define X265_TENCBINCODER_H
-
-#include "TLibCommon/ContextModel.h"
-#include "TLibCommon/TComBitStream.h"
-
-//! \ingroup TLibEncoder
-//! \{
-
-namespace x265 {
-// private namespace
-
-class TEncBinCABAC;
-
-class TEncBinIf
-{
-public:
-
-    virtual void  init(TComBitIf* bitIf) = 0;
-    virtual void  uninit() = 0;
-
-    virtual void  start() = 0;
-    virtual void  finish() = 0;
-    virtual void  copyState(TEncBinIf* binIf) = 0;
-    virtual void  flush() = 0;
-
-    virtual void  resetBac() = 0;
-    virtual void  encodePCMAlignBits() = 0;
-    virtual void  xWritePCMCode(UInt code, UInt length) = 0;
-
-    virtual void  resetBits() = 0;
-    virtual UInt  getNumWrittenBits() = 0;
-
-    virtual void  encodeBin(UInt bin,  ContextModel& ctx) = 0;
-    virtual void  encodeBinEP(UInt bin) = 0;
-    virtual void  encodeBinsEP(UInt bins, int numBins) = 0;
-    virtual void  encodeBinTrm(UInt bin) = 0;
-
-    virtual ~TEncBinIf() {}
-};
-}
-//! \}
-
-#endif // ifndef X265_TENCBINCODER_H
diff -r 9245a882ccee -r 6d96d64c4e9a source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
--- a/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Mon Oct 21 22:45:55 2013 -0500
+++ b/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Tue Oct 22 23:36:36 2013 +0530
@@ -66,7 +66,7 @@ void TEncBinCABAC::start()
 {
     m_low              = 0;
     m_range            = 510;
-    m_bitsLeft         = 23;
+    m_bitsLeft         = -12;
     m_numBufferedBytes = 0;
     m_bufferedByte     = 0xff;
 }
@@ -81,7 +81,7 @@ void TEncBinCABAC::finish()
         assert(0);
     }
 
-    if (m_low >> (32 - m_bitsLeft))
+    if (m_low >> (21 + m_bitsLeft))
     {
         //assert( m_numBufferedBytes > 0 );
         //assert( m_bufferedByte != 0xff );
@@ -92,7 +92,7 @@ void TEncBinCABAC::finish()
             m_numBufferedBytes--;
         }
 
-        m_low -= 1 << (32 - m_bitsLeft);
+        m_low -= 1 << (21 + m_bitsLeft);
     }
     else
     {
@@ -106,7 +106,7 @@ void TEncBinCABAC::finish()
             m_numBufferedBytes--;
         }
     }
-    m_bitIf->write(m_low >> 8, 24 - m_bitsLeft);
+    m_bitIf->write(m_low >> 8, 13 + m_bitsLeft);
 }
 
 void TEncBinCABAC::flush()
@@ -147,10 +147,8 @@ void TEncBinCABAC::xWritePCMCode(UInt co
     m_bitIf->write(code, length);
 }


More information about the x265-commits mailing list