Some newlines were fixed in "Merge pull request #2997 from GuangweiWang/fix-issue-external", but lots were still left behind.
Showing the changes to codec/decoder/core/src/deblocking.cpp (1 of 14 files). Show all
Unified · Split
| @@ -1,1383 +1,1383 @@ | |||
| 1 | /*! | 1 | /*! |
| 2 | * \copy | 2 | * \copy |
| 3 | * Copyright (c) 2010-2013, Cisco Systems | 3 | * Copyright (c) 2010-2013, Cisco Systems |
| 4 | * All rights reserved. | 4 | * All rights reserved. |
| 5 | * | 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions |
| 8 | * are met: | 8 | * are met: |
| 9 | * | 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright | 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * | 12 | * |
| 13 | * * Redistributions in binary form must reproduce the above copyright | 13 | * * Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in | 14 | * notice, this list of conditions and the following disclaimer in |
| 15 | * the documentation and/or other materials provided with the | 15 | * the documentation and/or other materials provided with the |
| 16 | * distribution. | 16 | * distribution. |
| 17 | * | 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 22 | * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 22 | * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 24 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 24 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 28 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. |
| 30 | * | 30 | * |
| 31 | * | 31 | * |
| 32 | * \file deblocking.c | 32 | * \file deblocking.c |
| 33 | * | 33 | * |
| 34 | * \brief Interfaces introduced in frame deblocking filtering | 34 | * \brief Interfaces introduced in frame deblocking filtering |
| 35 | * | 35 | * |
| 36 | * \date 08/02/2010 | 36 | * \date 08/02/2010 |
| 37 | * | 37 | * |
| 38 | ************************************************************************************* | 38 | ************************************************************************************* |
| 39 | */ | 39 | */ |
| 40 | 40 | ||
| 41 | #include "deblocking.h" | 41 | #include "deblocking.h" |
| 42 | #include "deblocking_common.h" | 42 | #include "deblocking_common.h" |
| 43 | #include "cpu_core.h" | 43 | #include "cpu_core.h" |
| 44 | 44 | ||
| 45 | namespace WelsDec { | 45 | namespace WelsDec { |
| 46 | 46 | ||
| 47 | #define NO_SUPPORTED_FILTER_IDX (-1) | 47 | #define NO_SUPPORTED_FILTER_IDX (-1) |
| 48 | #define LEFT_FLAG_BIT 0 | 48 | #define LEFT_FLAG_BIT 0 |
| 49 | #define TOP_FLAG_BIT 1 | 49 | #define TOP_FLAG_BIT 1 |
| 50 | #define LEFT_FLAG_MASK 0x01 | 50 | #define LEFT_FLAG_MASK 0x01 |
| 51 | #define TOP_FLAG_MASK 0x02 | 51 | #define TOP_FLAG_MASK 0x02 |
| 52 | 52 | ||
| 53 | #define SAME_MB_DIFF_REFIDX | 53 | #define SAME_MB_DIFF_REFIDX |
| 54 | #define g_kuiAlphaTable(x) g_kuiAlphaTable[(x)+12] | 54 | #define g_kuiAlphaTable(x) g_kuiAlphaTable[(x)+12] |
| 55 | #define g_kiBetaTable(x) g_kiBetaTable[(x)+12] | 55 | #define g_kiBetaTable(x) g_kiBetaTable[(x)+12] |
| 56 | #define g_kiTc0Table(x) g_kiTc0Table[(x)+12] | 56 | #define g_kiTc0Table(x) g_kiTc0Table[(x)+12] |
| 57 | 57 | ||
| 58 | #define MB_BS_MV(iRefIndex, iMotionVector, iMbXy, iMbBn, iIndex, iNeighIndex) \ | 58 | #define MB_BS_MV(iRefIndex, iMotionVector, iMbXy, iMbBn, iIndex, iNeighIndex) \ |
| 59 | (\ | 59 | (\ |
| 60 | ( iRefIndex[iMbXy][iIndex] - iRefIndex[iMbBn][iNeighIndex] )||\ | 60 | ( iRefIndex[iMbXy][iIndex] - iRefIndex[iMbBn][iNeighIndex] )||\ |
| 61 | ( WELS_ABS( iMotionVector[iMbXy][iIndex][0] - iMotionVector[iMbBn][iNeighIndex][0] ) >= 4 ) ||\ | 61 | ( WELS_ABS( iMotionVector[iMbXy][iIndex][0] - iMotionVector[iMbBn][iNeighIndex][0] ) >= 4 ) ||\ |
| 62 | ( WELS_ABS( iMotionVector[iMbXy][iIndex][1] - iMotionVector[iMbBn][iNeighIndex][1] ) >= 4 )\ | 62 | ( WELS_ABS( iMotionVector[iMbXy][iIndex][1] - iMotionVector[iMbBn][iNeighIndex][1] ) >= 4 )\ |
| 63 | ) | 63 | ) |
| 64 | 64 | ||
| 65 | #if defined(SAME_MB_DIFF_REFIDX) | 65 | #if defined(SAME_MB_DIFF_REFIDX) |
| 66 | #define SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex) \ | 66 | #define SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex) \ |
| 67 | (\ | 67 | (\ |
| 68 | ( iRefIndex[iIndex] - iRefIndex[iNeighIndex] )||(\ | 68 | ( iRefIndex[iIndex] - iRefIndex[iNeighIndex] )||(\ |
| 69 | ( WELS_ABS( iMotionVector[iIndex][0] - iMotionVector[iNeighIndex][0] ) &(~3) ) |\ | 69 | ( WELS_ABS( iMotionVector[iIndex][0] - iMotionVector[iNeighIndex][0] ) &(~3) ) |\ |
| 70 | ( WELS_ABS( iMotionVector[iIndex][1] - iMotionVector[iNeighIndex][1] ) &(~3) ))\ | 70 | ( WELS_ABS( iMotionVector[iIndex][1] - iMotionVector[iNeighIndex][1] ) &(~3) ))\ |
| 71 | ) | 71 | ) |
| 72 | #else | 72 | #else |
| 73 | #define SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex) \ | 73 | #define SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex) \ |
| 74 | (\ | 74 | (\ |
| 75 | !!(( WELS_ABS( iMotionVector[iIndex][0] - iMotionVector[iNeighIndex][0] ) &(~3) ) |( WELS_ABS( iMotionVector[iIndex][1] - iMotionVector[iNeighIndex][1] ) &(~3) ))\ | 75 | !!(( WELS_ABS( iMotionVector[iIndex][0] - iMotionVector[iNeighIndex][0] ) &(~3) ) |( WELS_ABS( iMotionVector[iIndex][1] - iMotionVector[iNeighIndex][1] ) &(~3) ))\ |
| 76 | ) | 76 | ) |
| 77 | #endif | 77 | #endif |
| 78 | 78 | ||
| 79 | #define BS_EDGE(bsx1, iRefIndex, iMotionVector, iIndex, iNeighIndex) \ | 79 | #define BS_EDGE(bsx1, iRefIndex, iMotionVector, iIndex, iNeighIndex) \ |
| 80 | ( (bsx1|SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex))<<((uint8_t)(!!bsx1))) | 80 | ( (bsx1|SMB_EDGE_MV(iRefIndex, iMotionVector, iIndex, iNeighIndex))<<((uint8_t)(!!bsx1))) |
| 81 | 81 | ||
| 82 | #define GET_ALPHA_BETA_FROM_QP(iQp, iAlphaOffset, iBetaOffset, iIndex, iAlpha, iBeta) \ | 82 | #define GET_ALPHA_BETA_FROM_QP(iQp, iAlphaOffset, iBetaOffset, iIndex, iAlpha, iBeta) \ |
| 83 | {\ | 83 | {\ |
| 84 | iIndex = (iQp + iAlphaOffset);\ | 84 | iIndex = (iQp + iAlphaOffset);\ |
| 85 | iAlpha = g_kuiAlphaTable(iIndex);\ | 85 | iAlpha = g_kuiAlphaTable(iIndex);\ |
| 86 | iBeta = g_kiBetaTable((iQp + iBetaOffset));\ | 86 | iBeta = g_kiBetaTable((iQp + iBetaOffset));\ |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | static const uint8_t g_kuiAlphaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard | 89 | static const uint8_t g_kuiAlphaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard |
| 90 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 90 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 91 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 91 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 92 | 0, 0, 0, 0, 0, 0, 4, 4, 5, 6, | 92 | 0, 0, 0, 0, 0, 0, 4, 4, 5, 6, |
| 93 | 7, 8, 9, 10, 12, 13, 15, 17, 20, 22, | 93 | 7, 8, 9, 10, 12, 13, 15, 17, 20, 22, |
| 94 | 25, 28, 32, 36, 40, 45, 50, 56, 63, 71, | 94 | 25, 28, 32, 36, 40, 45, 50, 56, 63, 71, |
| 95 | 80, 90, 101, 113, 127, 144, 162, 182, 203, 226, | 95 | 80, 90, 101, 113, 127, 144, 162, 182, 203, 226, |
| 96 | 255, 255 | 96 | 255, 255 |
| 97 | , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 | 97 | , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | static const int8_t g_kiBetaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard | 100 | static const int8_t g_kiBetaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard |
| 101 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 101 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 102 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 102 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 103 | 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, | 103 | 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, |
| 104 | 3, 3, 3, 4, 4, 4, 6, 6, 7, 7, | 104 | 3, 3, 3, 4, 4, 4, 6, 6, 7, 7, |
| 105 | 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, | 105 | 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, |
| 106 | 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, | 106 | 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, |
| 107 | 18, 18 | 107 | 18, 18 |
| 108 | , 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 | 108 | , 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 |
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | static const int8_t g_kiTc0Table[52 + 24][4] = { //this table refers Table 8-17 in H.264/AVC standard | 111 | static const int8_t g_kiTc0Table[52 + 24][4] = { //this table refers Table 8-17 in H.264/AVC standard |
| 112 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, | 112 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, |
| 113 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, | 113 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, |
| 114 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, | 114 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, |
| 115 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, | 115 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, |
| 116 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 1 }, | 116 | { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { -1, 0, 0, 1 }, |
| 117 | { -1, 0, 0, 1 }, { -1, 0, 0, 1 }, { -1, 0, 0, 1 }, { -1, 0, 1, 1 }, { -1, 0, 1, 1 }, { -1, 1, 1, 1 }, | 117 | { -1, 0, 0, 1 }, { -1, 0, 0, 1 }, { -1, 0, 0, 1 }, { -1, 0, 1, 1 }, { -1, 0, 1, 1 }, { -1, 1, 1, 1 }, |
| 118 | { -1, 1, 1, 1 }, { -1, 1, 1, 1 }, { -1, 1, 1, 1 }, { -1, 1, 1, 2 }, { -1, 1, 1, 2 }, { -1, 1, 1, 2 }, | 118 | { -1, 1, 1, 1 }, { -1, 1, 1, 1 }, { -1, 1, 1, 1 }, { -1, 1, 1, 2 }, { -1, 1, 1, 2 }, { -1, 1, 1, 2 }, |
| 119 | { -1, 1, 1, 2 }, { -1, 1, 2, 3 }, { -1, 1, 2, 3 }, { -1, 2, 2, 3 }, { -1, 2, 2, 4 }, { -1, 2, 3, 4 }, | 119 | { -1, 1, 1, 2 }, { -1, 1, 2, 3 }, { -1, 1, 2, 3 }, { -1, 2, 2, 3 }, { -1, 2, 2, 4 }, { -1, 2, 3, 4 }, |
| 120 | { -1, 2, 3, 4 }, { -1, 3, 3, 5 }, { -1, 3, 4, 6 }, { -1, 3, 4, 6 }, { -1, 4, 5, 7 }, { -1, 4, 5, 8 }, | 120 | { -1, 2, 3, 4 }, { -1, 3, 3, 5 }, { -1, 3, 4, 6 }, { -1, 3, 4, 6 }, { -1, 4, 5, 7 }, { -1, 4, 5, 8 }, |
| 121 | { -1, 4, 6, 9 }, { -1, 5, 7, 10 }, { -1, 6, 8, 11 }, { -1, 6, 8, 13 }, { -1, 7, 10, 14 }, { -1, 8, 11, 16 }, | 121 | { -1, 4, 6, 9 }, { -1, 5, 7, 10 }, { -1, 6, 8, 11 }, { -1, 6, 8, 13 }, { -1, 7, 10, 14 }, { -1, 8, 11, 16 }, |
| 122 | { -1, 9, 12, 18 }, { -1, 10, 13, 20 }, { -1, 11, 15, 23 }, { -1, 13, 17, 25 } | 122 | { -1, 9, 12, 18 }, { -1, 10, 13, 20 }, { -1, 11, 15, 23 }, { -1, 13, 17, 25 } |
| 123 | , { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 } | 123 | , { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 } |
| 124 | , { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 } | 124 | , { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 }, { -1, 13, 17, 25 } |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | static const uint8_t g_kuiTableBIdx[2][8] = { | 127 | static const uint8_t g_kuiTableBIdx[2][8] = { |
| 128 | { | 128 | { |
| 129 | 0, 4, 8, 12, | 129 | 0, 4, 8, 12, |
| 130 | 3, 7, 11, 15 | 130 | 3, 7, 11, 15 |
| 131 | }, | 131 | }, |
| 132 | 132 | ||
| 133 | { | 133 | { |
| 134 | 0, 1, 2, 3, | 134 | 0, 1, 2, 3, |
| 135 | 12, 13, 14, 15 | 135 | 12, 13, 14, 15 |
| 136 | }, | 136 | }, |
| 137 | }; | 137 | }; |
| 138 | 138 | ||
| 139 | static const uint8_t g_kuiTableB8x8Idx[2][16] = { | 139 | static const uint8_t g_kuiTableB8x8Idx[2][16] = { |
| 140 | { | 140 | { |
| 141 | 0, 1, 4, 5, 8, 9, 12, 13, // 0 1 | 2 3 | 141 | 0, 1, 4, 5, 8, 9, 12, 13, // 0 1 | 2 3 |
| 142 | 2, 3, 6, 7, 10, 11, 14, 15 // 4 5 | 6 7 | 142 | 2, 3, 6, 7, 10, 11, 14, 15 // 4 5 | 6 7 |
| 143 | }, // ------------ | 143 | }, // ------------ |
| 144 | // 8 9 | 10 11 | 144 | // 8 9 | 10 11 |
| 145 | { | 145 | { |
| 146 | // 12 13 | 14 15 | 146 | // 12 13 | 14 15 |
| 147 | 0, 1, 4, 5, 2, 3, 6, 7, | 147 | 0, 1, 4, 5, 2, 3, 6, 7, |
| 148 | 8, 9, 12, 13, 10, 11, 14, 15 | 148 | 8, 9, 12, 13, 10, 11, 14, 15 |
| 149 | }, | 149 | }, |
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | #define TC0_TBL_LOOKUP(tc, iIndexA, pBS, bChroma) \ | 152 | #define TC0_TBL_LOOKUP(tc, iIndexA, pBS, bChroma) \ |
| 153 | {\ | 153 | {\ |
| 154 | tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\ | 154 | tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\ |
| 155 | tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\ | 155 | tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\ |
| 156 | tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\ | 156 | tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\ |
| 157 | tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\ | 157 | tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\ |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) { | 160 | void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) { |
| 161 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; | 161 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; |
| 162 | 162 | ||
| 163 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); | 163 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); |
| 164 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); | 164 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); |
| 165 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); | 165 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); |
| 166 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); | 166 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); |
| 167 | 167 | ||
| 168 | nBS[0][1][0] = (pNnzTab[0] | pNnzTab[1]) << iLShiftFactor; | 168 | nBS[0][1][0] = (pNnzTab[0] | pNnzTab[1]) << iLShiftFactor; |
| 169 | nBS[0][2][0] = (pNnzTab[1] | pNnzTab[2]) << iLShiftFactor; | 169 | nBS[0][2][0] = (pNnzTab[1] | pNnzTab[2]) << iLShiftFactor; |
| 170 | nBS[0][3][0] = (pNnzTab[2] | pNnzTab[3]) << iLShiftFactor; | 170 | nBS[0][3][0] = (pNnzTab[2] | pNnzTab[3]) << iLShiftFactor; |
| 171 | 171 | ||
| 172 | nBS[0][1][1] = (pNnzTab[4] | pNnzTab[5]) << iLShiftFactor; | 172 | nBS[0][1][1] = (pNnzTab[4] | pNnzTab[5]) << iLShiftFactor; |
| 173 | nBS[0][2][1] = (pNnzTab[5] | pNnzTab[6]) << iLShiftFactor; | 173 | nBS[0][2][1] = (pNnzTab[5] | pNnzTab[6]) << iLShiftFactor; |
| 174 | nBS[0][3][1] = (pNnzTab[6] | pNnzTab[7]) << iLShiftFactor; | 174 | nBS[0][3][1] = (pNnzTab[6] | pNnzTab[7]) << iLShiftFactor; |
| 175 | * (uint32_t*)nBS[1][1] = (uiNnz32b0 | uiNnz32b1) << iLShiftFactor; | 175 | * (uint32_t*)nBS[1][1] = (uiNnz32b0 | uiNnz32b1) << iLShiftFactor; |
| 176 | 176 | ||
| 177 | nBS[0][1][2] = (pNnzTab[8] | pNnzTab[9]) << iLShiftFactor; | 177 | nBS[0][1][2] = (pNnzTab[8] | pNnzTab[9]) << iLShiftFactor; |
| 178 | nBS[0][2][2] = (pNnzTab[9] | pNnzTab[10]) << iLShiftFactor; | 178 | nBS[0][2][2] = (pNnzTab[9] | pNnzTab[10]) << iLShiftFactor; |
| 179 | nBS[0][3][2] = (pNnzTab[10] | pNnzTab[11]) << iLShiftFactor; | 179 | nBS[0][3][2] = (pNnzTab[10] | pNnzTab[11]) << iLShiftFactor; |
| 180 | * (uint32_t*)nBS[1][2] = (uiNnz32b1 | uiNnz32b2) << iLShiftFactor; | 180 | * (uint32_t*)nBS[1][2] = (uiNnz32b1 | uiNnz32b2) << iLShiftFactor; |
| 181 | 181 | ||
| 182 | nBS[0][1][3] = (pNnzTab[12] | pNnzTab[13]) << iLShiftFactor; | 182 | nBS[0][1][3] = (pNnzTab[12] | pNnzTab[13]) << iLShiftFactor; |
| 183 | nBS[0][2][3] = (pNnzTab[13] | pNnzTab[14]) << iLShiftFactor; | 183 | nBS[0][2][3] = (pNnzTab[13] | pNnzTab[14]) << iLShiftFactor; |
| 184 | nBS[0][3][3] = (pNnzTab[14] | pNnzTab[15]) << iLShiftFactor; | 184 | nBS[0][3][3] = (pNnzTab[14] | pNnzTab[15]) << iLShiftFactor; |
| 185 | * (uint32_t*)nBS[1][3] = (uiNnz32b2 | uiNnz32b3) << iLShiftFactor; | 185 | * (uint32_t*)nBS[1][3] = (uiNnz32b2 | uiNnz32b3) << iLShiftFactor; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | void inline DeblockingBSInsideMBAvsbase8x8 (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) { | 188 | void inline DeblockingBSInsideMBAvsbase8x8 (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) { |
| 189 | int8_t i8x8NnzTab[4]; | 189 | int8_t i8x8NnzTab[4]; |
| 190 | for (int32_t i = 0; i < 4; i++) { | 190 | for (int32_t i = 0; i < 4; i++) { |
| 191 | int32_t iBlkIdx = i << 2; | 191 | int32_t iBlkIdx = i << 2; |
| 192 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | | 192 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | |
| 193 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); | 193 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | //vertical | 196 | //vertical |
| 197 | nBS[0][2][0] = nBS[0][2][1] = (i8x8NnzTab[0] | i8x8NnzTab[1]) << iLShiftFactor; | 197 | nBS[0][2][0] = nBS[0][2][1] = (i8x8NnzTab[0] | i8x8NnzTab[1]) << iLShiftFactor; |
| 198 | nBS[0][2][2] = nBS[0][2][3] = (i8x8NnzTab[2] | i8x8NnzTab[3]) << iLShiftFactor; | 198 | nBS[0][2][2] = nBS[0][2][3] = (i8x8NnzTab[2] | i8x8NnzTab[3]) << iLShiftFactor; |
| 199 | //horizontal | 199 | //horizontal |
| 200 | nBS[1][2][0] = nBS[1][2][1] = (i8x8NnzTab[0] | i8x8NnzTab[2]) << iLShiftFactor; | 200 | nBS[1][2][0] = nBS[1][2][1] = (i8x8NnzTab[0] | i8x8NnzTab[2]) << iLShiftFactor; |
| 201 | nBS[1][2][2] = nBS[1][2][3] = (i8x8NnzTab[1] | i8x8NnzTab[3]) << iLShiftFactor; | 201 | nBS[1][2][2] = nBS[1][2][3] = (i8x8NnzTab[1] | i8x8NnzTab[3]) << iLShiftFactor; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | void static inline DeblockingBSInsideMBNormal (PDqLayer pCurDqLayer, uint8_t nBS[2][4][4], int8_t* pNnzTab, | 204 | void static inline DeblockingBSInsideMBNormal (PDqLayer pCurDqLayer, uint8_t nBS[2][4][4], int8_t* pNnzTab, |
| 205 | int32_t iMbXy) { | 205 | int32_t iMbXy) { |
| 206 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; | 206 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; |
| 207 | int8_t* iRefIndex = pCurDqLayer->pRefIndex[LIST_0][iMbXy]; | 207 | int8_t* iRefIndex = pCurDqLayer->pRefIndex[LIST_0][iMbXy]; |
| 208 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBsx4, 4, 4); | 208 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBsx4, 4, 4); |
| 209 | 209 | ||
| 210 | int8_t i8x8NnzTab[4]; | 210 | int8_t i8x8NnzTab[4]; |
| 211 | 211 | ||
| 212 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { | 212 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 213 | for (int32_t i = 0; i < 4; i++) { | 213 | for (int32_t i = 0; i < 4; i++) { |
| 214 | int32_t iBlkIdx = i << 2; | 214 | int32_t iBlkIdx = i << 2; |
| 215 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | | 215 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | |
| 216 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); | 216 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); |
| 217 | } | 217 | } |
| 218 | //vertical | 218 | //vertical |
| 219 | nBS[0][2][0] = nBS[0][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[1]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], | 219 | nBS[0][2][0] = nBS[0][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[1]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], |
| 220 | g_kuiMbCountScan4Idx[1 << 2], g_kuiMbCountScan4Idx[0]); | 220 | g_kuiMbCountScan4Idx[1 << 2], g_kuiMbCountScan4Idx[0]); |
| 221 | nBS[0][2][2] = nBS[0][2][3] = BS_EDGE ((i8x8NnzTab[2] | i8x8NnzTab[3]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], | 221 | nBS[0][2][2] = nBS[0][2][3] = BS_EDGE ((i8x8NnzTab[2] | i8x8NnzTab[3]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], |
| 222 | g_kuiMbCountScan4Idx[3 << 2], g_kuiMbCountScan4Idx[2 << 2]); | 222 | g_kuiMbCountScan4Idx[3 << 2], g_kuiMbCountScan4Idx[2 << 2]); |
| 223 | 223 | ||
| 224 | //horizontal | 224 | //horizontal |
| 225 | nBS[1][2][0] = nBS[1][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[2]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], | 225 | nBS[1][2][0] = nBS[1][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[2]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], |
| 226 | g_kuiMbCountScan4Idx[2 << 2], g_kuiMbCountScan4Idx[0]); | 226 | g_kuiMbCountScan4Idx[2 << 2], g_kuiMbCountScan4Idx[0]); |
| 227 | nBS[1][2][2] = nBS[1][2][3] = BS_EDGE ((i8x8NnzTab[1] | i8x8NnzTab[3]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], | 227 | nBS[1][2][2] = nBS[1][2][3] = BS_EDGE ((i8x8NnzTab[1] | i8x8NnzTab[3]), iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], |
| 228 | g_kuiMbCountScan4Idx[3 << 2], g_kuiMbCountScan4Idx[1 << 2]); | 228 | g_kuiMbCountScan4Idx[3 << 2], g_kuiMbCountScan4Idx[1 << 2]); |
| 229 | } else { | 229 | } else { |
| 230 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); | 230 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); |
| 231 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); | 231 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); |
| 232 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); | 232 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); |
| 233 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); | 233 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); |
| 234 | 234 | ||
| 235 | for (int i = 0; i < 3; i++) | 235 | for (int i = 0; i < 3; i++) |
| 236 | uiBsx4[i] = pNnzTab[i] | pNnzTab[i + 1]; | 236 | uiBsx4[i] = pNnzTab[i] | pNnzTab[i + 1]; |
| 237 | nBS[0][1][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 1, 0); | 237 | nBS[0][1][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 1, 0); |
| 238 | nBS[0][2][0] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 2, 1); | 238 | nBS[0][2][0] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 2, 1); |
| 239 | nBS[0][3][0] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 3, 2); | 239 | nBS[0][3][0] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 3, 2); |
| 240 | 240 | ||
| 241 | for (int i = 0; i < 3; i++) | 241 | for (int i = 0; i < 3; i++) |
| 242 | uiBsx4[i] = pNnzTab[4 + i] | pNnzTab[4 + i + 1]; | 242 | uiBsx4[i] = pNnzTab[4 + i] | pNnzTab[4 + i + 1]; |
| 243 | nBS[0][1][1] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 5, 4); | 243 | nBS[0][1][1] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 5, 4); |
| 244 | nBS[0][2][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 6, 5); | 244 | nBS[0][2][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 6, 5); |
| 245 | nBS[0][3][1] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 7, 6); | 245 | nBS[0][3][1] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 7, 6); |
| 246 | 246 | ||
| 247 | for (int i = 0; i < 3; i++) | 247 | for (int i = 0; i < 3; i++) |
| 248 | uiBsx4[i] = pNnzTab[8 + i] | pNnzTab[8 + i + 1]; | 248 | uiBsx4[i] = pNnzTab[8 + i] | pNnzTab[8 + i + 1]; |
| 249 | nBS[0][1][2] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 9, 8); | 249 | nBS[0][1][2] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 9, 8); |
| 250 | nBS[0][2][2] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 10, 9); | 250 | nBS[0][2][2] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 10, 9); |
| 251 | nBS[0][3][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 11, 10); | 251 | nBS[0][3][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 11, 10); |
| 252 | 252 | ||
| 253 | for (int i = 0; i < 3; i++) | 253 | for (int i = 0; i < 3; i++) |
| 254 | uiBsx4[i] = pNnzTab[12 + i] | pNnzTab[12 + i + 1]; | 254 | uiBsx4[i] = pNnzTab[12 + i] | pNnzTab[12 + i + 1]; |
| 255 | nBS[0][1][3] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 13, 12); | 255 | nBS[0][1][3] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 13, 12); |
| 256 | nBS[0][2][3] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 14, 13); | 256 | nBS[0][2][3] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 14, 13); |
| 257 | nBS[0][3][3] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 15, 14); | 257 | nBS[0][3][3] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 15, 14); |
| 258 | 258 | ||
| 259 | // horizontal | 259 | // horizontal |
| 260 | * (uint32_t*)uiBsx4 = (uiNnz32b0 | uiNnz32b1); | 260 | * (uint32_t*)uiBsx4 = (uiNnz32b0 | uiNnz32b1); |
| 261 | nBS[1][1][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 4, 0); | 261 | nBS[1][1][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 4, 0); |
| 262 | nBS[1][1][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 5, 1); | 262 | nBS[1][1][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 5, 1); |
| 263 | nBS[1][1][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 6, 2); | 263 | nBS[1][1][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 6, 2); |
| 264 | nBS[1][1][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 7, 3); | 264 | nBS[1][1][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 7, 3); |
| 265 | 265 | ||
| 266 | * (uint32_t*)uiBsx4 = (uiNnz32b1 | uiNnz32b2); | 266 | * (uint32_t*)uiBsx4 = (uiNnz32b1 | uiNnz32b2); |
| 267 | nBS[1][2][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 8, 4); | 267 | nBS[1][2][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 8, 4); |
| 268 | nBS[1][2][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 9, 5); | 268 | nBS[1][2][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 9, 5); |
| 269 | nBS[1][2][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 10, 6); | 269 | nBS[1][2][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 10, 6); |
| 270 | nBS[1][2][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 11, 7); | 270 | nBS[1][2][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 11, 7); |
| 271 | 271 | ||
| 272 | * (uint32_t*)uiBsx4 = (uiNnz32b2 | uiNnz32b3); | 272 | * (uint32_t*)uiBsx4 = (uiNnz32b2 | uiNnz32b3); |
| 273 | nBS[1][3][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 12, 8); | 273 | nBS[1][3][0] = BS_EDGE (uiBsx4[0], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 12, 8); |
| 274 | nBS[1][3][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 13, 9); | 274 | nBS[1][3][1] = BS_EDGE (uiBsx4[1], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 13, 9); |
| 275 | nBS[1][3][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 14, 10); | 275 | nBS[1][3][2] = BS_EDGE (uiBsx4[2], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 14, 10); |
| 276 | nBS[1][3][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 15, 11); | 276 | nBS[1][3][3] = BS_EDGE (uiBsx4[3], iRefIndex, pCurDqLayer->pMv[LIST_0][iMbXy], 15, 11); |
| 277 | } | 277 | } |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | void static inline DeblockingBSliceBSInsideMBNormal (PDqLayer pCurDqLayer, uint8_t nBS[2][4][4], int8_t* pNnzTab, | 280 | void static inline DeblockingBSliceBSInsideMBNormal (PDqLayer pCurDqLayer, uint8_t nBS[2][4][4], int8_t* pNnzTab, |
| 281 | int32_t iMbXy) { | 281 | int32_t iMbXy) { |
| 282 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; | 282 | uint32_t uiNnz32b0, uiNnz32b1, uiNnz32b2, uiNnz32b3; |
| 283 | int8_t* iRefIndex[LIST_A]; | 283 | int8_t* iRefIndex[LIST_A]; |
| 284 | iRefIndex[LIST_0] = pCurDqLayer->pRefIndex[LIST_0][iMbXy]; | 284 | iRefIndex[LIST_0] = pCurDqLayer->pRefIndex[LIST_0][iMbXy]; |
| 285 | iRefIndex[LIST_1] = pCurDqLayer->pRefIndex[LIST_1][iMbXy]; | 285 | iRefIndex[LIST_1] = pCurDqLayer->pRefIndex[LIST_1][iMbXy]; |
| 286 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBsx4, 4, 4); | 286 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBsx4, 4, 4); |
| 287 | 287 | ||
| 288 | int8_t i8x8NnzTab[4]; | 288 | int8_t i8x8NnzTab[4]; |
| 289 | 289 | ||
| 290 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { | 290 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 291 | for (int32_t i = 0; i < 4; i++) { | 291 | for (int32_t i = 0; i < 4; i++) { |
| 292 | int32_t iBlkIdx = i << 2; | 292 | int32_t iBlkIdx = i << 2; |
| 293 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | | 293 | i8x8NnzTab[i] = (pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 1]] | |
| 294 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); | 294 | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 2]] | pNnzTab[g_kuiMbCountScan4Idx[iBlkIdx + 3]]); |
| 295 | } | 295 | } |
| 296 | //vertical | 296 | //vertical |
| 297 | int8_t iIndex = g_kuiMbCountScan4Idx[1 << 2]; | 297 | int8_t iIndex = g_kuiMbCountScan4Idx[1 << 2]; |
| 298 | int8_t iNeigborIndex = g_kuiMbCountScan4Idx[0]; | 298 | int8_t iNeigborIndex = g_kuiMbCountScan4Idx[0]; |
| 299 | nBS[0][2][0] = nBS[0][2][1] = 1; | 299 | nBS[0][2][0] = nBS[0][2][1] = 1; |
| 300 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 300 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 301 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { | 301 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { |
| 302 | nBS[0][2][0] = nBS[0][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[1]), iRefIndex[listIdx], | 302 | nBS[0][2][0] = nBS[0][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[1]), iRefIndex[listIdx], |
| 303 | pCurDqLayer->pMv[listIdx][iMbXy], | 303 | pCurDqLayer->pMv[listIdx][iMbXy], |
| 304 | iIndex, iNeigborIndex); | 304 | iIndex, iNeigborIndex); |
| 305 | break; | 305 | break; |
| 306 | } | 306 | } |
| 307 | } | 307 | } |
| 308 | iIndex = g_kuiMbCountScan4Idx[3 << 2]; | 308 | iIndex = g_kuiMbCountScan4Idx[3 << 2]; |
| 309 | iNeigborIndex = g_kuiMbCountScan4Idx[2 << 2]; | 309 | iNeigborIndex = g_kuiMbCountScan4Idx[2 << 2]; |
| 310 | nBS[0][2][2] = nBS[0][2][3] = 1; | 310 | nBS[0][2][2] = nBS[0][2][3] = 1; |
| 311 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 311 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 312 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { | 312 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { |
| 313 | nBS[0][2][2] = nBS[0][2][3] = BS_EDGE ((i8x8NnzTab[2] | i8x8NnzTab[3]), iRefIndex[listIdx], | 313 | nBS[0][2][2] = nBS[0][2][3] = BS_EDGE ((i8x8NnzTab[2] | i8x8NnzTab[3]), iRefIndex[listIdx], |
| 314 | pCurDqLayer->pMv[listIdx][iMbXy], | 314 | pCurDqLayer->pMv[listIdx][iMbXy], |
| 315 | iIndex, iNeigborIndex); | 315 | iIndex, iNeigborIndex); |
| 316 | break; | 316 | break; |
| 317 | } | 317 | } |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | //horizontal | 320 | //horizontal |
| 321 | iIndex = g_kuiMbCountScan4Idx[2 << 2]; | 321 | iIndex = g_kuiMbCountScan4Idx[2 << 2]; |
| 322 | iNeigborIndex = g_kuiMbCountScan4Idx[0]; | 322 | iNeigborIndex = g_kuiMbCountScan4Idx[0]; |
| 323 | nBS[1][2][0] = nBS[1][2][1] = 1; | 323 | nBS[1][2][0] = nBS[1][2][1] = 1; |
| 324 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 324 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 325 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { | 325 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { |
| 326 | nBS[1][2][0] = nBS[1][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[2]), iRefIndex[listIdx], | 326 | nBS[1][2][0] = nBS[1][2][1] = BS_EDGE ((i8x8NnzTab[0] | i8x8NnzTab[2]), iRefIndex[listIdx], |
| 327 | pCurDqLayer->pMv[listIdx][iMbXy], | 327 | pCurDqLayer->pMv[listIdx][iMbXy], |
| 328 | iIndex, iNeigborIndex); | 328 | iIndex, iNeigborIndex); |
| 329 | break; | 329 | break; |
| 330 | } | 330 | } |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | iIndex = g_kuiMbCountScan4Idx[3 << 2]; | 333 | iIndex = g_kuiMbCountScan4Idx[3 << 2]; |
| 334 | iNeigborIndex = g_kuiMbCountScan4Idx[1 << 2]; | 334 | iNeigborIndex = g_kuiMbCountScan4Idx[1 << 2]; |
| 335 | nBS[1][2][2] = nBS[1][2][3] = 1; | 335 | nBS[1][2][2] = nBS[1][2][3] = 1; |
| 336 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 336 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 337 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { | 337 | if (iRefIndex[listIdx][iIndex] > REF_NOT_IN_LIST && iRefIndex[listIdx][iNeigborIndex] > REF_NOT_IN_LIST) { |
| 338 | nBS[1][2][2] = nBS[1][2][3] = BS_EDGE ((i8x8NnzTab[1] | i8x8NnzTab[3]), iRefIndex[listIdx], | 338 | nBS[1][2][2] = nBS[1][2][3] = BS_EDGE ((i8x8NnzTab[1] | i8x8NnzTab[3]), iRefIndex[listIdx], |
| 339 | pCurDqLayer->pMv[listIdx][iMbXy], | 339 | pCurDqLayer->pMv[listIdx][iMbXy], |
| 340 | iIndex, iNeigborIndex); | 340 | iIndex, iNeigborIndex); |
| 341 | break; | 341 | break; |
| 342 | } | 342 | } |
| 343 | } | 343 | } |
| 344 | } else { | 344 | } else { |
| 345 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); | 345 | uiNnz32b0 = * (uint32_t*) (pNnzTab + 0); |
| 346 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); | 346 | uiNnz32b1 = * (uint32_t*) (pNnzTab + 4); |
| 347 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); | 347 | uiNnz32b2 = * (uint32_t*) (pNnzTab + 8); |
| 348 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); | 348 | uiNnz32b3 = * (uint32_t*) (pNnzTab + 12); |
| 349 | 349 | ||
| 350 | for (int i = 0; i < 3; i++) | 350 | for (int i = 0; i < 3; i++) |
| 351 | uiBsx4[i] = pNnzTab[i] | pNnzTab[i + 1]; | 351 | uiBsx4[i] = pNnzTab[i] | pNnzTab[i + 1]; |
| 352 | nBS[0][1][0] = 1; | 352 | nBS[0][1][0] = 1; |
| 353 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 353 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 354 | if (iRefIndex[listIdx][1] > REF_NOT_IN_LIST && iRefIndex[listIdx][0] > REF_NOT_IN_LIST) { | 354 | if (iRefIndex[listIdx][1] > REF_NOT_IN_LIST && iRefIndex[listIdx][0] > REF_NOT_IN_LIST) { |
| 355 | nBS[0][1][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 1, 0); | 355 | nBS[0][1][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 1, 0); |
| 356 | break; | 356 | break; |
| 357 | } | 357 | } |
| 358 | } | 358 | } |
| 359 | nBS[0][2][0] = 1; | 359 | nBS[0][2][0] = 1; |
| 360 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 360 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 361 | if (iRefIndex[listIdx][2] > REF_NOT_IN_LIST && iRefIndex[listIdx][1] > REF_NOT_IN_LIST) { | 361 | if (iRefIndex[listIdx][2] > REF_NOT_IN_LIST && iRefIndex[listIdx][1] > REF_NOT_IN_LIST) { |
| 362 | nBS[0][2][0] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 2, 1); | 362 | nBS[0][2][0] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 2, 1); |
| 363 | break; | 363 | break; |
| 364 | } | 364 | } |
| 365 | } | 365 | } |
| 366 | nBS[0][3][0] = 1; | 366 | nBS[0][3][0] = 1; |
| 367 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 367 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 368 | if (iRefIndex[listIdx][3] > REF_NOT_IN_LIST && iRefIndex[listIdx][2] > REF_NOT_IN_LIST) { | 368 | if (iRefIndex[listIdx][3] > REF_NOT_IN_LIST && iRefIndex[listIdx][2] > REF_NOT_IN_LIST) { |
| 369 | nBS[0][3][0] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 3, 2); | 369 | nBS[0][3][0] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 3, 2); |
| 370 | break; | 370 | break; |
| 371 | } | 371 | } |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | for (int i = 0; i < 3; i++) | 374 | for (int i = 0; i < 3; i++) |
| 375 | uiBsx4[i] = pNnzTab[4 + i] | pNnzTab[4 + i + 1]; | 375 | uiBsx4[i] = pNnzTab[4 + i] | pNnzTab[4 + i + 1]; |
| 376 | nBS[0][1][1] = 1; | 376 | nBS[0][1][1] = 1; |
| 377 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 377 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 378 | if (iRefIndex[listIdx][5] > REF_NOT_IN_LIST && iRefIndex[listIdx][4] > REF_NOT_IN_LIST) { | 378 | if (iRefIndex[listIdx][5] > REF_NOT_IN_LIST && iRefIndex[listIdx][4] > REF_NOT_IN_LIST) { |
| 379 | nBS[0][1][1] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 5, 4); | 379 | nBS[0][1][1] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 5, 4); |
| 380 | break; | 380 | break; |
| 381 | } | 381 | } |
| 382 | } | 382 | } |
| 383 | nBS[0][2][1] = 1; | 383 | nBS[0][2][1] = 1; |
| 384 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 384 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 385 | if (iRefIndex[listIdx][6] > REF_NOT_IN_LIST && iRefIndex[listIdx][5] > REF_NOT_IN_LIST) { | 385 | if (iRefIndex[listIdx][6] > REF_NOT_IN_LIST && iRefIndex[listIdx][5] > REF_NOT_IN_LIST) { |
| 386 | nBS[0][2][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 6, 5); | 386 | nBS[0][2][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 6, 5); |
| 387 | break; | 387 | break; |
| 388 | } | 388 | } |
| 389 | } | 389 | } |
| 390 | nBS[0][3][1] = 1; | 390 | nBS[0][3][1] = 1; |
| 391 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 391 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 392 | if (iRefIndex[listIdx][7] > REF_NOT_IN_LIST && iRefIndex[listIdx][6] > REF_NOT_IN_LIST) { | 392 | if (iRefIndex[listIdx][7] > REF_NOT_IN_LIST && iRefIndex[listIdx][6] > REF_NOT_IN_LIST) { |
| 393 | nBS[0][3][1] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 7, 6); | 393 | nBS[0][3][1] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 7, 6); |
| 394 | break; | 394 | break; |
| 395 | } | 395 | } |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | for (int i = 0; i < 3; i++) | 398 | for (int i = 0; i < 3; i++) |
| 399 | uiBsx4[i] = pNnzTab[8 + i] | pNnzTab[8 + i + 1]; | 399 | uiBsx4[i] = pNnzTab[8 + i] | pNnzTab[8 + i + 1]; |
| 400 | nBS[0][1][2] = 1; | 400 | nBS[0][1][2] = 1; |
| 401 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 401 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 402 | if (iRefIndex[listIdx][9] > REF_NOT_IN_LIST && iRefIndex[listIdx][8] > REF_NOT_IN_LIST) { | 402 | if (iRefIndex[listIdx][9] > REF_NOT_IN_LIST && iRefIndex[listIdx][8] > REF_NOT_IN_LIST) { |
| 403 | nBS[0][1][2] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 9, 8); | 403 | nBS[0][1][2] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 9, 8); |
| 404 | break; | 404 | break; |
| 405 | } | 405 | } |
| 406 | } | 406 | } |
| 407 | nBS[0][2][2] = 1; | 407 | nBS[0][2][2] = 1; |
| 408 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 408 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 409 | if (iRefIndex[listIdx][10] > REF_NOT_IN_LIST && iRefIndex[listIdx][9] > REF_NOT_IN_LIST) { | 409 | if (iRefIndex[listIdx][10] > REF_NOT_IN_LIST && iRefIndex[listIdx][9] > REF_NOT_IN_LIST) { |
| 410 | nBS[0][2][2] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 10, 9); | 410 | nBS[0][2][2] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 10, 9); |
| 411 | break; | 411 | break; |
| 412 | } | 412 | } |
| 413 | } | 413 | } |
| 414 | nBS[0][3][2] = 1; | 414 | nBS[0][3][2] = 1; |
| 415 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 415 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 416 | if (iRefIndex[listIdx][11] > REF_NOT_IN_LIST && iRefIndex[listIdx][10] > REF_NOT_IN_LIST) { | 416 | if (iRefIndex[listIdx][11] > REF_NOT_IN_LIST && iRefIndex[listIdx][10] > REF_NOT_IN_LIST) { |
| 417 | nBS[0][3][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 11, 10); | 417 | nBS[0][3][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 11, 10); |
| 418 | break; | 418 | break; |
| 419 | } | 419 | } |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | for (int i = 0; i < 3; i++) | 422 | for (int i = 0; i < 3; i++) |
| 423 | uiBsx4[i] = pNnzTab[12 + i] | pNnzTab[12 + i + 1]; | 423 | uiBsx4[i] = pNnzTab[12 + i] | pNnzTab[12 + i + 1]; |
| 424 | nBS[0][1][3] = 1; | 424 | nBS[0][1][3] = 1; |
| 425 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 425 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 426 | if (iRefIndex[listIdx][13] > REF_NOT_IN_LIST && iRefIndex[listIdx][12] > REF_NOT_IN_LIST) { | 426 | if (iRefIndex[listIdx][13] > REF_NOT_IN_LIST && iRefIndex[listIdx][12] > REF_NOT_IN_LIST) { |
| 427 | nBS[0][1][3] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 13, 12); | 427 | nBS[0][1][3] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 13, 12); |
| 428 | break; | 428 | break; |
| 429 | } | 429 | } |
| 430 | } | 430 | } |
| 431 | nBS[0][2][3] = 1; | 431 | nBS[0][2][3] = 1; |
| 432 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 432 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 433 | if (iRefIndex[listIdx][14] > REF_NOT_IN_LIST && iRefIndex[listIdx][13] > REF_NOT_IN_LIST) { | 433 | if (iRefIndex[listIdx][14] > REF_NOT_IN_LIST && iRefIndex[listIdx][13] > REF_NOT_IN_LIST) { |
| 434 | nBS[0][2][3] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 14, 13); | 434 | nBS[0][2][3] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 14, 13); |
| 435 | break; | 435 | break; |
| 436 | } | 436 | } |
| 437 | } | 437 | } |
| 438 | nBS[0][3][3] = 1; | 438 | nBS[0][3][3] = 1; |
| 439 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 439 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 440 | if (iRefIndex[listIdx][15] > REF_NOT_IN_LIST && iRefIndex[listIdx][14] > REF_NOT_IN_LIST) { | 440 | if (iRefIndex[listIdx][15] > REF_NOT_IN_LIST && iRefIndex[listIdx][14] > REF_NOT_IN_LIST) { |
| 441 | nBS[0][3][3] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 15, 14); | 441 | nBS[0][3][3] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 15, 14); |
| 442 | break; | 442 | break; |
| 443 | } | 443 | } |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | // horizontal | 446 | // horizontal |
| 447 | * (uint32_t*)uiBsx4 = (uiNnz32b0 | uiNnz32b1); | 447 | * (uint32_t*)uiBsx4 = (uiNnz32b0 | uiNnz32b1); |
| 448 | nBS[1][1][0] = 1; | 448 | nBS[1][1][0] = 1; |
| 449 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 449 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 450 | if (iRefIndex[listIdx][4] > REF_NOT_IN_LIST && iRefIndex[listIdx][0] > REF_NOT_IN_LIST) { | 450 | if (iRefIndex[listIdx][4] > REF_NOT_IN_LIST && iRefIndex[listIdx][0] > REF_NOT_IN_LIST) { |
| 451 | nBS[1][1][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 4, 0); | 451 | nBS[1][1][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 4, 0); |
| 452 | break; | 452 | break; |
| 453 | } | 453 | } |
| 454 | } | 454 | } |
| 455 | nBS[1][1][1] = 1; | 455 | nBS[1][1][1] = 1; |
| 456 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 456 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 457 | if (iRefIndex[listIdx][5] > REF_NOT_IN_LIST && iRefIndex[listIdx][1] > REF_NOT_IN_LIST) { | 457 | if (iRefIndex[listIdx][5] > REF_NOT_IN_LIST && iRefIndex[listIdx][1] > REF_NOT_IN_LIST) { |
| 458 | nBS[1][1][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 5, 1); | 458 | nBS[1][1][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 5, 1); |
| 459 | break; | 459 | break; |
| 460 | } | 460 | } |
| 461 | } | 461 | } |
| 462 | nBS[1][1][2] = 1; | 462 | nBS[1][1][2] = 1; |
| 463 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 463 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 464 | if (iRefIndex[listIdx][6] > REF_NOT_IN_LIST && iRefIndex[listIdx][2] > REF_NOT_IN_LIST) { | 464 | if (iRefIndex[listIdx][6] > REF_NOT_IN_LIST && iRefIndex[listIdx][2] > REF_NOT_IN_LIST) { |
| 465 | nBS[1][1][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 6, 2); | 465 | nBS[1][1][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 6, 2); |
| 466 | break; | 466 | break; |
| 467 | } | 467 | } |
| 468 | } | 468 | } |
| 469 | nBS[1][1][3] = 1; | 469 | nBS[1][1][3] = 1; |
| 470 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 470 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 471 | if (iRefIndex[listIdx][7] > REF_NOT_IN_LIST && iRefIndex[listIdx][3] > REF_NOT_IN_LIST) { | 471 | if (iRefIndex[listIdx][7] > REF_NOT_IN_LIST && iRefIndex[listIdx][3] > REF_NOT_IN_LIST) { |
| 472 | nBS[1][1][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 7, 3); | 472 | nBS[1][1][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 7, 3); |
| 473 | break; | 473 | break; |
| 474 | } | 474 | } |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | * (uint32_t*)uiBsx4 = (uiNnz32b1 | uiNnz32b2); | 477 | * (uint32_t*)uiBsx4 = (uiNnz32b1 | uiNnz32b2); |
| 478 | nBS[1][2][0] = 1; | 478 | nBS[1][2][0] = 1; |
| 479 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 479 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 480 | if (iRefIndex[listIdx][8] > REF_NOT_IN_LIST && iRefIndex[listIdx][4] > REF_NOT_IN_LIST) { | 480 | if (iRefIndex[listIdx][8] > REF_NOT_IN_LIST && iRefIndex[listIdx][4] > REF_NOT_IN_LIST) { |
| 481 | nBS[1][2][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 8, 4); | 481 | nBS[1][2][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 8, 4); |
| 482 | break; | 482 | break; |
| 483 | } | 483 | } |
| 484 | } | 484 | } |
| 485 | nBS[1][2][1] = 1; | 485 | nBS[1][2][1] = 1; |
| 486 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 486 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 487 | if (iRefIndex[listIdx][9] > REF_NOT_IN_LIST && iRefIndex[listIdx][5] > REF_NOT_IN_LIST) { | 487 | if (iRefIndex[listIdx][9] > REF_NOT_IN_LIST && iRefIndex[listIdx][5] > REF_NOT_IN_LIST) { |
| 488 | nBS[1][2][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 9, 5); | 488 | nBS[1][2][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 9, 5); |
| 489 | break; | 489 | break; |
| 490 | } | 490 | } |
| 491 | } | 491 | } |
| 492 | nBS[1][2][2] = 1; | 492 | nBS[1][2][2] = 1; |
| 493 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 493 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 494 | if (iRefIndex[listIdx][10] > REF_NOT_IN_LIST && iRefIndex[listIdx][6] > REF_NOT_IN_LIST) { | 494 | if (iRefIndex[listIdx][10] > REF_NOT_IN_LIST && iRefIndex[listIdx][6] > REF_NOT_IN_LIST) { |
| 495 | nBS[1][2][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 10, 6); | 495 | nBS[1][2][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 10, 6); |
| 496 | break; | 496 | break; |
| 497 | } | 497 | } |
| 498 | } | 498 | } |
| 499 | nBS[1][2][3] = 1; | 499 | nBS[1][2][3] = 1; |
| 500 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 500 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 501 | if (iRefIndex[listIdx][11] > REF_NOT_IN_LIST && iRefIndex[listIdx][7] > REF_NOT_IN_LIST) { | 501 | if (iRefIndex[listIdx][11] > REF_NOT_IN_LIST && iRefIndex[listIdx][7] > REF_NOT_IN_LIST) { |
| 502 | nBS[1][2][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 11, 7); | 502 | nBS[1][2][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 11, 7); |
| 503 | break; | 503 | break; |
| 504 | } | 504 | } |
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | * (uint32_t*)uiBsx4 = (uiNnz32b2 | uiNnz32b3); | 507 | * (uint32_t*)uiBsx4 = (uiNnz32b2 | uiNnz32b3); |
| 508 | nBS[1][3][0] = 1; | 508 | nBS[1][3][0] = 1; |
| 509 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 509 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 510 | if (iRefIndex[listIdx][12] > REF_NOT_IN_LIST && iRefIndex[listIdx][8] > REF_NOT_IN_LIST) { | 510 | if (iRefIndex[listIdx][12] > REF_NOT_IN_LIST && iRefIndex[listIdx][8] > REF_NOT_IN_LIST) { |
| 511 | nBS[1][3][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 12, 8); | 511 | nBS[1][3][0] = BS_EDGE (uiBsx4[0], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 12, 8); |
| 512 | break; | 512 | break; |
| 513 | } | 513 | } |
| 514 | } | 514 | } |
| 515 | nBS[1][3][1] = 1; | 515 | nBS[1][3][1] = 1; |
| 516 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 516 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 517 | if (iRefIndex[listIdx][13] > REF_NOT_IN_LIST && iRefIndex[listIdx][9] > REF_NOT_IN_LIST) { | 517 | if (iRefIndex[listIdx][13] > REF_NOT_IN_LIST && iRefIndex[listIdx][9] > REF_NOT_IN_LIST) { |
| 518 | nBS[1][3][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 13, 9); | 518 | nBS[1][3][1] = BS_EDGE (uiBsx4[1], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 13, 9); |
| 519 | break; | 519 | break; |
| 520 | } | 520 | } |
| 521 | } | 521 | } |
| 522 | nBS[1][3][2] = 1; | 522 | nBS[1][3][2] = 1; |
| 523 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 523 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 524 | if (iRefIndex[listIdx][14] > REF_NOT_IN_LIST && iRefIndex[listIdx][10] > REF_NOT_IN_LIST) { | 524 | if (iRefIndex[listIdx][14] > REF_NOT_IN_LIST && iRefIndex[listIdx][10] > REF_NOT_IN_LIST) { |
| 525 | nBS[1][3][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 14, 10); | 525 | nBS[1][3][2] = BS_EDGE (uiBsx4[2], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 14, 10); |
| 526 | break; | 526 | break; |
| 527 | } | 527 | } |
| 528 | } | 528 | } |
| 529 | nBS[1][3][3] = 1; | 529 | nBS[1][3][3] = 1; |
| 530 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 530 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 531 | if (iRefIndex[listIdx][15] > REF_NOT_IN_LIST && iRefIndex[listIdx][11] > REF_NOT_IN_LIST) { | 531 | if (iRefIndex[listIdx][15] > REF_NOT_IN_LIST && iRefIndex[listIdx][11] > REF_NOT_IN_LIST) { |
| 532 | nBS[1][3][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 15, 11); | 532 | nBS[1][3][3] = BS_EDGE (uiBsx4[3], iRefIndex[listIdx], pCurDqLayer->pMv[listIdx][iMbXy], 15, 11); |
| 533 | break; | 533 | break; |
| 534 | } | 534 | } |
| 535 | } | 535 | } |
| 536 | } | 536 | } |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | 539 | ||
| 540 | uint32_t DeblockingBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy) { | 540 | uint32_t DeblockingBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy) { |
| 541 | int32_t i, j; | 541 | int32_t i, j; |
| 542 | uint32_t uiBSx4; | 542 | uint32_t uiBSx4; |
| 543 | uint8_t* pBS = (uint8_t*) (&uiBSx4); | 543 | uint8_t* pBS = (uint8_t*) (&uiBSx4); |
| 544 | const uint8_t* pBIdx = &g_kuiTableBIdx[iEdge][0]; | 544 | const uint8_t* pBIdx = &g_kuiTableBIdx[iEdge][0]; |
| 545 | const uint8_t* pBnIdx = &g_kuiTableBIdx[iEdge][4]; | 545 | const uint8_t* pBnIdx = &g_kuiTableBIdx[iEdge][4]; |
| 546 | const uint8_t* pB8x8Idx = &g_kuiTableB8x8Idx[iEdge][0]; | 546 | const uint8_t* pB8x8Idx = &g_kuiTableB8x8Idx[iEdge][0]; |
| 547 | const uint8_t* pBn8x8Idx = &g_kuiTableB8x8Idx[iEdge][8]; | 547 | const uint8_t* pBn8x8Idx = &g_kuiTableB8x8Idx[iEdge][8]; |
| 548 | 548 | ||
| 549 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy] && pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { | 549 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy] && pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { |
| 550 | for (i = 0; i < 2; i++) { | 550 | for (i = 0; i < 2; i++) { |
| 551 | uint8_t uiNzc = 0; | 551 | uint8_t uiNzc = 0; |
| 552 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 552 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 553 | uiNzc |= (pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)] | pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]); | 553 | uiNzc |= (pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)] | pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]); |
| 554 | } | 554 | } |
| 555 | if (uiNzc) { | 555 | if (uiNzc) { |
| 556 | pBS[i << 1] = pBS[1 + (i << 1)] = 2; | 556 | pBS[i << 1] = pBS[1 + (i << 1)] = 2; |
| 557 | } else { | 557 | } else { |
| 558 | pBS[i << 1] = pBS[1 + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, | 558 | pBS[i << 1] = pBS[1 + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, |
| 559 | *pB8x8Idx, *pBn8x8Idx); | 559 | *pB8x8Idx, *pBn8x8Idx); |
| 560 | } | 560 | } |
| 561 | pB8x8Idx += 4; | 561 | pB8x8Idx += 4; |
| 562 | pBn8x8Idx += 4; | 562 | pBn8x8Idx += 4; |
| 563 | } | 563 | } |
| 564 | } else if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { | 564 | } else if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 565 | for (i = 0; i < 2; i++) { | 565 | for (i = 0; i < 2; i++) { |
| 566 | uint8_t uiNzc = 0; | 566 | uint8_t uiNzc = 0; |
| 567 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 567 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 568 | uiNzc |= pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)]; | 568 | uiNzc |= pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)]; |
| 569 | } | 569 | } |
| 570 | for (j = 0; j < 2; j++) { | 570 | for (j = 0; j < 2; j++) { |
| 571 | if (uiNzc | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { | 571 | if (uiNzc | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { |
| 572 | pBS[j + (i << 1)] = 2; | 572 | pBS[j + (i << 1)] = 2; |
| 573 | } else { | 573 | } else { |
| 574 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pB8x8Idx, | 574 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pB8x8Idx, |
| 575 | *pBnIdx); | 575 | *pBnIdx); |
| 576 | } | 576 | } |
| 577 | pBnIdx++; | 577 | pBnIdx++; |
| 578 | } | 578 | } |
| 579 | pB8x8Idx += 4; | 579 | pB8x8Idx += 4; |
| 580 | } | 580 | } |
| 581 | } else if (pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { | 581 | } else if (pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { |
| 582 | for (i = 0; i < 2; i++) { | 582 | for (i = 0; i < 2; i++) { |
| 583 | uint8_t uiNzc = 0; | 583 | uint8_t uiNzc = 0; |
| 584 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 584 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 585 | uiNzc |= pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]; | 585 | uiNzc |= pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]; |
| 586 | } | 586 | } |
| 587 | for (j = 0; j < 2; j++) { | 587 | for (j = 0; j < 2; j++) { |
| 588 | if (uiNzc | pCurDqLayer->pNzc[iMbXy][*pBIdx]) { | 588 | if (uiNzc | pCurDqLayer->pNzc[iMbXy][*pBIdx]) { |
| 589 | pBS[j + (i << 1)] = 2; | 589 | pBS[j + (i << 1)] = 2; |
| 590 | } else { | 590 | } else { |
| 591 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pBIdx, | 591 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pBIdx, |
| 592 | *pBn8x8Idx); | 592 | *pBn8x8Idx); |
| 593 | } | 593 | } |
| 594 | pBIdx++; | 594 | pBIdx++; |
| 595 | } | 595 | } |
| 596 | pBn8x8Idx += 4; | 596 | pBn8x8Idx += 4; |
| 597 | } | 597 | } |
| 598 | } else { | 598 | } else { |
| 599 | // only 4x4 transform | 599 | // only 4x4 transform |
| 600 | for (i = 0; i < 4; i++) { | 600 | for (i = 0; i < 4; i++) { |
| 601 | if (pCurDqLayer->pNzc[iMbXy][*pBIdx] | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { | 601 | if (pCurDqLayer->pNzc[iMbXy][*pBIdx] | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { |
| 602 | pBS[i] = 2; | 602 | pBS[i] = 2; |
| 603 | } else { | 603 | } else { |
| 604 | pBS[i] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pBIdx, | 604 | pBS[i] = MB_BS_MV (pCurDqLayer->pRefIndex[LIST_0], pCurDqLayer->pMv[LIST_0], iMbXy, iNeighMb, *pBIdx, |
| 605 | *pBnIdx); | 605 | *pBnIdx); |
| 606 | } | 606 | } |
| 607 | pBIdx++; | 607 | pBIdx++; |
| 608 | pBnIdx++; | 608 | pBnIdx++; |
| 609 | } | 609 | } |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | return uiBSx4; | 612 | return uiBSx4; |
| 613 | } | 613 | } |
| 614 | uint32_t DeblockingBSliceBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy) { | 614 | uint32_t DeblockingBSliceBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy) { |
| 615 | int32_t i, j; | 615 | int32_t i, j; |
| 616 | uint32_t uiBSx4; | 616 | uint32_t uiBSx4; |
| 617 | uint8_t* pBS = (uint8_t*) (&uiBSx4); | 617 | uint8_t* pBS = (uint8_t*) (&uiBSx4); |
| 618 | const uint8_t* pBIdx = &g_kuiTableBIdx[iEdge][0]; | 618 | const uint8_t* pBIdx = &g_kuiTableBIdx[iEdge][0]; |
| 619 | const uint8_t* pBnIdx = &g_kuiTableBIdx[iEdge][4]; | 619 | const uint8_t* pBnIdx = &g_kuiTableBIdx[iEdge][4]; |
| 620 | const uint8_t* pB8x8Idx = &g_kuiTableB8x8Idx[iEdge][0]; | 620 | const uint8_t* pB8x8Idx = &g_kuiTableB8x8Idx[iEdge][0]; |
| 621 | const uint8_t* pBn8x8Idx = &g_kuiTableB8x8Idx[iEdge][8]; | 621 | const uint8_t* pBn8x8Idx = &g_kuiTableB8x8Idx[iEdge][8]; |
| 622 | 622 | ||
| 623 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy] && pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { | 623 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy] && pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { |
| 624 | for (i = 0; i < 2; i++) { | 624 | for (i = 0; i < 2; i++) { |
| 625 | uint8_t uiNzc = 0; | 625 | uint8_t uiNzc = 0; |
| 626 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 626 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 627 | uiNzc |= (pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)] | pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]); | 627 | uiNzc |= (pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)] | pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]); |
| 628 | } | 628 | } |
| 629 | if (uiNzc) { | 629 | if (uiNzc) { |
| 630 | pBS[i << 1] = pBS[1 + (i << 1)] = 2; | 630 | pBS[i << 1] = pBS[1 + (i << 1)] = 2; |
| 631 | } else { | 631 | } else { |
| 632 | pBS[i << 1] = pBS[1 + (i << 1)] = 1; | 632 | pBS[i << 1] = pBS[1 + (i << 1)] = 1; |
| 633 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 633 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 634 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pB8x8Idx] > REF_NOT_IN_LIST | 634 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pB8x8Idx] > REF_NOT_IN_LIST |
| 635 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBn8x8Idx] > REF_NOT_IN_LIST) { | 635 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBn8x8Idx] > REF_NOT_IN_LIST) { |
| 636 | pBS[i << 1] = pBS[1 + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, | 636 | pBS[i << 1] = pBS[1 + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, |
| 637 | *pB8x8Idx, *pBn8x8Idx); | 637 | *pB8x8Idx, *pBn8x8Idx); |
| 638 | break; | 638 | break; |
| 639 | } | 639 | } |
| 640 | } | 640 | } |
| 641 | } | 641 | } |
| 642 | pB8x8Idx += 4; | 642 | pB8x8Idx += 4; |
| 643 | pBn8x8Idx += 4; | 643 | pBn8x8Idx += 4; |
| 644 | } | 644 | } |
| 645 | } else if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { | 645 | } else if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 646 | for (i = 0; i < 2; i++) { | 646 | for (i = 0; i < 2; i++) { |
| 647 | uint8_t uiNzc = 0; | 647 | uint8_t uiNzc = 0; |
| 648 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 648 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 649 | uiNzc |= pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)]; | 649 | uiNzc |= pCurDqLayer->pNzc[iMbXy][* (pB8x8Idx + j)]; |
| 650 | } | 650 | } |
| 651 | for (j = 0; j < 2; j++) { | 651 | for (j = 0; j < 2; j++) { |
| 652 | if (uiNzc | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { | 652 | if (uiNzc | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { |
| 653 | pBS[j + (i << 1)] = 2; | 653 | pBS[j + (i << 1)] = 2; |
| 654 | } else { | 654 | } else { |
| 655 | pBS[j + (i << 1)] = 1; | 655 | pBS[j + (i << 1)] = 1; |
| 656 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 656 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 657 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pB8x8Idx] > REF_NOT_IN_LIST | 657 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pB8x8Idx] > REF_NOT_IN_LIST |
| 658 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBnIdx] > REF_NOT_IN_LIST) { | 658 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBnIdx] > REF_NOT_IN_LIST) { |
| 659 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pB8x8Idx, | 659 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pB8x8Idx, |
| 660 | *pBnIdx); | 660 | *pBnIdx); |
| 661 | break; | 661 | break; |
| 662 | } | 662 | } |
| 663 | } | 663 | } |
| 664 | } | 664 | } |
| 665 | pBnIdx++; | 665 | pBnIdx++; |
| 666 | } | 666 | } |
| 667 | pB8x8Idx += 4; | 667 | pB8x8Idx += 4; |
| 668 | } | 668 | } |
| 669 | } else if (pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { | 669 | } else if (pCurDqLayer->pTransformSize8x8Flag[iNeighMb]) { |
| 670 | for (i = 0; i < 2; i++) { | 670 | for (i = 0; i < 2; i++) { |
| 671 | uint8_t uiNzc = 0; | 671 | uint8_t uiNzc = 0; |
| 672 | for (j = 0; uiNzc == 0 && j < 4; j++) { | 672 | for (j = 0; uiNzc == 0 && j < 4; j++) { |
| 673 | uiNzc |= pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]; | 673 | uiNzc |= pCurDqLayer->pNzc[iNeighMb][* (pBn8x8Idx + j)]; |
| 674 | } | 674 | } |
| 675 | for (j = 0; j < 2; j++) { | 675 | for (j = 0; j < 2; j++) { |
| 676 | if (uiNzc | pCurDqLayer->pNzc[iMbXy][*pBIdx]) { | 676 | if (uiNzc | pCurDqLayer->pNzc[iMbXy][*pBIdx]) { |
| 677 | pBS[j + (i << 1)] = 2; | 677 | pBS[j + (i << 1)] = 2; |
| 678 | } else { | 678 | } else { |
| 679 | pBS[j + (i << 1)] = 1; | 679 | pBS[j + (i << 1)] = 1; |
| 680 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 680 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 681 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBIdx] > REF_NOT_IN_LIST | 681 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBIdx] > REF_NOT_IN_LIST |
| 682 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBn8x8Idx] > REF_NOT_IN_LIST) { | 682 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBn8x8Idx] > REF_NOT_IN_LIST) { |
| 683 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pBIdx, | 683 | pBS[j + (i << 1)] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pBIdx, |
| 684 | *pBn8x8Idx); | 684 | *pBn8x8Idx); |
| 685 | break; | 685 | break; |
| 686 | } | 686 | } |
| 687 | } | 687 | } |
| 688 | } | 688 | } |
| 689 | pBIdx++; | 689 | pBIdx++; |
| 690 | } | 690 | } |
| 691 | pBn8x8Idx += 4; | 691 | pBn8x8Idx += 4; |
| 692 | } | 692 | } |
| 693 | } else { | 693 | } else { |
| 694 | // only 4x4 transform | 694 | // only 4x4 transform |
| 695 | for (i = 0; i < 4; i++) { | 695 | for (i = 0; i < 4; i++) { |
| 696 | if (pCurDqLayer->pNzc[iMbXy][*pBIdx] | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { | 696 | if (pCurDqLayer->pNzc[iMbXy][*pBIdx] | pCurDqLayer->pNzc[iNeighMb][*pBnIdx]) { |
| 697 | pBS[i] = 2; | 697 | pBS[i] = 2; |
| 698 | } else { | 698 | } else { |
| 699 | pBS[i] = 1; | 699 | pBS[i] = 1; |
| 700 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 700 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 701 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBIdx] > REF_NOT_IN_LIST | 701 | if (pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBIdx] > REF_NOT_IN_LIST |
| 702 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBnIdx] > REF_NOT_IN_LIST) { | 702 | && pCurDqLayer->pRefIndex[listIdx][iMbXy][*pBnIdx] > REF_NOT_IN_LIST) { |
| 703 | pBS[i] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pBIdx, *pBnIdx); | 703 | pBS[i] = MB_BS_MV (pCurDqLayer->pRefIndex[listIdx], pCurDqLayer->pMv[listIdx], iMbXy, iNeighMb, *pBIdx, *pBnIdx); |
| 704 | break; | 704 | break; |
| 705 | } | 705 | } |
| 706 | } | 706 | } |
| 707 | } | 707 | } |
| 708 | pBIdx++; | 708 | pBIdx++; |
| 709 | pBnIdx++; | 709 | pBnIdx++; |
| 710 | } | 710 | } |
| 711 | } | 711 | } |
| 712 | 712 | ||
| 713 | return uiBSx4; | 713 | return uiBSx4; |
| 714 | } | 714 | } |
| 715 | int32_t DeblockingAvailableNoInterlayer (PDqLayer pCurDqLayer, int32_t iFilterIdc) { | 715 | int32_t DeblockingAvailableNoInterlayer (PDqLayer pCurDqLayer, int32_t iFilterIdc) { |
| 716 | int32_t iMbY = pCurDqLayer->iMbY; | 716 | int32_t iMbY = pCurDqLayer->iMbY; |
| 717 | int32_t iMbX = pCurDqLayer->iMbX; | 717 | int32_t iMbX = pCurDqLayer->iMbX; |
| 718 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; | 718 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 719 | bool bLeftFlag = false; | 719 | bool bLeftFlag = false; |
| 720 | bool bTopFlag = false; | 720 | bool bTopFlag = false; |
| 721 | 721 | ||
| 722 | if (2 == iFilterIdc) { | 722 | if (2 == iFilterIdc) { |
| 723 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); | 723 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); |
| 724 | bTopFlag = (iMbY > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - pCurDqLayer->iMbWidth]); | 724 | bTopFlag = (iMbY > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - pCurDqLayer->iMbWidth]); |
| 725 | } else { //if ( 0 == iFilterIdc ) | 725 | } else { //if ( 0 == iFilterIdc ) |
| 726 | bLeftFlag = (iMbX > 0); | 726 | bLeftFlag = (iMbX > 0); |
| 727 | bTopFlag = (iMbY > 0); | 727 | bTopFlag = (iMbY > 0); |
| 728 | } | 728 | } |
| 729 | return (bLeftFlag << LEFT_FLAG_BIT) | (bTopFlag << TOP_FLAG_BIT); | 729 | return (bLeftFlag << LEFT_FLAG_BIT) | (bTopFlag << TOP_FLAG_BIT); |
| 730 | } | 730 | } |
| 731 | 731 | ||
| 732 | void FilteringEdgeLumaH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 732 | void FilteringEdgeLumaH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 733 | int32_t iIndexA; | 733 | int32_t iIndexA; |
| 734 | int32_t iAlpha; | 734 | int32_t iAlpha; |
| 735 | int32_t iBeta; | 735 | int32_t iBeta; |
| 736 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); | 736 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); |
| 737 | 737 | ||
| 738 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 738 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 739 | iBeta); | 739 | iBeta); |
| 740 | 740 | ||
| 741 | if (iAlpha | iBeta) { | 741 | if (iAlpha | iBeta) { |
| 742 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 0); | 742 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 0); |
| 743 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (pPix, iStride, iAlpha, iBeta, tc); | 743 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (pPix, iStride, iAlpha, iBeta, tc); |
| 744 | } | 744 | } |
| 745 | return; | 745 | return; |
| 746 | } | 746 | } |
| 747 | 747 | ||
| 748 | 748 | ||
| 749 | void FilteringEdgeLumaV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 749 | void FilteringEdgeLumaV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 750 | int32_t iIndexA; | 750 | int32_t iIndexA; |
| 751 | int32_t iAlpha; | 751 | int32_t iAlpha; |
| 752 | int32_t iBeta; | 752 | int32_t iBeta; |
| 753 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); | 753 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); |
| 754 | 754 | ||
| 755 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 755 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 756 | iBeta); | 756 | iBeta); |
| 757 | 757 | ||
| 758 | if (iAlpha | iBeta) { | 758 | if (iAlpha | iBeta) { |
| 759 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 0); | 759 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 0); |
| 760 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (pPix, iStride, iAlpha, iBeta, tc); | 760 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (pPix, iStride, iAlpha, iBeta, tc); |
| 761 | } | 761 | } |
| 762 | return; | 762 | return; |
| 763 | } | 763 | } |
| 764 | 764 | ||
| 765 | 765 | ||
| 766 | void FilteringEdgeLumaIntraH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 766 | void FilteringEdgeLumaIntraH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 767 | int32_t iIndexA; | 767 | int32_t iIndexA; |
| 768 | int32_t iAlpha; | 768 | int32_t iAlpha; |
| 769 | int32_t iBeta; | 769 | int32_t iBeta; |
| 770 | 770 | ||
| 771 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 771 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 772 | iBeta); | 772 | iBeta); |
| 773 | 773 | ||
| 774 | if (iAlpha | iBeta) { | 774 | if (iAlpha | iBeta) { |
| 775 | pFilter->pLoopf->pfLumaDeblockingEQ4Ver (pPix, iStride, iAlpha, iBeta); | 775 | pFilter->pLoopf->pfLumaDeblockingEQ4Ver (pPix, iStride, iAlpha, iBeta); |
| 776 | } | 776 | } |
| 777 | return; | 777 | return; |
| 778 | } | 778 | } |
| 779 | 779 | ||
| 780 | void FilteringEdgeLumaIntraV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 780 | void FilteringEdgeLumaIntraV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 781 | int32_t iIndexA; | 781 | int32_t iIndexA; |
| 782 | int32_t iAlpha; | 782 | int32_t iAlpha; |
| 783 | int32_t iBeta; | 783 | int32_t iBeta; |
| 784 | 784 | ||
| 785 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 785 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 786 | iBeta); | 786 | iBeta); |
| 787 | 787 | ||
| 788 | if (iAlpha | iBeta) { | 788 | if (iAlpha | iBeta) { |
| 789 | pFilter->pLoopf->pfLumaDeblockingEQ4Hor (pPix, iStride, iAlpha, iBeta); | 789 | pFilter->pLoopf->pfLumaDeblockingEQ4Hor (pPix, iStride, iAlpha, iBeta); |
| 790 | } | 790 | } |
| 791 | return; | 791 | return; |
| 792 | } | 792 | } |
| 793 | void FilteringEdgeChromaH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 793 | void FilteringEdgeChromaH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 794 | uint8_t* pBS) { | 794 | uint8_t* pBS) { |
| 795 | int32_t iIndexA; | 795 | int32_t iIndexA; |
| 796 | int32_t iAlpha; | 796 | int32_t iAlpha; |
| 797 | int32_t iBeta; | 797 | int32_t iBeta; |
| 798 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); | 798 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); |
| 799 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { | 799 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { |
| 800 | 800 | ||
| 801 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 801 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 802 | iBeta); | 802 | iBeta); |
| 803 | 803 | ||
| 804 | if (iAlpha | iBeta) { | 804 | if (iAlpha | iBeta) { |
| 805 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); | 805 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); |
| 806 | pFilter->pLoopf->pfChromaDeblockingLT4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc); | 806 | pFilter->pLoopf->pfChromaDeblockingLT4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc); |
| 807 | } | 807 | } |
| 808 | } else { | 808 | } else { |
| 809 | 809 | ||
| 810 | for (int i = 0; i < 2; i++) { | 810 | for (int i = 0; i < 2; i++) { |
| 811 | 811 | ||
| 812 | 812 | ||
| 813 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 813 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 814 | iBeta); | 814 | iBeta); |
| 815 | 815 | ||
| 816 | if (iAlpha | iBeta) { | 816 | if (iAlpha | iBeta) { |
| 817 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; | 817 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; |
| 818 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); | 818 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); |
| 819 | pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pPixCbCr, iStride, iAlpha, iBeta, tc); | 819 | pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pPixCbCr, iStride, iAlpha, iBeta, tc); |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | 822 | ||
| 823 | 823 | ||
| 824 | } | 824 | } |
| 825 | 825 | ||
| 826 | } | 826 | } |
| 827 | return; | 827 | return; |
| 828 | } | 828 | } |
| 829 | void FilteringEdgeChromaV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 829 | void FilteringEdgeChromaV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 830 | uint8_t* pBS) { | 830 | uint8_t* pBS) { |
| 831 | int32_t iIndexA; | 831 | int32_t iIndexA; |
| 832 | int32_t iAlpha; | 832 | int32_t iAlpha; |
| 833 | int32_t iBeta; | 833 | int32_t iBeta; |
| 834 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); | 834 | ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16); |
| 835 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { | 835 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { |
| 836 | 836 | ||
| 837 | 837 | ||
| 838 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 838 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 839 | iBeta); | 839 | iBeta); |
| 840 | 840 | ||
| 841 | if (iAlpha | iBeta) { | 841 | if (iAlpha | iBeta) { |
| 842 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); | 842 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); |
| 843 | pFilter->pLoopf->pfChromaDeblockingLT4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc); | 843 | pFilter->pLoopf->pfChromaDeblockingLT4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc); |
| 844 | } | 844 | } |
| 845 | 845 | ||
| 846 | 846 | ||
| 847 | } else { | 847 | } else { |
| 848 | 848 | ||
| 849 | for (int i = 0; i < 2; i++) { | 849 | for (int i = 0; i < 2; i++) { |
| 850 | 850 | ||
| 851 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 851 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 852 | iBeta); | 852 | iBeta); |
| 853 | 853 | ||
| 854 | if (iAlpha | iBeta) { | 854 | if (iAlpha | iBeta) { |
| 855 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; | 855 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; |
| 856 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); | 856 | TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1); |
| 857 | pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pPixCbCr, iStride, iAlpha, iBeta, tc); | 857 | pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pPixCbCr, iStride, iAlpha, iBeta, tc); |
| 858 | } | 858 | } |
| 859 | 859 | ||
| 860 | 860 | ||
| 861 | } | 861 | } |
| 862 | } | 862 | } |
| 863 | return; | 863 | return; |
| 864 | } | 864 | } |
| 865 | 865 | ||
| 866 | void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 866 | void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 867 | uint8_t* pBS) { | 867 | uint8_t* pBS) { |
| 868 | int32_t iIndexA; | 868 | int32_t iIndexA; |
| 869 | int32_t iAlpha; | 869 | int32_t iAlpha; |
| 870 | int32_t iBeta; | 870 | int32_t iBeta; |
| 871 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { | 871 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { |
| 872 | 872 | ||
| 873 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 873 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 874 | iBeta); | 874 | iBeta); |
| 875 | 875 | ||
| 876 | if (iAlpha | iBeta) { | 876 | if (iAlpha | iBeta) { |
| 877 | pFilter->pLoopf->pfChromaDeblockingEQ4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta); | 877 | pFilter->pLoopf->pfChromaDeblockingEQ4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta); |
| 878 | } | 878 | } |
| 879 | } else { | 879 | } else { |
| 880 | 880 | ||
| 881 | for (int i = 0; i < 2; i++) { | 881 | for (int i = 0; i < 2; i++) { |
| 882 | 882 | ||
| 883 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 883 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 884 | iBeta); | 884 | iBeta); |
| 885 | 885 | ||
| 886 | if (iAlpha | iBeta) { | 886 | if (iAlpha | iBeta) { |
| 887 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; | 887 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; |
| 888 | pFilter->pLoopf->pfChromaDeblockingEQ4Ver2 (pPixCbCr, iStride, iAlpha, iBeta); | 888 | pFilter->pLoopf->pfChromaDeblockingEQ4Ver2 (pPixCbCr, iStride, iAlpha, iBeta); |
| 889 | } | 889 | } |
| 890 | 890 | ||
| 891 | } | 891 | } |
| 892 | } | 892 | } |
| 893 | return; | 893 | return; |
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | void FilteringEdgeChromaIntraV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 896 | void FilteringEdgeChromaIntraV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 897 | uint8_t* pBS) { | 897 | uint8_t* pBS) { |
| 898 | int32_t iIndexA; | 898 | int32_t iIndexA; |
| 899 | int32_t iAlpha; | 899 | int32_t iAlpha; |
| 900 | int32_t iBeta; | 900 | int32_t iBeta; |
| 901 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { // QP of cb and cr are the same | 901 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { // QP of cb and cr are the same |
| 902 | 902 | ||
| 903 | 903 | ||
| 904 | 904 | ||
| 905 | 905 | ||
| 906 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 906 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 907 | iBeta); | 907 | iBeta); |
| 908 | if (iAlpha | iBeta) { | 908 | if (iAlpha | iBeta) { |
| 909 | pFilter->pLoopf->pfChromaDeblockingEQ4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta); | 909 | pFilter->pLoopf->pfChromaDeblockingEQ4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta); |
| 910 | } | 910 | } |
| 911 | } else { | 911 | } else { |
| 912 | 912 | ||
| 913 | for (int i = 0; i < 2; i++) { | 913 | for (int i = 0; i < 2; i++) { |
| 914 | 914 | ||
| 915 | 915 | ||
| 916 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 916 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 917 | iBeta); | 917 | iBeta); |
| 918 | if (iAlpha | iBeta) { | 918 | if (iAlpha | iBeta) { |
| 919 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; | 919 | uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr; |
| 920 | pFilter->pLoopf->pfChromaDeblockingEQ4Hor2 (pPixCbCr, iStride, iAlpha, iBeta); | 920 | pFilter->pLoopf->pfChromaDeblockingEQ4Hor2 (pPixCbCr, iStride, iAlpha, iBeta); |
| 921 | } | 921 | } |
| 922 | } | 922 | } |
| 923 | 923 | ||
| 924 | } | 924 | } |
| 925 | return; | 925 | return; |
| 926 | } | 926 | } |
| 927 | 927 | ||
| 928 | 928 | ||
| 929 | void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_t nBS[2][4][4], | 929 | void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_t nBS[2][4][4], |
| 930 | int32_t iBoundryFlag) { | 930 | int32_t iBoundryFlag) { |
| 931 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; | 931 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; |
| 932 | int32_t iMbX = pCurDqLayer->iMbX; | 932 | int32_t iMbX = pCurDqLayer->iMbX; |
| 933 | int32_t iMbY = pCurDqLayer->iMbY; | 933 | int32_t iMbY = pCurDqLayer->iMbY; |
| 934 | 934 | ||
| 935 | int32_t iCurLumaQp = pCurDqLayer->pLumaQp[iMbXyIndex]; | 935 | int32_t iCurLumaQp = pCurDqLayer->pLumaQp[iMbXyIndex]; |
| 936 | //int32_t* iCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex]; | 936 | //int32_t* iCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex]; |
| 937 | int8_t* pCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex]; | 937 | int8_t* pCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex]; |
| 938 | int32_t iLineSize = pFilter->iCsStride[0]; | 938 | int32_t iLineSize = pFilter->iCsStride[0]; |
| 939 | int32_t iLineSizeUV = pFilter->iCsStride[1]; | 939 | int32_t iLineSizeUV = pFilter->iCsStride[1]; |
| 940 | 940 | ||
| 941 | uint8_t* pDestY, * pDestCb, * pDestCr; | 941 | uint8_t* pDestY, * pDestCb, * pDestCr; |
| 942 | pDestY = pFilter->pCsData[0] + ((iMbY * iLineSize + iMbX) << 4); | 942 | pDestY = pFilter->pCsData[0] + ((iMbY * iLineSize + iMbX) << 4); |
| 943 | pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSizeUV + iMbX) << 3); | 943 | pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSizeUV + iMbX) << 3); |
| 944 | pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSizeUV + iMbX) << 3); | 944 | pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSizeUV + iMbX) << 3); |
| 945 | 945 | ||
| 946 | //Vertical margrin | 946 | //Vertical margrin |
| 947 | if (iBoundryFlag & LEFT_FLAG_MASK) { | 947 | if (iBoundryFlag & LEFT_FLAG_MASK) { |
| 948 | int32_t iLeftXyIndex = iMbXyIndex - 1; | 948 | int32_t iLeftXyIndex = iMbXyIndex - 1; |
| 949 | pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iLeftXyIndex] + 1) >> 1; | 949 | pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iLeftXyIndex] + 1) >> 1; |
| 950 | for (int i = 0; i < 2; i++) { | 950 | for (int i = 0; i < 2; i++) { |
| 951 | pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iLeftXyIndex][i] + 1) >> 1; | 951 | pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iLeftXyIndex][i] + 1) >> 1; |
| 952 | } | 952 | } |
| 953 | if (nBS[0][0][0] == 0x04) { | 953 | if (nBS[0][0][0] == 0x04) { |
| 954 | FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL); | 954 | FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL); |
| 955 | FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL); | 955 | FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL); |
| 956 | } else { | 956 | } else { |
| 957 | if (* (uint32_t*)nBS[0][0] != 0) { | 957 | if (* (uint32_t*)nBS[0][0] != 0) { |
| 958 | FilteringEdgeLumaV (pFilter, pDestY, iLineSize, nBS[0][0]); | 958 | FilteringEdgeLumaV (pFilter, pDestY, iLineSize, nBS[0][0]); |
| 959 | FilteringEdgeChromaV (pFilter, pDestCb, pDestCr, iLineSizeUV, nBS[0][0]); | 959 | FilteringEdgeChromaV (pFilter, pDestCb, pDestCr, iLineSizeUV, nBS[0][0]); |
| 960 | } | 960 | } |
| 961 | } | 961 | } |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | pFilter->iLumaQP = iCurLumaQp; | 964 | pFilter->iLumaQP = iCurLumaQp; |
| 965 | pFilter->iChromaQP[0] = pCurChromaQp[0]; | 965 | pFilter->iChromaQP[0] = pCurChromaQp[0]; |
| 966 | pFilter->iChromaQP[1] = pCurChromaQp[1]; | 966 | pFilter->iChromaQP[1] = pCurChromaQp[1]; |
| 967 | 967 | ||
| 968 | if (* (uint32_t*)nBS[0][1] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 968 | if (* (uint32_t*)nBS[0][1] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 969 | FilteringEdgeLumaV (pFilter, &pDestY[1 << 2], iLineSize, nBS[0][1]); | 969 | FilteringEdgeLumaV (pFilter, &pDestY[1 << 2], iLineSize, nBS[0][1]); |
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | if (* (uint32_t*)nBS[0][2] != 0) { | 972 | if (* (uint32_t*)nBS[0][2] != 0) { |
| 973 | FilteringEdgeLumaV (pFilter, &pDestY[2 << 2], iLineSize, nBS[0][2]); | 973 | FilteringEdgeLumaV (pFilter, &pDestY[2 << 2], iLineSize, nBS[0][2]); |
| 974 | FilteringEdgeChromaV (pFilter, &pDestCb[2 << 1], &pDestCr[2 << 1], iLineSizeUV, nBS[0][2]); | 974 | FilteringEdgeChromaV (pFilter, &pDestCb[2 << 1], &pDestCr[2 << 1], iLineSizeUV, nBS[0][2]); |
| 975 | } | 975 | } |
| 976 | 976 | ||
| 977 | if (* (uint32_t*)nBS[0][3] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 977 | if (* (uint32_t*)nBS[0][3] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 978 | FilteringEdgeLumaV (pFilter, &pDestY[3 << 2], iLineSize, nBS[0][3]); | 978 | FilteringEdgeLumaV (pFilter, &pDestY[3 << 2], iLineSize, nBS[0][3]); |
| 979 | } | 979 | } |
| 980 | 980 | ||
| 981 | if (iBoundryFlag & TOP_FLAG_MASK) { | 981 | if (iBoundryFlag & TOP_FLAG_MASK) { |
| 982 | int32_t iTopXyIndex = iMbXyIndex - pCurDqLayer->iMbWidth; | 982 | int32_t iTopXyIndex = iMbXyIndex - pCurDqLayer->iMbWidth; |
| 983 | pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iTopXyIndex] + 1) >> 1; | 983 | pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iTopXyIndex] + 1) >> 1; |
| 984 | for (int i = 0; i < 2; i++) { | 984 | for (int i = 0; i < 2; i++) { |
| 985 | pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iTopXyIndex][i] + 1) >> 1; | 985 | pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iTopXyIndex][i] + 1) >> 1; |
| 986 | } | 986 | } |
| 987 | 987 | ||
| 988 | if (nBS[1][0][0] == 0x04) { | 988 | if (nBS[1][0][0] == 0x04) { |
| 989 | FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL); | 989 | FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL); |
| 990 | FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL); | 990 | FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL); |
| 991 | } else { | 991 | } else { |
| 992 | if (* (uint32_t*)nBS[1][0] != 0) { | 992 | if (* (uint32_t*)nBS[1][0] != 0) { |
| 993 | FilteringEdgeLumaH (pFilter, pDestY, iLineSize, nBS[1][0]); | 993 | FilteringEdgeLumaH (pFilter, pDestY, iLineSize, nBS[1][0]); |
| 994 | FilteringEdgeChromaH (pFilter, pDestCb, pDestCr, iLineSizeUV, nBS[1][0]); | 994 | FilteringEdgeChromaH (pFilter, pDestCb, pDestCr, iLineSizeUV, nBS[1][0]); |
| 995 | } | 995 | } |
| 996 | } | 996 | } |
| 997 | } | 997 | } |
| 998 | 998 | ||
| 999 | pFilter->iLumaQP = iCurLumaQp; | 999 | pFilter->iLumaQP = iCurLumaQp; |
| 1000 | pFilter->iChromaQP[0] = pCurChromaQp[0]; | 1000 | pFilter->iChromaQP[0] = pCurChromaQp[0]; |
| 1001 | pFilter->iChromaQP[1] = pCurChromaQp[1]; | 1001 | pFilter->iChromaQP[1] = pCurChromaQp[1]; |
| 1002 | 1002 | ||
| 1003 | if (* (uint32_t*)nBS[1][1] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1003 | if (* (uint32_t*)nBS[1][1] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1004 | FilteringEdgeLumaH (pFilter, &pDestY[ (1 << 2)*iLineSize], iLineSize, nBS[1][1]); | 1004 | FilteringEdgeLumaH (pFilter, &pDestY[ (1 << 2)*iLineSize], iLineSize, nBS[1][1]); |
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| 1007 | if (* (uint32_t*)nBS[1][2] != 0) { | 1007 | if (* (uint32_t*)nBS[1][2] != 0) { |
| 1008 | FilteringEdgeLumaH (pFilter, &pDestY[ (2 << 2)*iLineSize], iLineSize, nBS[1][2]); | 1008 | FilteringEdgeLumaH (pFilter, &pDestY[ (2 << 2)*iLineSize], iLineSize, nBS[1][2]); |
| 1009 | FilteringEdgeChromaH (pFilter, &pDestCb[ (2 << 1)*iLineSizeUV], &pDestCr[ (2 << 1)*iLineSizeUV], iLineSizeUV, | 1009 | FilteringEdgeChromaH (pFilter, &pDestCb[ (2 << 1)*iLineSizeUV], &pDestCr[ (2 << 1)*iLineSizeUV], iLineSizeUV, |
| 1010 | nBS[1][2]); | 1010 | nBS[1][2]); |
| 1011 | } | 1011 | } |
| 1012 | 1012 | ||
| 1013 | if (* (uint32_t*)nBS[1][3] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1013 | if (* (uint32_t*)nBS[1][3] != 0 && !pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1014 | FilteringEdgeLumaH (pFilter, &pDestY[ (3 << 2)*iLineSize], iLineSize, nBS[1][3]); | 1014 | FilteringEdgeLumaH (pFilter, &pDestY[ (3 << 2)*iLineSize], iLineSize, nBS[1][3]); |
| 1015 | } | 1015 | } |
| 1016 | } | 1016 | } |
| 1017 | 1017 | ||
| 1018 | void FilteringEdgeLumaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { | 1018 | void FilteringEdgeLumaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { |
| 1019 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; | 1019 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; |
| 1020 | int32_t iMbX = pCurDqLayer->iMbX; | 1020 | int32_t iMbX = pCurDqLayer->iMbX; |
| 1021 | int32_t iMbY = pCurDqLayer->iMbY; | 1021 | int32_t iMbY = pCurDqLayer->iMbY; |
| 1022 | int32_t iMbWidth = pCurDqLayer->iMbWidth; | 1022 | int32_t iMbWidth = pCurDqLayer->iMbWidth; |
| 1023 | int32_t iLineSize = pFilter->iCsStride[0]; | 1023 | int32_t iLineSize = pFilter->iCsStride[0]; |
| 1024 | 1024 | ||
| 1025 | uint8_t* pDestY; | 1025 | uint8_t* pDestY; |
| 1026 | int32_t iCurQp; | 1026 | int32_t iCurQp; |
| 1027 | int32_t iIndexA, iAlpha, iBeta; | 1027 | int32_t iIndexA, iAlpha, iBeta; |
| 1028 | 1028 | ||
| 1029 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 1029 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 1030 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBSx4, 4, 4); | 1030 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBSx4, 4, 4); |
| 1031 | 1031 | ||
| 1032 | pDestY = pFilter->pCsData[0] + ((iMbY * iLineSize + iMbX) << 4); | 1032 | pDestY = pFilter->pCsData[0] + ((iMbY * iLineSize + iMbX) << 4); |
| 1033 | iCurQp = pCurDqLayer->pLumaQp[iMbXyIndex]; | 1033 | iCurQp = pCurDqLayer->pLumaQp[iMbXyIndex]; |
| 1034 | 1034 | ||
| 1035 | * (uint32_t*)uiBSx4 = 0x03030303; | 1035 | * (uint32_t*)uiBSx4 = 0x03030303; |
| 1036 | 1036 | ||
| 1037 | // luma v | 1037 | // luma v |
| 1038 | if (iBoundryFlag & LEFT_FLAG_MASK) { | 1038 | if (iBoundryFlag & LEFT_FLAG_MASK) { |
| 1039 | pFilter->iLumaQP = (iCurQp + pCurDqLayer->pLumaQp[iMbXyIndex - 1] + 1) >> 1; | 1039 | pFilter->iLumaQP = (iCurQp + pCurDqLayer->pLumaQp[iMbXyIndex - 1] + 1) >> 1; |
| 1040 | FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL); | 1040 | FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL); |
| 1041 | } | 1041 | } |
| 1042 | 1042 | ||
| 1043 | pFilter->iLumaQP = iCurQp; | 1043 | pFilter->iLumaQP = iCurQp; |
| 1044 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 1044 | GET_ALPHA_BETA_FROM_QP (pFilter->iLumaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 1045 | iBeta); | 1045 | iBeta); |
| 1046 | if (iAlpha | iBeta) { | 1046 | if (iAlpha | iBeta) { |
| 1047 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 0); | 1047 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 0); |
| 1048 | 1048 | ||
| 1049 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1049 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1050 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[1 << 2], iLineSize, iAlpha, iBeta, iTc); | 1050 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[1 << 2], iLineSize, iAlpha, iBeta, iTc); |
| 1051 | } | 1051 | } |
| 1052 | 1052 | ||
| 1053 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[2 << 2], iLineSize, iAlpha, iBeta, iTc); | 1053 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[2 << 2], iLineSize, iAlpha, iBeta, iTc); |
| 1054 | 1054 | ||
| 1055 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1055 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1056 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[3 << 2], iLineSize, iAlpha, iBeta, iTc); | 1056 | pFilter->pLoopf->pfLumaDeblockingLT4Hor (&pDestY[3 << 2], iLineSize, iAlpha, iBeta, iTc); |
| 1057 | } | 1057 | } |
| 1058 | } | 1058 | } |
| 1059 | 1059 | ||
| 1060 | // luma h | 1060 | // luma h |
| 1061 | if (iBoundryFlag & TOP_FLAG_MASK) { | 1061 | if (iBoundryFlag & TOP_FLAG_MASK) { |
| 1062 | pFilter->iLumaQP = (iCurQp + pCurDqLayer->pLumaQp[iMbXyIndex - iMbWidth] + 1) >> 1; | 1062 | pFilter->iLumaQP = (iCurQp + pCurDqLayer->pLumaQp[iMbXyIndex - iMbWidth] + 1) >> 1; |
| 1063 | FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL); | 1063 | FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL); |
| 1064 | } | 1064 | } |
| 1065 | 1065 | ||
| 1066 | pFilter->iLumaQP = iCurQp; | 1066 | pFilter->iLumaQP = iCurQp; |
| 1067 | if (iAlpha | iBeta) { | 1067 | if (iAlpha | iBeta) { |
| 1068 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1068 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1069 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (1 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); | 1069 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (1 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); |
| 1070 | } | 1070 | } |
| 1071 | 1071 | ||
| 1072 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (2 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); | 1072 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (2 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); |
| 1073 | 1073 | ||
| 1074 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { | 1074 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXyIndex]) { |
| 1075 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (3 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); | 1075 | pFilter->pLoopf->pfLumaDeblockingLT4Ver (&pDestY[ (3 << 2)*iLineSize], iLineSize, iAlpha, iBeta, iTc); |
| 1076 | } | 1076 | } |
| 1077 | } | 1077 | } |
| 1078 | } | 1078 | } |
| 1079 | void FilteringEdgeChromaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { | 1079 | void FilteringEdgeChromaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { |
| 1080 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; | 1080 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; |
| 1081 | int32_t iMbX = pCurDqLayer->iMbX; | 1081 | int32_t iMbX = pCurDqLayer->iMbX; |
| 1082 | int32_t iMbY = pCurDqLayer->iMbY; | 1082 | int32_t iMbY = pCurDqLayer->iMbY; |
| 1083 | int32_t iMbWidth = pCurDqLayer->iMbWidth; | 1083 | int32_t iMbWidth = pCurDqLayer->iMbWidth; |
| 1084 | int32_t iLineSize = pFilter->iCsStride[1]; | 1084 | int32_t iLineSize = pFilter->iCsStride[1]; |
| 1085 | 1085 | ||
| 1086 | uint8_t* pDestCb; | 1086 | uint8_t* pDestCb; |
| 1087 | uint8_t* pDestCr; | 1087 | uint8_t* pDestCr; |
| 1088 | //int32_t iCurQp; | 1088 | //int32_t iCurQp; |
| 1089 | int8_t* pCurQp; | 1089 | int8_t* pCurQp; |
| 1090 | int32_t iIndexA, iAlpha, iBeta; | 1090 | int32_t iIndexA, iAlpha, iBeta; |
| 1091 | 1091 | ||
| 1092 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 1092 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 1093 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBSx4, 4, 4); | 1093 | ENFORCE_STACK_ALIGN_1D (uint8_t, uiBSx4, 4, 4); |
| 1094 | 1094 | ||
| 1095 | pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSize + iMbX) << 3); | 1095 | pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSize + iMbX) << 3); |
| 1096 | pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSize + iMbX) << 3); | 1096 | pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSize + iMbX) << 3); |
| 1097 | pCurQp = pCurDqLayer->pChromaQp[iMbXyIndex]; | 1097 | pCurQp = pCurDqLayer->pChromaQp[iMbXyIndex]; |
| 1098 | 1098 | ||
| 1099 | * (uint32_t*)uiBSx4 = 0x03030303; | 1099 | * (uint32_t*)uiBSx4 = 0x03030303; |
| 1100 | 1100 | ||
| 1101 | 1101 | ||
| 1102 | // chroma v | 1102 | // chroma v |
| 1103 | if (iBoundryFlag & LEFT_FLAG_MASK) { | 1103 | if (iBoundryFlag & LEFT_FLAG_MASK) { |
| 1104 | 1104 | ||
| 1105 | for (int i = 0; i < 2; i++) { | 1105 | for (int i = 0; i < 2; i++) { |
| 1106 | pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - 1][i] + 1) >> 1; | 1106 | pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - 1][i] + 1) >> 1; |
| 1107 | 1107 | ||
| 1108 | } | 1108 | } |
| 1109 | FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSize, NULL); | 1109 | FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSize, NULL); |
| 1110 | } | 1110 | } |
| 1111 | 1111 | ||
| 1112 | pFilter->iChromaQP[0] = pCurQp[0]; | 1112 | pFilter->iChromaQP[0] = pCurQp[0]; |
| 1113 | pFilter->iChromaQP[1] = pCurQp[1]; | 1113 | pFilter->iChromaQP[1] = pCurQp[1]; |
| 1114 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { | 1114 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { |
| 1115 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 1115 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 1116 | iBeta); | 1116 | iBeta); |
| 1117 | if (iAlpha | iBeta) { | 1117 | if (iAlpha | iBeta) { |
| 1118 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); | 1118 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); |
| 1119 | pFilter->pLoopf->pfChromaDeblockingLT4Hor (&pDestCb[2 << 1], &pDestCr[2 << 1], iLineSize, iAlpha, iBeta, iTc); | 1119 | pFilter->pLoopf->pfChromaDeblockingLT4Hor (&pDestCb[2 << 1], &pDestCr[2 << 1], iLineSize, iAlpha, iBeta, iTc); |
| 1120 | } | 1120 | } |
| 1121 | } else { | 1121 | } else { |
| 1122 | 1122 | ||
| 1123 | for (int i = 0; i < 2; i++) { | 1123 | for (int i = 0; i < 2; i++) { |
| 1124 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 1124 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 1125 | iBeta); | 1125 | iBeta); |
| 1126 | if (iAlpha | iBeta) { | 1126 | if (iAlpha | iBeta) { |
| 1127 | uint8_t* pDestCbCr = (i == 0) ? &pDestCb[2 << 1] : &pDestCr[2 << 1]; | 1127 | uint8_t* pDestCbCr = (i == 0) ? &pDestCb[2 << 1] : &pDestCr[2 << 1]; |
| 1128 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); | 1128 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); |
| 1129 | pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pDestCbCr, iLineSize, iAlpha, iBeta, iTc); | 1129 | pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pDestCbCr, iLineSize, iAlpha, iBeta, iTc); |
| 1130 | } | 1130 | } |
| 1131 | 1131 | ||
| 1132 | } | 1132 | } |
| 1133 | } | 1133 | } |
| 1134 | 1134 | ||
| 1135 | // chroma h | 1135 | // chroma h |
| 1136 | 1136 | ||
| 1137 | if (iBoundryFlag & TOP_FLAG_MASK) { | 1137 | if (iBoundryFlag & TOP_FLAG_MASK) { |
| 1138 | for (int i = 0; i < 2; i++) { | 1138 | for (int i = 0; i < 2; i++) { |
| 1139 | pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - iMbWidth][i] + 1) >> 1; | 1139 | pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - iMbWidth][i] + 1) >> 1; |
| 1140 | } | 1140 | } |
| 1141 | FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSize, NULL); | 1141 | FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSize, NULL); |
| 1142 | } | 1142 | } |
| 1143 | 1143 | ||
| 1144 | pFilter->iChromaQP[0] = pCurQp[0]; | 1144 | pFilter->iChromaQP[0] = pCurQp[0]; |
| 1145 | pFilter->iChromaQP[1] = pCurQp[1]; | 1145 | pFilter->iChromaQP[1] = pCurQp[1]; |
| 1146 | 1146 | ||
| 1147 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { | 1147 | if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { |
| 1148 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 1148 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 1149 | iBeta); | 1149 | iBeta); |
| 1150 | if (iAlpha | iBeta) { | 1150 | if (iAlpha | iBeta) { |
| 1151 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); | 1151 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); |
| 1152 | pFilter->pLoopf->pfChromaDeblockingLT4Ver (&pDestCb[ (2 << 1)*iLineSize], &pDestCr[ (2 << 1)*iLineSize], iLineSize, | 1152 | pFilter->pLoopf->pfChromaDeblockingLT4Ver (&pDestCb[ (2 << 1)*iLineSize], &pDestCr[ (2 << 1)*iLineSize], iLineSize, |
| 1153 | iAlpha, iBeta, iTc); | 1153 | iAlpha, iBeta, iTc); |
| 1154 | } | 1154 | } |
| 1155 | } else { | 1155 | } else { |
| 1156 | for (int i = 0; i < 2; i++) { | 1156 | for (int i = 0; i < 2; i++) { |
| 1157 | 1157 | ||
| 1158 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, | 1158 | GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha, |
| 1159 | iBeta); | 1159 | iBeta); |
| 1160 | if (iAlpha | iBeta) { | 1160 | if (iAlpha | iBeta) { |
| 1161 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); | 1161 | TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1); |
| 1162 | uint8_t* pDestCbCr = (i == 0) ? &pDestCb[ (2 << 1) * iLineSize] : &pDestCr[ (2 << 1) * iLineSize]; | 1162 | uint8_t* pDestCbCr = (i == 0) ? &pDestCb[ (2 << 1) * iLineSize] : &pDestCr[ (2 << 1) * iLineSize]; |
| 1163 | pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pDestCbCr, iLineSize, | 1163 | pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pDestCbCr, iLineSize, |
| 1164 | iAlpha, iBeta, iTc); | 1164 | iAlpha, iBeta, iTc); |
| 1165 | } | 1165 | } |
| 1166 | } | 1166 | } |
| 1167 | 1167 | ||
| 1168 | 1168 | ||
| 1169 | } | 1169 | } |
| 1170 | } | 1170 | } |
| 1171 | 1171 | ||
| 1172 | // merge h&v lookup table operation to save performance | 1172 | // merge h&v lookup table operation to save performance |
| 1173 | void DeblockingIntraMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { | 1173 | void DeblockingIntraMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { |
| 1174 | FilteringEdgeLumaHV (pCurDqLayer, pFilter, iBoundryFlag); | 1174 | FilteringEdgeLumaHV (pCurDqLayer, pFilter, iBoundryFlag); |
| 1175 | FilteringEdgeChromaHV (pCurDqLayer, pFilter, iBoundryFlag); | 1175 | FilteringEdgeChromaHV (pCurDqLayer, pFilter, iBoundryFlag); |
| 1176 | } | 1176 | } |
| 1177 | 1177 | ||
| 1178 | void WelsDeblockingMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { | 1178 | void WelsDeblockingMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t iBoundryFlag) { |
| 1179 | uint8_t nBS[2][4][4] = {{{ 0 }}}; | 1179 | uint8_t nBS[2][4][4] = {{{ 0 }}}; |
| 1180 | 1180 | ||
| 1181 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; | 1181 | int32_t iMbXyIndex = pCurDqLayer->iMbXyIndex; |
| 1182 | uint32_t iCurMbType = pCurDqLayer->pMbType[iMbXyIndex]; | 1182 | uint32_t iCurMbType = pCurDqLayer->pMbType[iMbXyIndex]; |
| 1183 | int32_t iMbNb; | 1183 | int32_t iMbNb; |
| 1184 | 1184 | ||
| 1185 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; | 1185 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| 1186 | PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; | 1186 | PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; |
| 1187 | bool bBSlice = pSliceHeader->eSliceType == B_SLICE; | 1187 | bool bBSlice = pSliceHeader->eSliceType == B_SLICE; |
| 1188 | 1188 | ||
| 1189 | switch (iCurMbType) { | 1189 | switch (iCurMbType) { |
| 1190 | case MB_TYPE_INTRA4x4: | 1190 | case MB_TYPE_INTRA4x4: |
| 1191 | case MB_TYPE_INTRA8x8: | 1191 | case MB_TYPE_INTRA8x8: |
| 1192 | case MB_TYPE_INTRA16x16: | 1192 | case MB_TYPE_INTRA16x16: |
| 1193 | case MB_TYPE_INTRA_PCM: | 1193 | case MB_TYPE_INTRA_PCM: |
| 1194 | DeblockingIntraMb (pCurDqLayer, pFilter, iBoundryFlag); | 1194 | DeblockingIntraMb (pCurDqLayer, pFilter, iBoundryFlag); |
| 1195 | break; | 1195 | break; |
| 1196 | default: | 1196 | default: |
| 1197 | 1197 | ||
| 1198 | if (iBoundryFlag & LEFT_FLAG_MASK) { | 1198 | if (iBoundryFlag & LEFT_FLAG_MASK) { |
| 1199 | iMbNb = iMbXyIndex - 1; | 1199 | iMbNb = iMbXyIndex - 1; |
| 1200 | if (bBSlice) { | 1200 | if (bBSlice) { |
| 1201 | * (uint32_t*)nBS[0][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBSliceBsMarginalMBAvcbase ( | 1201 | * (uint32_t*)nBS[0][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBSliceBsMarginalMBAvcbase ( |
| 1202 | pCurDqLayer, 0, iMbNb, iMbXyIndex); | 1202 | pCurDqLayer, 0, iMbNb, iMbXyIndex); |
| 1203 | } else { | 1203 | } else { |
| 1204 | * (uint32_t*)nBS[0][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBsMarginalMBAvcbase ( | 1204 | * (uint32_t*)nBS[0][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBsMarginalMBAvcbase ( |
| 1205 | pCurDqLayer, 0, iMbNb, iMbXyIndex); | 1205 | pCurDqLayer, 0, iMbNb, iMbXyIndex); |
| 1206 | } | 1206 | } |
| 1207 | } else { | 1207 | } else { |
| 1208 | * (uint32_t*)nBS[0][0] = 0; | 1208 | * (uint32_t*)nBS[0][0] = 0; |
| 1209 | } | 1209 | } |
| 1210 | if (iBoundryFlag & TOP_FLAG_MASK) { | 1210 | if (iBoundryFlag & TOP_FLAG_MASK) { |
| 1211 | iMbNb = iMbXyIndex - pCurDqLayer->iMbWidth; | 1211 | iMbNb = iMbXyIndex - pCurDqLayer->iMbWidth; |
| 1212 | if (bBSlice) { | 1212 | if (bBSlice) { |
| 1213 | * (uint32_t*)nBS[1][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBSliceBsMarginalMBAvcbase ( | 1213 | * (uint32_t*)nBS[1][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBSliceBsMarginalMBAvcbase ( |
| 1214 | pCurDqLayer, 1, iMbNb, iMbXyIndex); | 1214 | pCurDqLayer, 1, iMbNb, iMbXyIndex); |
| 1215 | } else { | 1215 | } else { |
| 1216 | * (uint32_t*)nBS[1][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBsMarginalMBAvcbase ( | 1216 | * (uint32_t*)nBS[1][0] = IS_INTRA (pCurDqLayer->pMbType[iMbNb]) ? 0x04040404 : DeblockingBsMarginalMBAvcbase ( |
| 1217 | pCurDqLayer, 1, iMbNb, iMbXyIndex); | 1217 | pCurDqLayer, 1, iMbNb, iMbXyIndex); |
| 1218 | } | 1218 | } |
| 1219 | } else { | 1219 | } else { |
| 1220 | * (uint32_t*)nBS[1][0] = 0; | 1220 | * (uint32_t*)nBS[1][0] = 0; |
| 1221 | } | 1221 | } |
| 1222 | //SKIP MB_16x16 or others | 1222 | //SKIP MB_16x16 or others |
| 1223 | if (IS_SKIP (iCurMbType)) { | 1223 | if (IS_SKIP (iCurMbType)) { |
| 1224 | * (uint32_t*)nBS[0][1] = * (uint32_t*)nBS[0][2] = * (uint32_t*)nBS[0][3] = | 1224 | * (uint32_t*)nBS[0][1] = * (uint32_t*)nBS[0][2] = * (uint32_t*)nBS[0][3] = |
| 1225 | * (uint32_t*)nBS[1][1] = * (uint32_t*)nBS[1][2] = * (uint32_t*)nBS[1][3] = 0; | 1225 | * (uint32_t*)nBS[1][1] = * (uint32_t*)nBS[1][2] = * (uint32_t*)nBS[1][3] = 0; |
| 1226 | } else { | 1226 | } else { |
| 1227 | if (IS_INTER_16x16 (iCurMbType)) { | 1227 | if (IS_INTER_16x16 (iCurMbType)) { |
| 1228 | if (!pCurDqLayer->pTransformSize8x8Flag[pCurDqLayer->iMbXyIndex]) { | 1228 | if (!pCurDqLayer->pTransformSize8x8Flag[pCurDqLayer->iMbXyIndex]) { |
| 1229 | DeblockingBSInsideMBAvsbase (pCurDqLayer->pNzc[iMbXyIndex], nBS, 1); | 1229 | DeblockingBSInsideMBAvsbase (pCurDqLayer->pNzc[iMbXyIndex], nBS, 1); |
| 1230 | } else { | 1230 | } else { |
| 1231 | DeblockingBSInsideMBAvsbase8x8 (pCurDqLayer->pNzc[iMbXyIndex], nBS, 1); | 1231 | DeblockingBSInsideMBAvsbase8x8 (pCurDqLayer->pNzc[iMbXyIndex], nBS, 1); |
| 1232 | } | 1232 | } |
| 1233 | } else { | 1233 | } else { |
| 1234 | 1234 | ||
| 1235 | if (bBSlice) { | 1235 | if (bBSlice) { |
| 1236 | DeblockingBSliceBSInsideMBNormal (pCurDqLayer, nBS, pCurDqLayer->pNzc[iMbXyIndex], iMbXyIndex); | 1236 | DeblockingBSliceBSInsideMBNormal (pCurDqLayer, nBS, pCurDqLayer->pNzc[iMbXyIndex], iMbXyIndex); |
| 1237 | } else { | 1237 | } else { |
| 1238 | DeblockingBSInsideMBNormal (pCurDqLayer, nBS, pCurDqLayer->pNzc[iMbXyIndex], iMbXyIndex); | 1238 | DeblockingBSInsideMBNormal (pCurDqLayer, nBS, pCurDqLayer->pNzc[iMbXyIndex], iMbXyIndex); |
| 1239 | } | 1239 | } |
| 1240 | } | 1240 | } |
| 1241 | } | 1241 | } |
| 1242 | DeblockingInterMb (pCurDqLayer, pFilter, nBS, iBoundryFlag); | 1242 | DeblockingInterMb (pCurDqLayer, pFilter, nBS, iBoundryFlag); |
| 1243 | break; | 1243 | break; |
| 1244 | } | 1244 | } |
| 1245 | } | 1245 | } |
| 1246 | 1246 | ||
| 1247 | /*! | 1247 | /*! |
| 1248 | * \brief AVC slice deblocking filtering target layer | 1248 | * \brief AVC slice deblocking filtering target layer |
| 1249 | * | 1249 | * |
| 1250 | * \param dec Wels avc decoder context | 1250 | * \param dec Wels avc decoder context |
| 1251 | * | 1251 | * |
| 1252 | * \return NONE | 1252 | * \return NONE |
| 1253 | */ | 1253 | */ |
| 1254 | void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFunc pDeblockMb) { | 1254 | void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFunc pDeblockMb) { |
| 1255 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; | 1255 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1256 | PSliceHeaderExt pSliceHeaderExt = &pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt; | 1256 | PSliceHeaderExt pSliceHeaderExt = &pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt; |
| 1257 | int32_t iMbWidth = pCurDqLayer->iMbWidth; | 1257 | int32_t iMbWidth = pCurDqLayer->iMbWidth; |
| 1258 | int32_t iTotalMbCount = pSliceHeaderExt->sSliceHeader.pSps->uiTotalMbCount; | 1258 | int32_t iTotalMbCount = pSliceHeaderExt->sSliceHeader.pSps->uiTotalMbCount; |
| 1259 | 1259 | ||
| 1260 | SDeblockingFilter pFilter; | 1260 | SDeblockingFilter pFilter; |
| 1261 | memset (&pFilter, 0, sizeof (pFilter)); | 1261 | memset (&pFilter, 0, sizeof (pFilter)); |
| 1262 | PFmo pFmo = pCtx->pFmo; | 1262 | PFmo pFmo = pCtx->pFmo; |
| 1263 | int32_t iNextMbXyIndex = 0; | 1263 | int32_t iNextMbXyIndex = 0; |
| 1264 | int32_t iTotalNumMb = pCurDqLayer->sLayerInfo.sSliceInLayer.iTotalMbInCurSlice; | 1264 | int32_t iTotalNumMb = pCurDqLayer->sLayerInfo.sSliceInLayer.iTotalMbInCurSlice; |
| 1265 | int32_t iCountNumMb = 0; | 1265 | int32_t iCountNumMb = 0; |
| 1266 | int32_t iBoundryFlag; | 1266 | int32_t iBoundryFlag; |
| 1267 | int32_t iFilterIdc = pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc; | 1267 | int32_t iFilterIdc = pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc; |
| 1268 | 1268 | ||
| 1269 | /* Step1: parameters set */ | 1269 | /* Step1: parameters set */ |
| 1270 | pFilter.pCsData[0] = pCtx->pDec->pData[0]; | 1270 | pFilter.pCsData[0] = pCtx->pDec->pData[0]; |
| 1271 | pFilter.pCsData[1] = pCtx->pDec->pData[1]; | 1271 | pFilter.pCsData[1] = pCtx->pDec->pData[1]; |
| 1272 | pFilter.pCsData[2] = pCtx->pDec->pData[2]; | 1272 | pFilter.pCsData[2] = pCtx->pDec->pData[2]; |
| 1273 | 1273 | ||
| 1274 | pFilter.iCsStride[0] = pCtx->pDec->iLinesize[0]; | 1274 | pFilter.iCsStride[0] = pCtx->pDec->iLinesize[0]; |
| 1275 | pFilter.iCsStride[1] = pCtx->pDec->iLinesize[1]; | 1275 | pFilter.iCsStride[1] = pCtx->pDec->iLinesize[1]; |
| 1276 | 1276 | ||
| 1277 | pFilter.eSliceType = (EWelsSliceType) pCurDqLayer->sLayerInfo.sSliceInLayer.eSliceType; | 1277 | pFilter.eSliceType = (EWelsSliceType) pCurDqLayer->sLayerInfo.sSliceInLayer.eSliceType; |
| 1278 | 1278 | ||
| 1279 | pFilter.iSliceAlphaC0Offset = pSliceHeaderExt->sSliceHeader.iSliceAlphaC0Offset; | 1279 | pFilter.iSliceAlphaC0Offset = pSliceHeaderExt->sSliceHeader.iSliceAlphaC0Offset; |
| 1280 | pFilter.iSliceBetaOffset = pSliceHeaderExt->sSliceHeader.iSliceBetaOffset; | 1280 | pFilter.iSliceBetaOffset = pSliceHeaderExt->sSliceHeader.iSliceBetaOffset; |
| 1281 | 1281 | ||
| 1282 | pFilter.pLoopf = &pCtx->sDeblockingFunc; | 1282 | pFilter.pLoopf = &pCtx->sDeblockingFunc; |
| 1283 | 1283 | ||
| 1284 | /* Step2: macroblock deblocking */ | 1284 | /* Step2: macroblock deblocking */ |
| 1285 | if (0 == iFilterIdc || 2 == iFilterIdc) { | 1285 | if (0 == iFilterIdc || 2 == iFilterIdc) { |
| 1286 | iNextMbXyIndex = pSliceHeaderExt->sSliceHeader.iFirstMbInSlice; | 1286 | iNextMbXyIndex = pSliceHeaderExt->sSliceHeader.iFirstMbInSlice; |
| 1287 | pCurDqLayer->iMbX = iNextMbXyIndex % iMbWidth; | 1287 | pCurDqLayer->iMbX = iNextMbXyIndex % iMbWidth; |
| 1288 | pCurDqLayer->iMbY = iNextMbXyIndex / iMbWidth; | 1288 | pCurDqLayer->iMbY = iNextMbXyIndex / iMbWidth; |
| 1289 | pCurDqLayer->iMbXyIndex = iNextMbXyIndex; | 1289 | pCurDqLayer->iMbXyIndex = iNextMbXyIndex; |
| 1290 | 1290 | ||
| 1291 | do { | 1291 | do { |
| 1292 | iBoundryFlag = DeblockingAvailableNoInterlayer (pCurDqLayer, iFilterIdc); | 1292 | iBoundryFlag = DeblockingAvailableNoInterlayer (pCurDqLayer, iFilterIdc); |
| 1293 | 1293 | ||
| 1294 | pDeblockMb (pCurDqLayer, &pFilter, iBoundryFlag); | 1294 | pDeblockMb (pCurDqLayer, &pFilter, iBoundryFlag); |
| 1295 | 1295 | ||
| 1296 | ++iCountNumMb; | 1296 | ++iCountNumMb; |
| 1297 | if (iCountNumMb >= iTotalNumMb) { | 1297 | if (iCountNumMb >= iTotalNumMb) { |
| 1298 | break; | 1298 | break; |
| 1299 | } | 1299 | } |
| 1300 | 1300 | ||
| 1301 | if (pSliceHeaderExt->sSliceHeader.pPps->uiNumSliceGroups > 1) { | 1301 | if (pSliceHeaderExt->sSliceHeader.pPps->uiNumSliceGroups > 1) { |
| 1302 | iNextMbXyIndex = FmoNextMb (pFmo, iNextMbXyIndex); | 1302 | iNextMbXyIndex = FmoNextMb (pFmo, iNextMbXyIndex); |
| 1303 | } else { | 1303 | } else { |
| 1304 | ++iNextMbXyIndex; | 1304 | ++iNextMbXyIndex; |
| 1305 | } | 1305 | } |
| 1306 | if (-1 == iNextMbXyIndex || iNextMbXyIndex >= iTotalMbCount) { // slice group boundary or end of a frame | 1306 | if (-1 == iNextMbXyIndex || iNextMbXyIndex >= iTotalMbCount) { // slice group boundary or end of a frame |
| 1307 | break; | 1307 | break; |
| 1308 | } | 1308 | } |
| 1309 | 1309 | ||
| 1310 | pCurDqLayer->iMbX = iNextMbXyIndex % iMbWidth; | 1310 | pCurDqLayer->iMbX = iNextMbXyIndex % iMbWidth; |
| 1311 | pCurDqLayer->iMbY = iNextMbXyIndex / iMbWidth; | 1311 | pCurDqLayer->iMbY = iNextMbXyIndex / iMbWidth; |
| 1312 | pCurDqLayer->iMbXyIndex = iNextMbXyIndex; | 1312 | pCurDqLayer->iMbXyIndex = iNextMbXyIndex; |
| 1313 | } while (1); | 1313 | } while (1); |
| 1314 | } | 1314 | } |
| 1315 | } | 1315 | } |
| 1316 | /*! | 1316 | /*! |
| 1317 | * \brief deblocking module initialize | 1317 | * \brief deblocking module initialize |
| 1318 | * | 1318 | * |
| 1319 | * \param pf | 1319 | * \param pf |
| 1320 | * cpu | 1320 | * cpu |
| 1321 | * | 1321 | * |
| 1322 | * \return NONE | 1322 | * \return NONE |
| 1323 | */ | 1323 | */ |
| 1324 | 1324 | ||
| 1325 | void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) { | 1325 | void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) { |
| 1326 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_c; | 1326 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_c; |
| 1327 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_c; | 1327 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_c; |
| 1328 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_c; | 1328 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_c; |
| 1329 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_c; | 1329 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_c; |
| 1330 | 1330 | ||
| 1331 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_c; | 1331 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_c; |
| 1332 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_c; | 1332 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_c; |
| 1333 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_c; | 1333 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_c; |
| 1334 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_c; | 1334 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_c; |
| 1335 | 1335 | ||
| 1336 | pFunc->pfChromaDeblockingLT4Ver2 = DeblockChromaLt4V2_c; | 1336 | pFunc->pfChromaDeblockingLT4Ver2 = DeblockChromaLt4V2_c; |
| 1337 | pFunc->pfChromaDeblockingEQ4Ver2 = DeblockChromaEq4V2_c; | 1337 | pFunc->pfChromaDeblockingEQ4Ver2 = DeblockChromaEq4V2_c; |
| 1338 | pFunc->pfChromaDeblockingLT4Hor2 = DeblockChromaLt4H2_c; | 1338 | pFunc->pfChromaDeblockingLT4Hor2 = DeblockChromaLt4H2_c; |
| 1339 | pFunc->pfChromaDeblockingEQ4Hor2 = DeblockChromaEq4H2_c; | 1339 | pFunc->pfChromaDeblockingEQ4Hor2 = DeblockChromaEq4H2_c; |
| 1340 | 1340 | ||
| 1341 | #ifdef X86_ASM | 1341 | #ifdef X86_ASM |
| 1342 | if (iCpu & WELS_CPU_SSSE3) { | 1342 | if (iCpu & WELS_CPU_SSSE3) { |
| 1343 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_ssse3; | 1343 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_ssse3; |
| 1344 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_ssse3; | 1344 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_ssse3; |
| 1345 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_ssse3; | 1345 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_ssse3; |
| 1346 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_ssse3; | 1346 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_ssse3; |
| 1347 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_ssse3; | 1347 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_ssse3; |
| 1348 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_ssse3; | 1348 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_ssse3; |
| 1349 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_ssse3; | 1349 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_ssse3; |
| 1350 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_ssse3; | 1350 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_ssse3; |
| 1351 | } | 1351 | } |
| 1352 | #endif | 1352 | #endif |
| 1353 | 1353 | ||
| 1354 | #if defined(HAVE_NEON) | 1354 | #if defined(HAVE_NEON) |
| 1355 | if (iCpu & WELS_CPU_NEON) { | 1355 | if (iCpu & WELS_CPU_NEON) { |
| 1356 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_neon; | 1356 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_neon; |
| 1357 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_neon; | 1357 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_neon; |
| 1358 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_neon; | 1358 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_neon; |
| 1359 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_neon; | 1359 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_neon; |
| 1360 | 1360 | ||
| 1361 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_neon; | 1361 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_neon; |
| 1362 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_neon; | 1362 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_neon; |
| 1363 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_neon; | 1363 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_neon; |
| 1364 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_neon; | 1364 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_neon; |
| 1365 | } | 1365 | } |
| 1366 | #endif | 1366 | #endif |
| 1367 | 1367 | ||
| 1368 | #if defined(HAVE_NEON_AARCH64) | 1368 | #if defined(HAVE_NEON_AARCH64) |
| 1369 | if (iCpu & WELS_CPU_NEON) { | 1369 | if (iCpu & WELS_CPU_NEON) { |
| 1370 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_AArch64_neon; | 1370 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_AArch64_neon; |
| 1371 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_AArch64_neon; | 1371 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_AArch64_neon; |
| 1372 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_AArch64_neon; | 1372 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_AArch64_neon; |
| 1373 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_AArch64_neon; | 1373 | pFunc->pfLumaDeblockingEQ4Hor = DeblockLumaEq4H_AArch64_neon; |
| 1374 | 1374 | ||
| 1375 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_AArch64_neon; | 1375 | pFunc->pfChromaDeblockingLT4Ver = DeblockChromaLt4V_AArch64_neon; |
| 1376 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_AArch64_neon; | 1376 | pFunc->pfChromaDeblockingEQ4Ver = DeblockChromaEq4V_AArch64_neon; |
| 1377 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_AArch64_neon; | 1377 | pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_AArch64_neon; |
| 1378 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_AArch64_neon; | 1378 | pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_AArch64_neon; |
| 1379 | } | 1379 | } |
| 1380 | #endif | 1380 | #endif |
| 1381 | } | 1381 | } |
| 1382 | 1382 | ||
| 1383 | } // namespace WelsDec | 1383 | } // namespace WelsDec |