[x265-commits] [x265] cabac: cleanup array of cabac context

Min Chen chenm003 at 163.com
Tue Oct 22 05:25:08 CEST 2013


details:   http://hg.videolan.org/x265/rev/15588437fc24
branches:  
changeset: 4563:15588437fc24
user:      Min Chen <chenm003 at 163.com>
date:      Mon Oct 21 15:59:28 2013 +0800
description:
cabac: cleanup array of cabac context
Subject: [x265] intra-sse: Fix for HIGH_BIT_DEPTH build error

details:   http://hg.videolan.org/x265/rev/8fc308449916
branches:  
changeset: 4564:8fc308449916
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Oct 21 14:09:12 2013 +0530
description:
intra-sse: Fix for HIGH_BIT_DEPTH build error
Subject: [x265] bug fix for passing bLuma and bChroma as separate arguments

details:   http://hg.videolan.org/x265/rev/b2aa2aad2c66
branches:  
changeset: 4565:b2aa2aad2c66
user:      Sumalatha Polureddy
date:      Mon Oct 21 12:55:18 2013 +0530
description:
bug fix for passing bLuma and bChroma as separate arguments

if there are default arguments other than bLuma and bChroma, those default values
(bRound, refIdx) are not passed during the function call(addWeightBi(),
xWeightedPredictionUni())
Subject: [x265] lowres: right and bottom margins are being extended twice?

details:   http://hg.videolan.org/x265/rev/f987c24c7bf2
branches:  
changeset: 4566:f987c24c7bf2
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Oct 21 16:15:22 2013 +0530
description:
lowres: right and bottom margins are being extended twice?
Subject: [x265] [x265] ratecontrol: initialize frameThreads

details:   http://hg.videolan.org/x265/rev/3fe9a9d0a0b6
branches:  
changeset: 4567:3fe9a9d0a0b6
user:      =?utf-8?b?UmFmYcOrbCBDYXJyw6kgPGZ1bm1hbkB2aWRlb2xhbi5vcmc+?=
date:      Mon Oct 21 22:12:39 2013 +0530
description:
[x265] ratecontrol: initialize frameThreads
Fix a floating point exceptio

---
source/encoder/ratecontrol.cpp | 1 +
 1 file changed, 1 insertion(+)
Subject: [x265] Lookahead: wavefront bugfix.

details:   http://hg.videolan.org/x265/rev/92d13feba8fe
branches:  
changeset: 4568:92d13feba8fe
user:      Deepthi Devaki <deepthidevaki at multicorewareinc.com>
date:      Mon Oct 21 16:21:19 2013 +0530
description:
Lookahead: wavefront bugfix.

conditionally assign estimated cost to avoid overwriting intra cost.
Subject: [x265] cli: reintroduce -w short option for weightp

details:   http://hg.videolan.org/x265/rev/c4cc469e5286
branches:  
changeset: 4569:c4cc469e5286
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 12:52:36 2013 -0500
description:
cli: reintroduce -w short option for weightp
Subject: [x265] tenccfg : removed unused setpad() and getpad() methods

details:   http://hg.videolan.org/x265/rev/caa8db6b7986
branches:  
changeset: 4570:caa8db6b7986
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Mon Oct 21 14:22:49 2013 +0530
description:
tenccfg : removed unused setpad() and getpad() methods
Subject: [x265] tcomslice : removed set and get window*offset() methods

details:   http://hg.videolan.org/x265/rev/ee5ef0f3fd3d
branches:  
changeset: 4571:ee5ef0f3fd3d
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Mon Oct 21 14:46:34 2013 +0530
description:
tcomslice : removed set and get window*offset() methods
Subject: [x265] added array of function pointers for chroma ipfilter_vpp function

details:   http://hg.videolan.org/x265/rev/e3b4b6b778a5
branches:  
changeset: 4572:e3b4b6b778a5
user:      Praveen Tiwari
date:      Mon Oct 21 15:54:15 2013 +0530
description:
added array of function pointers for chroma ipfilter_vpp function
Subject: [x265] ipfilterharness.cpp, added test correctness code for ipfilter_vpp function

details:   http://hg.videolan.org/x265/rev/e42826e06e06
branches:  
changeset: 4573:e42826e06e06
user:      Praveen Tiwari
date:      Mon Oct 21 16:32:54 2013 +0530
description:
ipfilterharness.cpp, added test correctness code for ipfilter_vpp function
Subject: [x265] ipfilterharness.cpp, added measure speed code for ipfilter_vpp function

