Commit a5378e73 authored by Cheng Chen's avatar Cheng Chen

Clean CLPF local function

Rename local functions and make them static.
Remove unnecessary header file and corresponding includes.

Change-Id: I4b09e3949e7207754753997ff359992bd348d488
parent 74ad0917
...@@ -236,7 +236,6 @@ if (CONFIG_CDEF) ...@@ -236,7 +236,6 @@ if (CONFIG_CDEF)
set(AOM_AV1_COMMON_SOURCES set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES} ${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/clpf.c" "${AOM_ROOT}/av1/common/clpf.c"
"${AOM_ROOT}/av1/common/clpf.h"
"${AOM_ROOT}/av1/common/clpf_simd.h" "${AOM_ROOT}/av1/common/clpf_simd.h"
"${AOM_ROOT}/av1/common/cdef_simd.h" "${AOM_ROOT}/av1/common/cdef_simd.h"
"${AOM_ROOT}/av1/common/cdef.c" "${AOM_ROOT}/av1/common/cdef.c"
......
...@@ -91,7 +91,6 @@ AV1_COMMON_SRCS-yes += common/warped_motion.c ...@@ -91,7 +91,6 @@ AV1_COMMON_SRCS-yes += common/warped_motion.c
endif endif
ifeq ($(CONFIG_CDEF),yes) ifeq ($(CONFIG_CDEF),yes)
AV1_COMMON_SRCS-yes += common/clpf.c AV1_COMMON_SRCS-yes += common/clpf.c
AV1_COMMON_SRCS-yes += common/clpf.h
AV1_COMMON_SRCS-yes += common/clpf_simd.h AV1_COMMON_SRCS-yes += common/clpf_simd.h
AV1_COMMON_SRCS-yes += common/cdef_simd.h AV1_COMMON_SRCS-yes += common/cdef_simd.h
AV1_COMMON_SRCS-$(HAVE_SSE2) += common/clpf_sse2.c AV1_COMMON_SRCS-$(HAVE_SSE2) += common/clpf_sse2.c
......
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent. * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/ */
#include "./clpf.h"
#include "./av1_rtcd.h" #include "./av1_rtcd.h"
#include "./cdef.h" #include "./cdef.h"
#include "aom/aom_image.h" #include "aom/aom_image.h"
#include "aom_dsp/aom_dsp_common.h" #include "aom_dsp/aom_dsp_common.h"
int av1_clpf_sample(int X, int A, int B, int C, int D, int E, int F, int G, static int clpf_sample(int X, int A, int B, int C, int D, int E, int F, int G,
int H, int s, unsigned int dmp) { int H, int s, unsigned int dmp) {
int delta = 1 * constrain(A - X, s, dmp) + 3 * constrain(B - X, s, dmp) + int delta = 1 * constrain(A - X, s, dmp) + 3 * constrain(B - X, s, dmp) +
1 * constrain(C - X, s, dmp) + 3 * constrain(D - X, s, dmp) + 1 * constrain(C - X, s, dmp) + 3 * constrain(D - X, s, dmp) +
3 * constrain(E - X, s, dmp) + 1 * constrain(F - X, s, dmp) + 3 * constrain(E - X, s, dmp) + 1 * constrain(F - X, s, dmp) +
...@@ -24,8 +23,8 @@ int av1_clpf_sample(int X, int A, int B, int C, int D, int E, int F, int G, ...@@ -24,8 +23,8 @@ int av1_clpf_sample(int X, int A, int B, int C, int D, int E, int F, int G,
return (8 + delta - (delta < 0)) >> 4; return (8 + delta - (delta < 0)) >> 4;
} }
int av1_clpf_hsample(int X, int A, int B, int C, int D, int s, static int clpf_hsample(int X, int A, int B, int C, int D, int s,
unsigned int dmp) { unsigned int dmp) {
int delta = 1 * constrain(A - X, s, dmp) + 3 * constrain(B - X, s, dmp) + int delta = 1 * constrain(A - X, s, dmp) + 3 * constrain(B - X, s, dmp) +
3 * constrain(C - X, s, dmp) + 1 * constrain(D - X, s, dmp); 3 * constrain(C - X, s, dmp) + 1 * constrain(D - X, s, dmp);
return (4 + delta - (delta < 0)) >> 3; return (4 + delta - (delta < 0)) >> 3;
...@@ -48,7 +47,7 @@ void aom_clpf_block_c(uint8_t *dst, const uint16_t *src, int dstride, ...@@ -48,7 +47,7 @@ void aom_clpf_block_c(uint8_t *dst, const uint16_t *src, int dstride,
const int G = src[(y + 1) * sstride + x]; const int G = src[(y + 1) * sstride + x];
const int H = src[(y + 2) * sstride + x]; const int H = src[(y + 2) * sstride + x];
const int delta = const int delta =
av1_clpf_sample(X, A, B, C, D, E, F, G, H, strength, damping); clpf_sample(X, A, B, C, D, E, F, G, H, strength, damping);
dst[y * dstride + x] = X + delta; dst[y * dstride + x] = X + delta;
} }
} }
...@@ -72,7 +71,7 @@ void aom_clpf_block_hbd_c(uint16_t *dst, const uint16_t *src, int dstride, ...@@ -72,7 +71,7 @@ void aom_clpf_block_hbd_c(uint16_t *dst, const uint16_t *src, int dstride,
const int G = src[(y + 1) * sstride + x]; const int G = src[(y + 1) * sstride + x];
const int H = src[(y + 2) * sstride + x]; const int H = src[(y + 2) * sstride + x];
const int delta = const int delta =
av1_clpf_sample(X, A, B, C, D, E, F, G, H, strength, damping); clpf_sample(X, A, B, C, D, E, F, G, H, strength, damping);
dst[y * dstride + x] = X + delta; dst[y * dstride + x] = X + delta;
} }
} }
...@@ -91,7 +90,7 @@ void aom_clpf_hblock_c(uint8_t *dst, const uint16_t *src, int dstride, ...@@ -91,7 +90,7 @@ void aom_clpf_hblock_c(uint8_t *dst, const uint16_t *src, int dstride,
const int B = src[y * sstride + x - 1]; const int B = src[y * sstride + x - 1];
const int C = src[y * sstride + x + 1]; const int C = src[y * sstride + x + 1];
const int D = src[y * sstride + x + 2]; const int D = src[y * sstride + x + 2];
const int delta = av1_clpf_hsample(X, A, B, C, D, strength, damping); const int delta = clpf_hsample(X, A, B, C, D, strength, damping);
dst[y * dstride + x] = X + delta; dst[y * dstride + x] = X + delta;
} }
} }
...@@ -109,7 +108,7 @@ void aom_clpf_hblock_hbd_c(uint16_t *dst, const uint16_t *src, int dstride, ...@@ -109,7 +108,7 @@ void aom_clpf_hblock_hbd_c(uint16_t *dst, const uint16_t *src, int dstride,
const int B = src[y * sstride + x - 1]; const int B = src[y * sstride + x - 1];
const int C = src[y * sstride + x + 1]; const int C = src[y * sstride + x + 1];
const int D = src[y * sstride + x + 2]; const int D = src[y * sstride + x + 2];
const int delta = av1_clpf_hsample(X, A, B, C, D, strength, damping); const int delta = clpf_hsample(X, A, B, C, D, strength, damping);
dst[y * dstride + x] = X + delta; dst[y * dstride + x] = X + delta;
} }
} }
......
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AV1_COMMON_CLPF_H_
#define AV1_COMMON_CLPF_H_
#include "av1/common/reconinter.h"
int av1_clpf_sample(int X, int A, int B, int C, int D, int E, int F, int G,
int H, int b, unsigned int dmp);
#endif
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "av1/common/alloccommon.h" #include "av1/common/alloccommon.h"
#if CONFIG_CDEF #if CONFIG_CDEF
#include "av1/common/cdef.h" #include "av1/common/cdef.h"
#include "av1/common/clpf.h"
#endif #endif
#if CONFIG_INSPECTION #if CONFIG_INSPECTION
#include "av1/decoder/inspection.h" #include "av1/decoder/inspection.h"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#if CONFIG_CDEF #if CONFIG_CDEF
#include "av1/common/cdef.h" #include "av1/common/cdef.h"
#include "av1/common/clpf.h"
#endif // CONFIG_CDEF #endif // CONFIG_CDEF
#include "av1/common/entropy.h" #include "av1/common/entropy.h"
#include "av1/common/entropymode.h" #include "av1/common/entropymode.h"
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "av1/common/alloccommon.h" #include "av1/common/alloccommon.h"
#if CONFIG_CDEF #if CONFIG_CDEF
#include "av1/common/cdef.h" #include "av1/common/cdef.h"
#include "av1/common/clpf.h"
#endif // CONFIG_CDEF #endif // CONFIG_CDEF
#include "av1/common/filter.h" #include "av1/common/filter.h"
#include "av1/common/idct.h" #include "av1/common/idct.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment