[x265] [PATCH 3 of 5] cleanup:remove unused base class TEncBinIf

Min Chen chenm003 at 163.com
Tue Oct 22 13:05:44 CEST 2013


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1382439723 -28800
# Node ID d241480bbb4fef9f3caa02bdbdc475db2c588408
# Parent  87cad2d10d9d441c4376e111afca7a9eddde5ccc
cleanup:remove unused base class TEncBinIf

diff -r 87cad2d10d9d -r d241480bbb4f source/Lib/TLibEncoder/TEncBinCoder.h
--- a/source/Lib/TLibEncoder/TEncBinCoder.h	Tue Oct 22 19:01:34 2013 +0800
+++ /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 87cad2d10d9d -r d241480bbb4f source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
--- a/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Tue Oct 22 19:01:34 2013 +0800
+++ b/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Tue Oct 22 19:02:03 2013 +0800
@@ -147,10 +147,8 @@
     m_bitIf->write(code, length);
 }
 
-void TEncBinCABAC::copyState(TEncBinIf* binIf)
+void TEncBinCABAC::copyState(TEncBinCABAC* binCABAC)
 {
-    TEncBinCABAC* binCABAC = (TEncBinCABAC*)binIf;
-
     m_low              = binCABAC->m_low;
     m_range            = binCABAC->m_range;
     m_bitsLeft         = binCABAC->m_bitsLeft;
diff -r 87cad2d10d9d -r d241480bbb4f source/Lib/TLibEncoder/TEncBinCoderCABAC.h
--- a/source/Lib/TLibEncoder/TEncBinCoderCABAC.h	Tue Oct 22 19:01:34 2013 +0800
+++ b/source/Lib/TLibEncoder/TEncBinCoderCABAC.h	Tue Oct 22 19:02:03 2013 +0800
@@ -38,7 +38,8 @@
 #ifndef X265_TENCBINCODERCABAC_H
 #define X265_TENCBINCODERCABAC_H
 
-#include "TEncBinCoder.h"
+#include "TLibCommon/ContextModel.h"
+#include "TLibCommon/TComBitStream.h"
 
 //! \ingroup TLibEncoder
 //! \{
@@ -46,7 +47,7 @@
 namespace x265 {
 // private namespace
 
-class TEncBinCABAC : public TEncBinIf
+class TEncBinCABAC
 {
 public:
 
@@ -58,7 +59,7 @@
 
     void  start();
     void  finish();
-    void  copyState(TEncBinIf* binIf);
+    void  copyState(TEncBinCABAC* binIf);
     void  flush();
 
     void  resetBac();
diff -r 87cad2d10d9d -r d241480bbb4f source/Lib/TLibEncoder/TEncSbac.h
--- a/source/Lib/TLibEncoder/TEncSbac.h	Tue Oct 22 19:01:34 2013 +0800
+++ b/source/Lib/TLibEncoder/TEncSbac.h	Tue Oct 22 19:02:03 2013 +0800
@@ -42,7 +42,6 @@
 #include "TLibCommon/ContextTables.h"
 #include "TLibCommon/ContextModel.h"
 #include "TEncEntropy.h"
-#include "TEncBinCoder.h"
 #include "TEncBinCoderCABAC.h"
 
 namespace x265 {
@@ -63,7 +62,7 @@
     TEncSbac();
     virtual ~TEncSbac();
 
-    void  init(TEncBinIf* p)          { m_binIf = p; }
+    void  init(TEncBinCABAC* p)       { m_binIf = p; }
 
     void  uninit()                    { m_binIf = 0; }
 
@@ -129,7 +128,7 @@
 
     TComBitIf*    m_bitIf;
     TComSlice*    m_slice;
-    TEncBinIf*    m_binIf;
+    TEncBinCABAC* m_binIf;
     //SBAC RD
     UInt          m_coeffCost;
 
@@ -175,7 +174,7 @@
     void estSignificantMapBit(estBitsSbacStruct* estBitsSbac, int width, int height, TextType ttype);
     void estSignificantCoefficientsBit(estBitsSbacStruct* estBitsSbac, TextType ttype);
 
-    TEncBinIf* getEncBinIf()  { return m_binIf; }
+    TEncBinCABAC* getEncBinIf()  { return m_binIf; }
 
 private:
 
diff -r 87cad2d10d9d -r d241480bbb4f source/encoder/CMakeLists.txt
--- a/source/encoder/CMakeLists.txt	Tue Oct 22 19:01:34 2013 +0800
+++ b/source/encoder/CMakeLists.txt	Tue Oct 22 19:02:03 2013 +0800
@@ -16,7 +16,6 @@
     ../Lib/TLibEncoder/SEIwrite.h
     ../Lib/TLibEncoder/SyntaxElementWriter.h
     ../Lib/TLibEncoder/TEncAnalyze.h
-    ../Lib/TLibEncoder/TEncBinCoder.h
     ../Lib/TLibEncoder/TEncBinCoderCABAC.h
     ../Lib/TLibEncoder/TEncCavlc.h
     ../Lib/TLibEncoder/TEncCfg.h



More information about the x265-devel mailing list