details:   http://hg.videolan.org/x265/rev/091fb24735da
branches:  
changeset: 4574:091fb24735da
user:      Praveen Tiwari
date:      Mon Oct 21 16:48:19 2013 +0530
description:
ipfilterharness.cpp, added measure speed code for ipfilter_vpp function
Subject: [x265] ipfilterharness.cpp, modified chroma filter_hpp unit test code to support filter_vpp

details:   http://hg.videolan.org/x265/rev/60ade24dbf9b
branches:  
changeset: 4575:60ade24dbf9b
user:      Praveen Tiwari
date:      Mon Oct 21 18:14:24 2013 +0530
description:
ipfilterharness.cpp, modified chroma filter_hpp unit test code to support filter_vpp
Subject: [x265] created function declerations for chroma_vpp

details:   http://hg.videolan.org/x265/rev/9477665dd935
branches:  
changeset: 4576:9477665dd935
user:      Praveen Tiwari
date:      Mon Oct 21 18:27:13 2013 +0530
description:
created function declerations for chroma_vpp
Subject: [x265] added C code for chroma filter_vpp function

details:   http://hg.videolan.org/x265/rev/2e0076f3f694
branches:  
changeset: 4577:2e0076f3f694
user:      Praveen Tiwari
date:      Mon Oct 21 18:46:53 2013 +0530
description:
added C code for chroma filter_vpp function
Subject: [x265] ipfilter: cleanup C and intrinsic functions

details:   http://hg.videolan.org/x265/rev/90dde3b44ada
branches:  
changeset: 4578:90dde3b44ada
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 14:16:35 2013 -0500
description:
ipfilter: cleanup C and intrinsic functions
Subject: [x265] Adapting weightp primitive for pixel input

details:   http://hg.videolan.org/x265/rev/e719f0de8d9c
branches:  
changeset: 4579:e719f0de8d9c
user:      Shazeb Nawaz Khan <shazeb at multicorewareinc.com>
date:      Mon Oct 21 16:51:07 2013 +0530
description:
Adapting weightp primitive for pixel input

By simulating shift & round as in convertPixelToShort primitive.  The SSE4.1
intrinsic primitives are disabled because they no longer match
Subject: [x265] no-rdo: compute Luma only in MC for cost estimation for mode decision

details:   http://hg.videolan.org/x265/rev/16a5fc504005
branches:  
changeset: 4580:16a5fc504005
user:      Sumalatha Polureddy
date:      Mon Oct 21 14:51:32 2013 +0530
description:
no-rdo: compute Luma only in MC for cost estimation for mode decision

luma alone is computed in MC since luma cost alone is used for mode decision.
After best mode is selected, before encoding, chroma MC is done
Subject: [x265] intra-sse3.cpp: replace predIntraAng8_32 vector class function with intrinsic

details:   http://hg.videolan.org/x265/rev/e24a4bb6de84
branches:  
changeset: 4581:e24a4bb6de84
user:      Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
date:      Mon Oct 21 11:53:06 2013 +0530
description:
intra-sse3.cpp: replace predIntraAng8_32 vector class function with intrinsic
Subject: [x265] compress: replace magic numbers with proper enums

details:   http://hg.videolan.org/x265/rev/505b1c488b39
branches:  
changeset: 4582:505b1c488b39
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 17:56:26 2013 -0500
description:
compress: replace magic numbers with proper enums
Subject: [x265] compress: remove pointer reference from xComputeCostIntraInInter and simplify

details:   http://hg.videolan.org/x265/rev/c1ee22ece6f5
branches:  
changeset: 4583:c1ee22ece6f5
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 18:03:26 2013 -0500
description:
compress: remove pointer reference from xComputeCostIntraInInter and simplify
Subject: [x265] compress: remove a pile of unnecessary intra estimation code

details:   http://hg.videolan.org/x265/rev/dd26e0a9c3df
branches:  
changeset: 4584:dd26e0a9c3df
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 18:12:39 2013 -0500
description:
compress: remove a pile of unnecessary intra estimation code
Subject: [x265] merge multiple encodeBinEP to encodeBinsEP

details:   http://hg.videolan.org/x265/rev/6817f34b0572
branches:  
changeset: 4585:6817f34b0572
user:      Min Chen <chenm003 at 163.com>
date:      Mon Oct 21 20:37:04 2013 +0800
description:
merge multiple encodeBinEP to encodeBinsEP
Subject: [x265] Merge with default (feature freeze for 0.5)

