2016-09-02 22:04:54 +03:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2016-08-31 00:01:10 +03:00
|
|
|
#ifndef AV1_COMMON_DERING_H_
|
|
|
|
#define AV1_COMMON_DERING_H_
|
2016-08-15 20:27:19 +03:00
|
|
|
|
2017-03-21 23:20:21 +03:00
|
|
|
#define CDEF_STRENGTH_BITS 7
|
2017-03-17 14:48:15 +03:00
|
|
|
|
2017-04-05 21:45:02 +03:00
|
|
|
#define DERING_STRENGTHS 32
|
2017-03-17 14:48:15 +03:00
|
|
|
#define CLPF_STRENGTHS 4
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "./aom_config.h"
|
2017-03-17 14:48:15 +03:00
|
|
|
#include "aom/aom_integer.h"
|
2016-08-23 02:08:15 +03:00
|
|
|
#include "aom_ports/mem.h"
|
2017-03-17 14:48:15 +03:00
|
|
|
#include "av1/common/od_dering.h"
|
|
|
|
#include "av1/common/onyxc_int.h"
|
|
|
|
#include "./od_dering.h"
|
2016-08-15 20:27:19 +03:00
|
|
|
|
2017-04-04 13:29:19 +03:00
|
|
|
static INLINE int sign(int i) { return i < 0 ? -1 : 1; }
|
|
|
|
|
|
|
|
static INLINE int constrain(int diff, int threshold, unsigned int damping) {
|
|
|
|
return threshold
|
|
|
|
? sign(diff) *
|
|
|
|
AOMMIN(
|
|
|
|
abs(diff),
|
|
|
|
AOMMAX(0, threshold - (abs(diff) >>
|
|
|
|
(damping - get_msb(threshold)))))
|
|
|
|
: 0;
|
|
|
|
}
|
|
|
|
|
2016-08-15 20:27:19 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
int sb_all_skip(const AV1_COMMON *const cm, int mi_row, int mi_col);
|
2016-10-18 22:56:37 +03:00
|
|
|
int sb_compute_dering_list(const AV1_COMMON *const cm, int mi_row, int mi_col,
|
2017-04-12 09:33:50 +03:00
|
|
|
dering_list *dlist, int filter_skip);
|
2017-03-23 00:09:51 +03:00
|
|
|
void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd);
|
2016-08-15 20:27:19 +03:00
|
|
|
|
2017-03-17 14:48:15 +03:00
|
|
|
void av1_cdef_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
|
|
|
|
AV1_COMMON *cm, MACROBLOCKD *xd);
|
2016-08-15 20:27:19 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // AV1_COMMON_DERING_H_
|