[56] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
[1200] | 4 | * granted under this license. |
---|
[56] | 5 | * |
---|
[1200] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[56] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | /** |
---|
| 35 | * \file |
---|
| 36 | * \brief Implementation of TComInterpolationFilter class |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | // ==================================================================================================================== |
---|
| 40 | // Includes |
---|
| 41 | // ==================================================================================================================== |
---|
| 42 | |
---|
| 43 | #include "TComRom.h" |
---|
| 44 | #include "TComInterpolationFilter.h" |
---|
| 45 | #include <assert.h> |
---|
| 46 | |
---|
[1200] | 47 | #include "TComChromaFormat.h" |
---|
[56] | 48 | |
---|
[1200] | 49 | |
---|
[56] | 50 | //! \ingroup TLibCommon |
---|
| 51 | //! \{ |
---|
| 52 | |
---|
| 53 | // ==================================================================================================================== |
---|
| 54 | // Tables |
---|
| 55 | // ==================================================================================================================== |
---|
| 56 | |
---|
[1200] | 57 | const TFilterCoeff TComInterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] = |
---|
[56] | 58 | { |
---|
| 59 | { 0, 0, 0, 64, 0, 0, 0, 0 }, |
---|
| 60 | { -1, 4, -10, 58, 17, -5, 1, 0 }, |
---|
| 61 | { -1, 4, -11, 40, 40, -11, 4, -1 }, |
---|
| 62 | { 0, 1, -5, 17, 58, -10, 4, -1 } |
---|
| 63 | }; |
---|
| 64 | |
---|
[1200] | 65 | const TFilterCoeff TComInterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] = |
---|
[56] | 66 | { |
---|
| 67 | { 0, 64, 0, 0 }, |
---|
| 68 | { -2, 58, 10, -2 }, |
---|
| 69 | { -4, 54, 16, -2 }, |
---|
| 70 | { -6, 46, 28, -4 }, |
---|
| 71 | { -4, 36, 36, -4 }, |
---|
| 72 | { -4, 28, 46, -6 }, |
---|
| 73 | { -2, 16, 54, -4 }, |
---|
| 74 | { -2, 10, 58, -2 } |
---|
| 75 | }; |
---|
[608] | 76 | |
---|
| 77 | #if H_3D_ARP |
---|
[443] | 78 | const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] = |
---|
| 79 | { |
---|
| 80 | {64, 0}, |
---|
| 81 | {48, 16}, |
---|
| 82 | {32, 32}, |
---|
| 83 | {16, 48} |
---|
| 84 | }; |
---|
| 85 | const Short TComInterpolationFilter::m_chromaFilterARP[8][NTAPS_CHROMA_ARP] = |
---|
| 86 | { |
---|
| 87 | {64, 0}, |
---|
| 88 | {56, 8}, |
---|
| 89 | {48, 16}, |
---|
| 90 | {40, 24}, |
---|
| 91 | {32, 32}, |
---|
| 92 | {24, 40}, |
---|
| 93 | {16, 48}, |
---|
| 94 | {8, 56} |
---|
| 95 | }; |
---|
| 96 | #endif |
---|
[608] | 97 | |
---|
[56] | 98 | // ==================================================================================================================== |
---|
| 99 | // Private member functions |
---|
| 100 | // ==================================================================================================================== |
---|
| 101 | |
---|
| 102 | /** |
---|
| 103 | * \brief Apply unit FIR filter to a block of samples |
---|
| 104 | * |
---|
[608] | 105 | * \param bitDepth bitDepth of samples |
---|
[56] | 106 | * \param src Pointer to source samples |
---|
| 107 | * \param srcStride Stride of source samples |
---|
| 108 | * \param dst Pointer to destination samples |
---|
| 109 | * \param dstStride Stride of destination samples |
---|
| 110 | * \param width Width of block |
---|
| 111 | * \param height Height of block |
---|
| 112 | * \param isFirst Flag indicating whether it is the first filtering operation |
---|
| 113 | * \param isLast Flag indicating whether it is the last filtering operation |
---|
| 114 | */ |
---|
[1200] | 115 | Void TComInterpolationFilter::filterCopy(Int bitDepth, const Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast) |
---|
[56] | 116 | { |
---|
| 117 | Int row, col; |
---|
[1200] | 118 | |
---|
[56] | 119 | if ( isFirst == isLast ) |
---|
| 120 | { |
---|
| 121 | for (row = 0; row < height; row++) |
---|
| 122 | { |
---|
| 123 | for (col = 0; col < width; col++) |
---|
| 124 | { |
---|
| 125 | dst[col] = src[col]; |
---|
| 126 | } |
---|
[1200] | 127 | |
---|
[56] | 128 | src += srcStride; |
---|
| 129 | dst += dstStride; |
---|
[1200] | 130 | } |
---|
[56] | 131 | } |
---|
| 132 | else if ( isFirst ) |
---|
| 133 | { |
---|
[1200] | 134 | const Int shift = std::max<Int>(2, (IF_INTERNAL_PREC - bitDepth)); |
---|
| 135 | |
---|
[56] | 136 | for (row = 0; row < height; row++) |
---|
| 137 | { |
---|
| 138 | for (col = 0; col < width; col++) |
---|
| 139 | { |
---|
[1200] | 140 | Pel val = leftShift_round(src[col], shift); |
---|
| 141 | dst[col] = val - (Pel)IF_INTERNAL_OFFS; |
---|
[56] | 142 | } |
---|
[1200] | 143 | |
---|
[56] | 144 | src += srcStride; |
---|
| 145 | dst += dstStride; |
---|
[1200] | 146 | } |
---|
[56] | 147 | } |
---|
| 148 | else |
---|
| 149 | { |
---|
[1200] | 150 | const Int shift = std::max<Int>(2, (IF_INTERNAL_PREC - bitDepth)); |
---|
| 151 | |
---|
| 152 | Pel maxVal = (1 << bitDepth) - 1; |
---|
| 153 | Pel minVal = 0; |
---|
[56] | 154 | for (row = 0; row < height; row++) |
---|
| 155 | { |
---|
| 156 | for (col = 0; col < width; col++) |
---|
| 157 | { |
---|
[1200] | 158 | Pel val = src[ col ]; |
---|
| 159 | val = rightShift_round((val + IF_INTERNAL_OFFS), shift); |
---|
| 160 | if (val < minVal) |
---|
| 161 | { |
---|
| 162 | val = minVal; |
---|
| 163 | } |
---|
| 164 | if (val > maxVal) |
---|
| 165 | { |
---|
| 166 | val = maxVal; |
---|
| 167 | } |
---|
[56] | 168 | dst[col] = val; |
---|
| 169 | } |
---|
[1200] | 170 | |
---|
[56] | 171 | src += srcStride; |
---|
| 172 | dst += dstStride; |
---|
[1200] | 173 | } |
---|
[56] | 174 | } |
---|
| 175 | } |
---|
| 176 | |
---|
| 177 | /** |
---|
| 178 | * \brief Apply FIR filter to a block of samples |
---|
| 179 | * |
---|
| 180 | * \tparam N Number of taps |
---|
| 181 | * \tparam isVertical Flag indicating filtering along vertical direction |
---|
| 182 | * \tparam isFirst Flag indicating whether it is the first filtering operation |
---|
| 183 | * \tparam isLast Flag indicating whether it is the last filtering operation |
---|
[608] | 184 | * \param bitDepth Bit depth of samples |
---|
[56] | 185 | * \param src Pointer to source samples |
---|
| 186 | * \param srcStride Stride of source samples |
---|
| 187 | * \param dst Pointer to destination samples |
---|
| 188 | * \param dstStride Stride of destination samples |
---|
| 189 | * \param width Width of block |
---|
| 190 | * \param height Height of block |
---|
| 191 | * \param coeff Pointer to filter taps |
---|
| 192 | */ |
---|
[608] | 193 | template<Int N, Bool isVertical, Bool isFirst, Bool isLast> |
---|
[1200] | 194 | Void TComInterpolationFilter::filter(Int bitDepth, Pel const *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, TFilterCoeff const *coeff) |
---|
[56] | 195 | { |
---|
| 196 | Int row, col; |
---|
[1200] | 197 | |
---|
| 198 | Pel c[8]; |
---|
[56] | 199 | c[0] = coeff[0]; |
---|
| 200 | c[1] = coeff[1]; |
---|
| 201 | if ( N >= 4 ) |
---|
| 202 | { |
---|
| 203 | c[2] = coeff[2]; |
---|
| 204 | c[3] = coeff[3]; |
---|
| 205 | } |
---|
| 206 | if ( N >= 6 ) |
---|
| 207 | { |
---|
| 208 | c[4] = coeff[4]; |
---|
| 209 | c[5] = coeff[5]; |
---|
| 210 | } |
---|
| 211 | if ( N == 8 ) |
---|
| 212 | { |
---|
| 213 | c[6] = coeff[6]; |
---|
| 214 | c[7] = coeff[7]; |
---|
| 215 | } |
---|
[1200] | 216 | |
---|
[56] | 217 | Int cStride = ( isVertical ) ? srcStride : 1; |
---|
| 218 | src -= ( N/2 - 1 ) * cStride; |
---|
| 219 | |
---|
| 220 | Int offset; |
---|
[1200] | 221 | Pel maxVal; |
---|
| 222 | Int headRoom = std::max<Int>(2, (IF_INTERNAL_PREC - bitDepth)); |
---|
| 223 | Int shift = IF_FILTER_PREC; |
---|
| 224 | // with the current settings (IF_INTERNAL_PREC = 14 and IF_FILTER_PREC = 6), though headroom can be |
---|
| 225 | // negative for bit depths greater than 14, shift will remain non-negative for bit depths of 8->20 |
---|
| 226 | assert(shift >= 0); |
---|
| 227 | |
---|
[56] | 228 | if ( isLast ) |
---|
| 229 | { |
---|
| 230 | shift += (isFirst) ? 0 : headRoom; |
---|
| 231 | offset = 1 << (shift - 1); |
---|
| 232 | offset += (isFirst) ? 0 : IF_INTERNAL_OFFS << IF_FILTER_PREC; |
---|
[608] | 233 | maxVal = (1 << bitDepth) - 1; |
---|
[56] | 234 | } |
---|
| 235 | else |
---|
| 236 | { |
---|
| 237 | shift -= (isFirst) ? headRoom : 0; |
---|
| 238 | offset = (isFirst) ? -IF_INTERNAL_OFFS << shift : 0; |
---|
| 239 | maxVal = 0; |
---|
| 240 | } |
---|
[1200] | 241 | |
---|
[56] | 242 | for (row = 0; row < height; row++) |
---|
| 243 | { |
---|
| 244 | for (col = 0; col < width; col++) |
---|
| 245 | { |
---|
| 246 | Int sum; |
---|
[1200] | 247 | |
---|
[56] | 248 | sum = src[ col + 0 * cStride] * c[0]; |
---|
| 249 | sum += src[ col + 1 * cStride] * c[1]; |
---|
| 250 | if ( N >= 4 ) |
---|
| 251 | { |
---|
| 252 | sum += src[ col + 2 * cStride] * c[2]; |
---|
| 253 | sum += src[ col + 3 * cStride] * c[3]; |
---|
| 254 | } |
---|
| 255 | if ( N >= 6 ) |
---|
| 256 | { |
---|
| 257 | sum += src[ col + 4 * cStride] * c[4]; |
---|
| 258 | sum += src[ col + 5 * cStride] * c[5]; |
---|
| 259 | } |
---|
| 260 | if ( N == 8 ) |
---|
| 261 | { |
---|
| 262 | sum += src[ col + 6 * cStride] * c[6]; |
---|
[1200] | 263 | sum += src[ col + 7 * cStride] * c[7]; |
---|
[56] | 264 | } |
---|
[1200] | 265 | |
---|
| 266 | Pel val = ( sum + offset ) >> shift; |
---|
[56] | 267 | if ( isLast ) |
---|
| 268 | { |
---|
| 269 | val = ( val < 0 ) ? 0 : val; |
---|
[1200] | 270 | val = ( val > maxVal ) ? maxVal : val; |
---|
[56] | 271 | } |
---|
| 272 | dst[col] = val; |
---|
| 273 | } |
---|
[1200] | 274 | |
---|
[56] | 275 | src += srcStride; |
---|
| 276 | dst += dstStride; |
---|
[1200] | 277 | } |
---|
[56] | 278 | } |
---|
| 279 | |
---|
| 280 | /** |
---|
| 281 | * \brief Filter a block of samples (horizontal) |
---|
| 282 | * |
---|
| 283 | * \tparam N Number of taps |
---|
[608] | 284 | * \param bitDepth Bit depth of samples |
---|
[56] | 285 | * \param src Pointer to source samples |
---|
| 286 | * \param srcStride Stride of source samples |
---|
| 287 | * \param dst Pointer to destination samples |
---|
| 288 | * \param dstStride Stride of destination samples |
---|
| 289 | * \param width Width of block |
---|
| 290 | * \param height Height of block |
---|
| 291 | * \param isLast Flag indicating whether it is the last filtering operation |
---|
| 292 | * \param coeff Pointer to filter taps |
---|
| 293 | */ |
---|
[608] | 294 | template<Int N> |
---|
[1200] | 295 | Void TComInterpolationFilter::filterHor(Int bitDepth, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Bool isLast, TFilterCoeff const *coeff) |
---|
[56] | 296 | { |
---|
| 297 | if ( isLast ) |
---|
| 298 | { |
---|
[608] | 299 | filter<N, false, true, true>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[56] | 300 | } |
---|
| 301 | else |
---|
| 302 | { |
---|
[608] | 303 | filter<N, false, true, false>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[56] | 304 | } |
---|
| 305 | } |
---|
| 306 | |
---|
| 307 | /** |
---|
| 308 | * \brief Filter a block of samples (vertical) |
---|
| 309 | * |
---|
| 310 | * \tparam N Number of taps |
---|
[1200] | 311 | * \param bitDepth Bit depth |
---|
[56] | 312 | * \param src Pointer to source samples |
---|
| 313 | * \param srcStride Stride of source samples |
---|
| 314 | * \param dst Pointer to destination samples |
---|
| 315 | * \param dstStride Stride of destination samples |
---|
| 316 | * \param width Width of block |
---|
| 317 | * \param height Height of block |
---|
| 318 | * \param isFirst Flag indicating whether it is the first filtering operation |
---|
| 319 | * \param isLast Flag indicating whether it is the last filtering operation |
---|
| 320 | * \param coeff Pointer to filter taps |
---|
| 321 | */ |
---|
[608] | 322 | template<Int N> |
---|
[1200] | 323 | Void TComInterpolationFilter::filterVer(Int bitDepth, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast, TFilterCoeff const *coeff) |
---|
[56] | 324 | { |
---|
| 325 | if ( isFirst && isLast ) |
---|
| 326 | { |
---|
[608] | 327 | filter<N, true, true, true>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[56] | 328 | } |
---|
| 329 | else if ( isFirst && !isLast ) |
---|
| 330 | { |
---|
[608] | 331 | filter<N, true, true, false>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[56] | 332 | } |
---|
| 333 | else if ( !isFirst && isLast ) |
---|
| 334 | { |
---|
[608] | 335 | filter<N, true, false, true>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[56] | 336 | } |
---|
| 337 | else |
---|
| 338 | { |
---|
[608] | 339 | filter<N, true, false, false>(bitDepth, src, srcStride, dst, dstStride, width, height, coeff); |
---|
[1200] | 340 | } |
---|
[56] | 341 | } |
---|
| 342 | |
---|
| 343 | // ==================================================================================================================== |
---|
| 344 | // Public member functions |
---|
| 345 | // ==================================================================================================================== |
---|
| 346 | |
---|
| 347 | /** |
---|
[1200] | 348 | * \brief Filter a block of Luma/Chroma samples (horizontal) |
---|
[56] | 349 | * |
---|
[1200] | 350 | * \param compID Chroma component ID |
---|
[56] | 351 | * \param src Pointer to source samples |
---|
| 352 | * \param srcStride Stride of source samples |
---|
| 353 | * \param dst Pointer to destination samples |
---|
| 354 | * \param dstStride Stride of destination samples |
---|
| 355 | * \param width Width of block |
---|
| 356 | * \param height Height of block |
---|
| 357 | * \param frac Fractional sample offset |
---|
| 358 | * \param isLast Flag indicating whether it is the last filtering operation |
---|
[1200] | 359 | * \param fmt Chroma format |
---|
| 360 | * \param bitDepth Bit depth |
---|
[56] | 361 | */ |
---|
[1200] | 362 | Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth |
---|
[608] | 363 | #if H_3D_ARP |
---|
| 364 | , Bool filterType |
---|
[443] | 365 | #endif |
---|
[1200] | 366 | ) |
---|
[56] | 367 | { |
---|
| 368 | if ( frac == 0 ) |
---|
| 369 | { |
---|
[1200] | 370 | filterCopy(bitDepth, src, srcStride, dst, dstStride, width, height, true, isLast ); |
---|
[56] | 371 | } |
---|
[1200] | 372 | else if (isLuma(compID)) |
---|
[56] | 373 | { |
---|
[608] | 374 | #if H_3D_ARP |
---|
[443] | 375 | if(filterType) |
---|
[608] | 376 | { |
---|
| 377 | filterHor<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]); |
---|
| 378 | } |
---|
[443] | 379 | else |
---|
[608] | 380 | { |
---|
[443] | 381 | #endif |
---|
[1200] | 382 | |
---|
| 383 | assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); |
---|
| 384 | filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); |
---|
[608] | 385 | #if H_3D_ARP |
---|
| 386 | } |
---|
| 387 | #endif |
---|
[1200] | 388 | |
---|
[56] | 389 | } |
---|
[1200] | 390 | else |
---|
| 391 | { |
---|
| 392 | const UInt csx = getComponentScaleX(compID, fmt); |
---|
| 393 | assert(frac >=0 && csx<2 && (frac<<(1-csx)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); |
---|
| 394 | filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]); |
---|
| 395 | } |
---|
[56] | 396 | } |
---|
| 397 | |
---|
[1200] | 398 | |
---|
[56] | 399 | /** |
---|
[1200] | 400 | * \brief Filter a block of Luma/Chroma samples (vertical) |
---|
[56] | 401 | * |
---|
[1200] | 402 | * \param compID Colour component ID |
---|
[56] | 403 | * \param src Pointer to source samples |
---|
| 404 | * \param srcStride Stride of source samples |
---|
| 405 | * \param dst Pointer to destination samples |
---|
| 406 | * \param dstStride Stride of destination samples |
---|
| 407 | * \param width Width of block |
---|
| 408 | * \param height Height of block |
---|
| 409 | * \param frac Fractional sample offset |
---|
| 410 | * \param isFirst Flag indicating whether it is the first filtering operation |
---|
| 411 | * \param isLast Flag indicating whether it is the last filtering operation |
---|
[1200] | 412 | * \param fmt Chroma format |
---|
| 413 | * \param bitDepth Bit depth |
---|
[56] | 414 | */ |
---|
[1200] | 415 | Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth |
---|
[608] | 416 | #if H_3D_ARP |
---|
| 417 | , Bool filterType |
---|
[443] | 418 | #endif |
---|
[1200] | 419 | ) |
---|
[56] | 420 | { |
---|
| 421 | if ( frac == 0 ) |
---|
| 422 | { |
---|
[1200] | 423 | filterCopy(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast ); |
---|
[56] | 424 | } |
---|
[1200] | 425 | else if (isLuma(compID)) |
---|
[56] | 426 | { |
---|
[608] | 427 | #if H_3D_ARP |
---|
[443] | 428 | if(filterType) |
---|
[608] | 429 | { |
---|
| 430 | filterVer<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]); |
---|
| 431 | } |
---|
[443] | 432 | else |
---|
[608] | 433 | { |
---|
[443] | 434 | #endif |
---|
[1200] | 435 | assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); |
---|
| 436 | filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); |
---|
[608] | 437 | #if H_3D_ARP |
---|
| 438 | } |
---|
| 439 | #endif |
---|
[1200] | 440 | |
---|
[56] | 441 | } |
---|
[1200] | 442 | else |
---|
| 443 | { |
---|
| 444 | const UInt csy = getComponentScaleY(compID, fmt); |
---|
| 445 | assert(frac >=0 && csy<2 && (frac<<(1-csy)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); |
---|
| 446 | filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]); |
---|
| 447 | } |
---|
[56] | 448 | } |
---|
| 449 | |
---|
[608] | 450 | #if H_3D_ARP |
---|
| 451 | , Bool filterType |
---|
[443] | 452 | #endif |
---|
[1200] | 453 | |
---|
[608] | 454 | #if H_3D_ARP |
---|
[443] | 455 | if(filterType) |
---|
[608] | 456 | { |
---|
| 457 | filterHor<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); |
---|
| 458 | } |
---|
[443] | 459 | else |
---|
[608] | 460 | { |
---|
[443] | 461 | #endif |
---|
[608] | 462 | #if H_3D_ARP |
---|
| 463 | } |
---|
| 464 | #endif |
---|
| 465 | #if H_3D_ARP |
---|
| 466 | , Bool filterType |
---|
[443] | 467 | #endif |
---|
[608] | 468 | #if H_3D_ARP |
---|
[443] | 469 | if(filterType) |
---|
[608] | 470 | { |
---|
| 471 | filterVer<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); |
---|
| 472 | } |
---|
[443] | 473 | else |
---|
[608] | 474 | { |
---|
[443] | 475 | #endif |
---|
[608] | 476 | #if H_3D_ARP |
---|
| 477 | } |
---|
| 478 | #endif |
---|
[56] | 479 | |
---|
[1200] | 480 | |
---|
| 481 | |
---|
[56] | 482 | //! \} |
---|