details:   http://hg.videolan.org/x265/rev/f2fcda06d76a
branches:  stable
changeset: 4586:f2fcda06d76a
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 21:42:23 2013 -0500
description:
Merge with default (feature freeze for 0.5)
Subject: [x265] lowres: move m_qpAqOffset from TComPic to Lowres

details:   http://hg.videolan.org/x265/rev/588c8fcc1df6
branches:  
changeset: 4587:588c8fcc1df6
user:      Aarthi Thirumalai<aarthi at multicorewareinc.com>
date:      Mon Oct 21 22:14:23 2013 +0530
description:
lowres: move m_qpAqOffset from TComPic to Lowres
Subject: [x265] add methods to convert qpAqoffsets to qscale

details:   http://hg.videolan.org/x265/rev/afa3a6660764
branches:  
changeset: 4588:afa3a6660764
user:      Aarthi Thirumalai<aarthi at multicorewareinc.com>
date:      Mon Oct 21 22:36:03 2013 +0530
description:
add methods to convert qpAqoffsets to qscale
Subject: [x265] lowres: Add states to store weighted Aq costs per frame.

details:   http://hg.videolan.org/x265/rev/ee5e9caa0ff9
branches:  
changeset: 4589:ee5e9caa0ff9
user:      Aarthi Thirumalai<aarthi at multicorewareinc.com>
date:      Mon Oct 21 22:48:35 2013 +0530
description:
lowres: Add states to store weighted Aq costs per frame.
Subject: [x265] lowres: initialize satdCost to -1

details:   http://hg.videolan.org/x265/rev/606cdb8d05ef
branches:  
changeset: 4590:606cdb8d05ef
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 21 22:24:36 2013 -0500
description:
lowres: initialize satdCost to -1

diffstat:

 source/Lib/TLibCommon/ContextModel3DBuffer.cpp |  122 -------
 source/Lib/TLibCommon/ContextModel3DBuffer.h   |   96 -----
 source/Lib/TLibCommon/ContextTables.h          |   30 +
 source/Lib/TLibCommon/TComDataCU.cpp           |    6 +-
 source/Lib/TLibCommon/TComDataCU.h             |    2 +-
 source/Lib/TLibCommon/TComPic.cpp              |   13 +-
 source/Lib/TLibCommon/TComPic.h                |    1 -
 source/Lib/TLibCommon/TComPrediction.cpp       |    6 +-
 source/Lib/TLibCommon/TComRom.cpp              |    8 +
 source/Lib/TLibCommon/TComRom.h                |    1 +
 source/Lib/TLibCommon/TComSlice.h              |   33 +-
 source/Lib/TLibCommon/TComWeightPrediction.cpp |    4 +-
 source/Lib/TLibEncoder/TEncCavlc.cpp           |   24 +-
 source/Lib/TLibEncoder/TEncCfg.h               |   11 +-
 source/Lib/TLibEncoder/TEncCu.h                |    2 +-
 source/Lib/TLibEncoder/TEncSbac.cpp            |  425 +++++++++++-------------
 source/Lib/TLibEncoder/TEncSbac.h              |   43 +--
 source/Lib/TLibEncoder/TEncSearch.cpp          |    3 +-
 source/common/CMakeLists.txt                   |    2 -
 source/common/common.cpp                       |    9 +
 source/common/common.h                         |    2 +-
 source/common/ipfilter.cpp                     |  299 ++++++-----------
 source/common/lowres.cpp                       |   35 +-
 source/common/lowres.h                         |    5 +-
 source/common/pixel.cpp                        |   31 +-
 source/common/primitives.h                     |    1 +
 source/common/vec/intra-sse3.cpp               |   36 +-
 source/common/vec/ipfilter-sse41.cpp           |   34 +-
 source/common/vec/ipfilter-ssse3.cpp           |    8 +-
 source/common/vec/pixel-sse41.cpp              |    4 +-
 source/common/x86/ipfilter8.h                  |    3 +-
 source/encoder/compress.cpp                    |  230 ++++++-------
 source/encoder/encoder.cpp                     |   16 +-
 source/encoder/framefilter.cpp                 |    2 +-
 source/encoder/ratecontrol.cpp                 |    3 +-
 source/encoder/slicetype.cpp                   |    6 +-
 source/encoder/slicetype.h                     |    2 +
 source/test/ipfilterharness.cpp                |   63 ++-
 source/x265.cpp                                |    2 +-
 39 files changed, 645 insertions(+), 978 deletions(-)

