2010-05-18 19:58:33 +04:00
|
|
|
/*
|
2010-09-09 16:16:39 +04:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 19:58:33 +04:00
|
|
|
*
|
2010-06-18 20:39:21 +04:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-05 00:19:40 +04:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 20:39:21 +04:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-05 00:19:40 +04:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 19:58:33 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef loopfilter_h
|
|
|
|
#define loopfilter_h
|
|
|
|
|
|
|
|
#include "vpx_ports/mem.h"
|
2011-06-10 15:10:21 +04:00
|
|
|
#include "vpx_config.h"
|
2012-01-13 04:15:42 +04:00
|
|
|
#include "vpx_rtcd.h"
|
2010-05-18 19:58:33 +04:00
|
|
|
|
2011-10-18 10:48:50 +04:00
|
|
|
#define MAX_LOOP_FILTER 63
|
|
|
|
/* fraction of total macroblock rows to be used in fast filter level picking */
|
|
|
|
/* has to be > 2 */
|
|
|
|
#define PARTIAL_FRAME_FRACTION 8
|
2010-05-18 19:58:33 +04:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
NORMAL_LOOPFILTER = 0,
|
|
|
|
SIMPLE_LOOPFILTER = 1
|
|
|
|
} LOOPFILTERTYPE;
|
|
|
|
|
2011-06-10 15:10:21 +04:00
|
|
|
#if ARCH_ARM
|
|
|
|
#define SIMD_WIDTH 1
|
|
|
|
#else
|
|
|
|
#define SIMD_WIDTH 16
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Need to align this structure so when it is declared and
|
2010-10-28 03:04:02 +04:00
|
|
|
* passed it can be loaded into vector registers.
|
|
|
|
*/
|
2010-05-18 19:58:33 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2011-06-10 15:10:21 +04:00
|
|
|
DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, mblim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
|
|
|
|
DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, blim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
|
|
|
|
DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
|
|
|
|
DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, hev_thr[4][SIMD_WIDTH]);
|
|
|
|
unsigned char lvl[4][4][4];
|
|
|
|
unsigned char hev_thr_lut[2][MAX_LOOP_FILTER + 1];
|
|
|
|
unsigned char mode_lf_lut[10];
|
|
|
|
} loop_filter_info_n;
|
|
|
|
|
2012-01-13 04:15:42 +04:00
|
|
|
typedef struct loop_filter_info
|
2011-06-10 15:10:21 +04:00
|
|
|
{
|
|
|
|
const unsigned char * mblim;
|
|
|
|
const unsigned char * blim;
|
|
|
|
const unsigned char * lim;
|
|
|
|
const unsigned char * hev_thr;
|
2010-05-18 19:58:33 +04:00
|
|
|
} loop_filter_info;
|
|
|
|
|
|
|
|
|
2010-06-25 17:18:11 +04:00
|
|
|
typedef void loop_filter_uvfunction
|
|
|
|
(
|
2010-10-28 03:04:02 +04:00
|
|
|
unsigned char *u, /* source pointer */
|
|
|
|
int p, /* pitch */
|
2011-06-10 15:10:21 +04:00
|
|
|
const unsigned char *blimit,
|
|
|
|
const unsigned char *limit,
|
|
|
|
const unsigned char *thresh,
|
2010-06-25 17:18:11 +04:00
|
|
|
unsigned char *v
|
|
|
|
);
|
2010-05-18 19:58:33 +04:00
|
|
|
|
2011-07-20 23:53:42 +04:00
|
|
|
/* assorted loopfilter functions which get used elsewhere */
|
|
|
|
struct VP8Common;
|
2012-01-13 04:55:44 +04:00
|
|
|
struct macroblockd;
|
2012-08-02 22:58:09 +04:00
|
|
|
struct modeinfo;
|
2011-07-20 23:53:42 +04:00
|
|
|
|
|
|
|
void vp8_loop_filter_init(struct VP8Common *cm);
|
|
|
|
|
|
|
|
void vp8_loop_filter_frame_init(struct VP8Common *cm,
|
2012-01-13 04:55:44 +04:00
|
|
|
struct macroblockd *mbd,
|
2011-07-20 23:53:42 +04:00
|
|
|
int default_filt_lvl);
|
|
|
|
|
2012-05-22 15:19:10 +04:00
|
|
|
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd,
|
|
|
|
int frame_type);
|
2011-07-20 23:53:42 +04:00
|
|
|
|
|
|
|
void vp8_loop_filter_partial_frame(struct VP8Common *cm,
|
2012-01-13 04:55:44 +04:00
|
|
|
struct macroblockd *mbd,
|
2011-07-20 23:53:42 +04:00
|
|
|
int default_filt_lvl);
|
|
|
|
|
|
|
|
void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
|
2012-01-13 04:55:44 +04:00
|
|
|
struct macroblockd *mbd,
|
2011-07-20 23:53:42 +04:00
|
|
|
int default_filt_lvl);
|
|
|
|
|
|
|
|
void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
|
|
|
|
int sharpness_lvl);
|
|
|
|
|
2012-08-02 22:58:09 +04:00
|
|
|
void vp8_loop_filter_row_normal(struct VP8Common *cm,
|
|
|
|
struct modeinfo *mode_info_context,
|
|
|
|
int mb_row, int post_ystride, int post_uvstride,
|
|
|
|
unsigned char *y_ptr, unsigned char *u_ptr,
|
|
|
|
unsigned char *v_ptr);
|
|
|
|
|
|
|
|
void vp8_loop_filter_row_simple(struct VP8Common *cm,
|
|
|
|
struct modeinfo *mode_info_context,
|
|
|
|
int mb_row, int post_ystride, int post_uvstride,
|
|
|
|
unsigned char *y_ptr, unsigned char *u_ptr,
|
|
|
|
unsigned char *v_ptr);
|
2010-05-18 19:58:33 +04:00
|
|
|
#endif
|