[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2011, ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | |
---|
[5] | 35 | |
---|
[2] | 36 | /** \file TComRdCostWeightPrediction.h |
---|
| 37 | \brief RD cost computation classes (header) |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | #ifndef __TCOMRDCOSTWEIGHTPREDICTION__ |
---|
| 41 | #define __TCOMRDCOSTWEIGHTPREDICTION__ |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | #include "CommonDef.h" |
---|
| 45 | #include "TComPattern.h" |
---|
| 46 | #include "TComMv.h" |
---|
| 47 | #include "TComRdCost.h" |
---|
| 48 | #ifdef WEIGHT_PRED |
---|
| 49 | #include "TComSlice.h" |
---|
| 50 | #endif |
---|
| 51 | |
---|
| 52 | class DistParam; |
---|
| 53 | class TComPattern; |
---|
| 54 | |
---|
| 55 | // ==================================================================================================================== |
---|
| 56 | // Class definition |
---|
| 57 | // ==================================================================================================================== |
---|
| 58 | |
---|
| 59 | /// RD cost computation class, with Weighted Prediction |
---|
| 60 | class TComRdCostWeightPrediction |
---|
| 61 | { |
---|
| 62 | private: |
---|
| 63 | static Int m_w0, m_w1; // current wp scaling values |
---|
| 64 | static Int m_shift; |
---|
| 65 | static Int m_offset; |
---|
| 66 | static Int m_round; |
---|
| 67 | static Bool m_xSetDone; |
---|
| 68 | |
---|
| 69 | public: |
---|
| 70 | TComRdCostWeightPrediction(); |
---|
| 71 | virtual ~TComRdCostWeightPrediction(); |
---|
| 72 | |
---|
| 73 | protected: |
---|
| 74 | |
---|
| 75 | static inline Void xSetWPscale(Int w0, Int w1, Int shift, Int offset, Int round); |
---|
| 76 | |
---|
| 77 | static UInt xGetSSEw ( DistParam* pcDtParam ); |
---|
| 78 | static UInt xGetSSE4w ( DistParam* pcDtParam ); |
---|
| 79 | static UInt xGetSSE8w ( DistParam* pcDtParam ); |
---|
| 80 | static UInt xGetSSE16w ( DistParam* pcDtParam ); |
---|
| 81 | static UInt xGetSSE32w ( DistParam* pcDtParam ); |
---|
| 82 | static UInt xGetSSE64w ( DistParam* pcDtParam ); |
---|
| 83 | static UInt xGetSSE16Nw ( DistParam* pcDtParam ); |
---|
| 84 | |
---|
| 85 | static UInt xGetSADw ( DistParam* pcDtParam ); |
---|
| 86 | static UInt xGetSAD4w ( DistParam* pcDtParam ); |
---|
| 87 | static UInt xGetSAD8w ( DistParam* pcDtParam ); |
---|
| 88 | static UInt xGetSAD16w ( DistParam* pcDtParam ); |
---|
| 89 | static UInt xGetSAD32w ( DistParam* pcDtParam ); |
---|
| 90 | static UInt xGetSAD64w ( DistParam* pcDtParam ); |
---|
| 91 | static UInt xGetSAD16Nw ( DistParam* pcDtParam ); |
---|
| 92 | |
---|
| 93 | static UInt xGetSADsw ( DistParam* pcDtParam ); |
---|
| 94 | static UInt xGetSADs4w ( DistParam* pcDtParam ); |
---|
| 95 | static UInt xGetSADs8w ( DistParam* pcDtParam ); |
---|
| 96 | static UInt xGetSADs16w ( DistParam* pcDtParam ); |
---|
| 97 | static UInt xGetSADs32w ( DistParam* pcDtParam ); |
---|
| 98 | static UInt xGetSADs64w ( DistParam* pcDtParam ); |
---|
| 99 | static UInt xGetSADs16Nw ( DistParam* pcDtParam ); |
---|
| 100 | |
---|
| 101 | static UInt xGetHADs4w ( DistParam* pcDtParam ); |
---|
| 102 | static UInt xGetHADs8w ( DistParam* pcDtParam ); |
---|
| 103 | static UInt xGetHADsw ( DistParam* pcDtParam ); |
---|
| 104 | static UInt xCalcHADs2x2w ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 105 | static UInt xCalcHADs4x4w ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 106 | static UInt xCalcHADs8x8w ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 107 | |
---|
| 108 | };// END CLASS DEFINITION TComRdCostWeightPrediction |
---|
| 109 | |
---|
| 110 | inline Void TComRdCostWeightPrediction::xSetWPscale(Int w0, Int w1, Int shift, Int offset, Int round) |
---|
| 111 | { |
---|
| 112 | m_w0 = w0; |
---|
| 113 | m_w1 = w1; |
---|
| 114 | m_shift = shift; |
---|
| 115 | m_offset = offset; |
---|
| 116 | m_round = round; |
---|
| 117 | |
---|
| 118 | m_xSetDone = true; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | #endif // __TCOMRDCOSTWEIGHTPREDICTION__ |
---|
| 122 | |
---|