diffs (truncated from 2986 to 300 lines):

diff -r fabb25ae4db4 -r 606cdb8d05ef source/Lib/TLibCommon/ContextModel3DBuffer.cpp
--- a/source/Lib/TLibCommon/ContextModel3DBuffer.cpp	Sat Oct 19 18:08:07 2013 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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     ContextModel3DBuffer.cpp
-    \brief    context model 3D buffer class
-*/
-
-#include "ContextModel3DBuffer.h"
-
-using namespace x265;
-
-//! \ingroup TLibCommon
-//! \{
-
-// ====================================================================================================================
-// Constructor / destructor / initialization / destroy
-// ====================================================================================================================
-
-ContextModel3DBuffer::ContextModel3DBuffer(UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count)
-    : m_sizeXYZ(uiSizeX * uiSizeY)
-{
-    // allocate 3D buffer
-    m_contextModel = basePtr;
-    count += m_sizeXYZ;
-}
-
-// ====================================================================================================================
-// Public member functions
-// ====================================================================================================================
-
-/**
- * Initialize 3D buffer with respect to slicetype, QP and given initial probability table
- *
- * \param  sliceType      slice type
- * \param  qp             input QP value
- * \param  psCtxModel      given probability table
- */
-void ContextModel3DBuffer::initBuffer(SliceType sliceType, int qp, UChar* ctxModel)
-{
-    ctxModel += sliceType * m_sizeXYZ;
-
-    for (int n = 0; n < m_sizeXYZ; n++)
-    {
-        m_contextModel[n].init(qp, ctxModel[n]);
-        m_contextModel[n].setBinsCoded(0);
-    }
-}
-
-/**
- * Calculate the cost of choosing a probability table based on the current probability of CABAC at encoder
- *
- * \param  sliceType      slice type
- * \param  qp             input QP value
- * \param  ctxModel      given probability table
- */
-UInt ContextModel3DBuffer::calcCost(SliceType sliceType, int qp, UChar* ctxModel)
-{
-    UInt cost = 0;
-
-    ctxModel += sliceType * m_sizeXYZ;
-
-    for (int n = 0; n < m_sizeXYZ; n++)
-    {
-        ContextModel tmpContextModel;
-        tmpContextModel.init(qp, ctxModel[n]);
-
-        // Map the 64 CABAC states to their corresponding probability values
-        static double aStateToProbLPS[] = { 0.50000000, 0.47460857, 0.45050660, 0.42762859, 0.40591239, 0.38529900, 0.36573242, 0.34715948, 0.32952974, 0.31279528, 0.29691064, 0.28183267, 0.26752040, 0.25393496, 0.24103941, 0.22879875, 0.21717969, 0.20615069, 0.19568177, 0.18574449, 0.17631186, 0.16735824, 0.15885931, 0.15079198, 0.14313433, 0.13586556, 0.12896592, 0.12241667, 0.11620000, 0.11029903, 0.10469773, 0.09938088, 0.09433404, 0.08954349, 0.08499621, 0.08067986, 0.07658271, 0.07269362, 0.06900203, 0.06549791, 0.06217174, 0.05901448, 0.05601756, 0.05317283, 0.05047256, 0.04790942, 0.04547644, 0.04316702, 0.04097487, 0.03889405, 0.03691890, 0.03504406, 0.03326442, 0.03157516, 0.02997168, 0.02844963, 0.02700488, 0.02563349, 0.02433175, 0.02309612, 0.02192323, 0.02080991, 0.01975312, 0.01875000 };
-
-        double probLPS          = aStateToProbLPS[m_contextModel[n].getState()];
-        double prob0, prob1;
-        if (m_contextModel[n].getMps() == 1)
-        {
-            prob0 = probLPS;
-            prob1 = 1.0 - prob0;
-        }
-        else
-        {
-            prob1 = probLPS;
-            prob0 = 1.0 - prob1;
-        }
-
-        if (m_contextModel[n].getBinsCoded() > 0)
-        {
-            cost += (UInt)(prob0 * tmpContextModel.getEntropyBits(0) + prob1 * tmpContextModel.getEntropyBits(1));
-        }
-    }
-
-    return cost;
-}
-
-//! \}
diff -r fabb25ae4db4 -r 606cdb8d05ef source/Lib/TLibCommon/ContextModel3DBuffer.h
--- a/source/Lib/TLibCommon/ContextModel3DBuffer.h	Sat Oct 19 18:08:07 2013 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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     ContextModel3DBuffer.h
-    \brief    context model 3D buffer class (header)
-*/
-
-#ifndef X265_CONTEXTMODEL3DBUFFER_H
-#define X265_CONTEXTMODEL3DBUFFER_H
-
-#include <stdio.h>
-#include <assert.h>
-#include <memory.h>
-
-#include "CommonDef.h"
-#include "ContextModel.h"
-
-//! \ingroup TLibCommon
-//! \{
-
-// ====================================================================================================================
-// Class definition
-// ====================================================================================================================
-
-namespace x265 {
-// private namespace
-
-/// context model 3D buffer class
-class ContextModel3DBuffer
-{
-protected:
-
-    ContextModel* m_contextModel; ///< array of context models
-    const UInt    m_sizeXYZ;    ///< total size of 3D buffer
-
-    ContextModel3DBuffer& operator =(const ContextModel3DBuffer&);
-
-public:
-
-    ContextModel3DBuffer(UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count);
-    ~ContextModel3DBuffer() {}
-
-    // access functions
-    ContextModel& get(UInt uiX)
-    {
-        return m_contextModel[uiX];
-    }
-
-    // initialization & copy functions
-    void initBuffer(SliceType sliceType, int qp, UChar* ctxModel);          ///< initialize 3D buffer by slice type & QP
-
-    UInt calcCost(SliceType sliceType, int qp, UChar* ctxModel);      ///< determine cost of choosing a probability table based on current probabilities
-
-    /** copy from another buffer
-     * \param src buffer to copy from
-     */
-    void copyFrom(ContextModel3DBuffer* src)
-    {
-        assert(m_sizeXYZ == src->m_sizeXYZ);
-        ::memcpy(m_contextModel, src->m_contextModel, sizeof(ContextModel) * m_sizeXYZ);
-    }
-};
-}
-//! \}
-
-#endif // ifndef X265_CONTEXTMODEL3DBUFFER_H
diff -r fabb25ae4db4 -r 606cdb8d05ef source/Lib/TLibCommon/ContextTables.h
--- a/source/Lib/TLibCommon/ContextTables.h	Sat Oct 19 18:08:07 2013 +0800
+++ b/source/Lib/TLibCommon/ContextTables.h	Mon Oct 21 22:24:36 2013 -0500
@@ -94,6 +94,36 @@
 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX  1
 #define CNU                          154      ///< dummy initialization value for unused context models 'Context model Not Used'
 
+// Offset for context
+#define OFF_SPLIT_FLAG_CTX                  (0)
+#define OFF_SKIP_FLAG_CTX                   (OFF_SPLIT_FLAG_CTX         +     NUM_SPLIT_FLAG_CTX)
+#define OFF_MERGE_FLAG_EXT_CTX              (OFF_SKIP_FLAG_CTX          +     NUM_SKIP_FLAG_CTX)
+#define OFF_MERGE_IDX_EXT_CTX               (OFF_MERGE_FLAG_EXT_CTX     +     NUM_MERGE_FLAG_EXT_CTX)
+#define OFF_PART_SIZE_CTX                   (OFF_MERGE_IDX_EXT_CTX      +     NUM_MERGE_IDX_EXT_CTX)
+#define OFF_PRED_MODE_CTX                   (OFF_PART_SIZE_CTX          +     NUM_PART_SIZE_CTX)
+#define OFF_ADI_CTX                         (OFF_PRED_MODE_CTX          +     NUM_PRED_MODE_CTX)
+#define OFF_CHROMA_PRED_CTX                 (OFF_ADI_CTX                +     NUM_ADI_CTX)
+#define OFF_DELTA_QP_CTX                    (OFF_CHROMA_PRED_CTX        +     NUM_CHROMA_PRED_CTX)
+#define OFF_INTER_DIR_CTX                   (OFF_DELTA_QP_CTX           +     NUM_DELTA_QP_CTX)
+#define OFF_REF_NO_CTX                      (OFF_INTER_DIR_CTX          +     NUM_INTER_DIR_CTX)
+#define OFF_MV_RES_CTX                      (OFF_REF_NO_CTX             +     NUM_REF_NO_CTX)
+#define OFF_QT_CBF_CTX                      (OFF_MV_RES_CTX             +     NUM_MV_RES_CTX)
+#define OFF_TRANS_SUBDIV_FLAG_CTX           (OFF_QT_CBF_CTX             + 2 * NUM_QT_CBF_CTX)
+#define OFF_QT_ROOT_CBF_CTX                 (OFF_TRANS_SUBDIV_FLAG_CTX  +     NUM_TRANS_SUBDIV_FLAG_CTX)
+#define OFF_SIG_CG_FLAG_CTX                 (OFF_QT_ROOT_CBF_CTX        +     NUM_QT_ROOT_CBF_CTX)
+#define OFF_SIG_FLAG_CTX                    (OFF_SIG_CG_FLAG_CTX        + 2 * NUM_SIG_CG_FLAG_CTX)
+#define OFF_CTX_LAST_FLAG_X                 (OFF_SIG_FLAG_CTX           +     NUM_SIG_FLAG_CTX)
+#define OFF_CTX_LAST_FLAG_Y                 (OFF_CTX_LAST_FLAG_X        + 2 * NUM_CTX_LAST_FLAG_XY)
+#define OFF_ONE_FLAG_CTX                    (OFF_CTX_LAST_FLAG_Y        + 2 * NUM_CTX_LAST_FLAG_XY)
+#define OFF_ABS_FLAG_CTX                    (OFF_ONE_FLAG_CTX           +     NUM_ONE_FLAG_CTX)
+#define OFF_MVP_IDX_CTX                     (OFF_ABS_FLAG_CTX           +     NUM_ABS_FLAG_CTX)
+#define OFF_CU_AMP_CTX                      (OFF_MVP_IDX_CTX            +     NUM_MVP_IDX_CTX)
+#define OFF_SAO_MERGE_FLAG_CTX              (OFF_CU_AMP_CTX             +     NUM_CU_AMP_CTX)
+#define OFF_SAO_TYPE_IDX_CTX                (OFF_SAO_MERGE_FLAG_CTX     +     NUM_SAO_MERGE_FLAG_CTX)
+#define OFF_TRANSFORMSKIP_FLAG_CTX          (OFF_SAO_TYPE_IDX_CTX       +     NUM_SAO_TYPE_IDX_CTX)
+#define OFF_CU_TRANSQUANT_BYPASS_FLAG_CTX   (OFF_TRANSFORMSKIP_FLAG_CTX + 2 * NUM_TRANSFORMSKIP_FLAG_CTX)
+#define MAX_OFF_CTX_MOD                     (OFF_CU_TRANSQUANT_BYPASS_FLAG_CTX + NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX)
+
 // ====================================================================================================================
 // Tables
 // ====================================================================================================================
diff -r fabb25ae4db4 -r 606cdb8d05ef source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Sat Oct 19 18:08:07 2013 +0800
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Mon Oct 21 22:24:36 2013 -0500
@@ -1317,12 +1317,11 @@ void TComDataCU::getAllowedChromaDir(UIn
 *\param   piMode          it is set with MPM mode in case both MPM are equal. It is used to restrict RD search at encode side.
 *\returns Number of MPM
 */
-int TComDataCU::getIntraDirLumaPredictor(UInt absPartIdx, int* intraDirPred, int* modes)
+void TComDataCU::getIntraDirLumaPredictor(UInt absPartIdx, int* intraDirPred, int* modes)
 {
     TComDataCU* tempCU;
     UInt        tempPartIdx;
     int         leftIntraDir, aboveIntraDir;
-    int         predNum = 0;
 
     // Get intra direction of left PU
     tempCU = getPULeft(tempPartIdx, m_absIdxInLCU + absPartIdx);
@@ -1334,7 +1333,6 @@ int TComDataCU::getIntraDirLumaPredictor
 
     aboveIntraDir = tempCU ? (tempCU->isIntra(tempPartIdx) ? tempCU->getLumaIntraDir(tempPartIdx) : DC_IDX) : DC_IDX;
 
-    predNum = 3;
     if (leftIntraDir == aboveIntraDir)
     {
         if (modes)
@@ -1373,8 +1371,6 @@ int TComDataCU::getIntraDirLumaPredictor
             intraDirPred[2] =  (leftIntraDir + aboveIntraDir) < 2 ? VER_IDX : DC_IDX;
         }
     }
-
-    return predNum;
 }
 
 UInt TComDataCU::getCtxSplitFlag(UInt absPartIdx, UInt depth)


More information about the x265-commits mailing list