2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02: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 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef POSTPROC_H
|
|
|
|
#define POSTPROC_H
|
|
|
|
|
|
|
|
#define prototype_postproc_inplace(sym)\
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *dst, int pitch, int rows, int cols, int flimit)
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
#define prototype_postproc(sym)\
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *src, unsigned char *dst, int src_pitch, \
|
|
|
|
int dst_pitch, int rows, int cols, int flimit)
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
#define prototype_postproc_addnoise(sym) \
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *s, char *noise, char blackclamp[16], \
|
|
|
|
char whiteclamp[16], char bothclamp[16], \
|
|
|
|
unsigned int w, unsigned int h, int pitch)
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2010-11-04 18:35:02 +01:00
|
|
|
#define prototype_postproc_blend_mb_inner(sym)\
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *y, unsigned char *u, unsigned char *v, \
|
|
|
|
int y1, int u1, int v1, int alpha, int stride)
|
2010-11-04 18:35:02 +01:00
|
|
|
|
|
|
|
#define prototype_postproc_blend_mb_outer(sym)\
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *y, unsigned char *u, unsigned char *v, \
|
|
|
|
int y1, int u1, int v1, int alpha, int stride)
|
2010-11-04 18:35:02 +01:00
|
|
|
|
|
|
|
#define prototype_postproc_blend_b(sym)\
|
2012-11-01 00:09:17 +01:00
|
|
|
void sym(unsigned char *y, unsigned char *u, unsigned char *v, \
|
|
|
|
int y1, int u1, int v1, int alpha, int stride)
|
2010-10-27 21:50:16 +02:00
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
#if ARCH_X86 || ARCH_X86_64
|
|
|
|
#include "x86/postproc_x86.h"
|
|
|
|
#endif
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_down
|
|
|
|
#define vp9_postproc_down vp9_mbpost_proc_down_c
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_inplace(vp9_postproc_down);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_across
|
|
|
|
#define vp9_postproc_across vp9_mbpost_proc_across_ip_c
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_inplace(vp9_postproc_across);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_downacross
|
|
|
|
#define vp9_postproc_downacross vp9_post_proc_down_and_across_c
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc(vp9_postproc_downacross);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_addnoise
|
|
|
|
#define vp9_postproc_addnoise vp9_plane_add_noise_c
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_addnoise(vp9_postproc_addnoise);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_blend_mb_inner
|
|
|
|
#define vp9_postproc_blend_mb_inner vp9_blend_mb_inner_c
|
2010-11-04 18:35:02 +01:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_blend_mb_inner(vp9_postproc_blend_mb_inner);
|
2010-11-04 18:35:02 +01:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_blend_mb_outer
|
|
|
|
#define vp9_postproc_blend_mb_outer vp9_blend_mb_outer_c
|
2010-11-04 18:35:02 +01:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_blend_mb_outer(vp9_postproc_blend_mb_outer);
|
2010-11-04 18:35:02 +01:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
#ifndef vp9_postproc_blend_b
|
|
|
|
#define vp9_postproc_blend_b vp9_blend_b_c
|
2010-10-27 21:50:16 +02:00
|
|
|
#endif
|
2012-10-31 22:40:53 +01:00
|
|
|
extern prototype_postproc_blend_b(vp9_postproc_blend_b);
|
|
|
|
|
|
|
|
typedef prototype_postproc((*vp9_postproc_fn_t));
|
|
|
|
typedef prototype_postproc_inplace((*vp9_postproc_inplace_fn_t));
|
|
|
|
typedef prototype_postproc_addnoise((*vp9_postproc_addnoise_fn_t));
|
|
|
|
typedef prototype_postproc_blend_mb_inner((*vp9_postproc_blend_mb_inner_fn_t));
|
|
|
|
typedef prototype_postproc_blend_mb_outer((*vp9_postproc_blend_mb_outer_fn_t));
|
|
|
|
typedef prototype_postproc_blend_b((*vp9_postproc_blend_b_fn_t));
|
2012-07-14 00:21:29 +02:00
|
|
|
typedef struct {
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_postproc_inplace_fn_t down;
|
|
|
|
vp9_postproc_inplace_fn_t across;
|
|
|
|
vp9_postproc_fn_t downacross;
|
|
|
|
vp9_postproc_addnoise_fn_t addnoise;
|
|
|
|
vp9_postproc_blend_mb_inner_fn_t blend_mb_inner;
|
|
|
|
vp9_postproc_blend_mb_outer_fn_t blend_mb_outer;
|
|
|
|
vp9_postproc_blend_b_fn_t blend_b;
|
|
|
|
} vp9_postproc_rtcd_vtable_t;
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
#if CONFIG_RUNTIME_CPU_DETECT
|
|
|
|
#define POSTPROC_INVOKE(ctx,fn) (ctx)->fn
|
|
|
|
#else
|
2012-10-31 22:40:53 +01:00
|
|
|
#define POSTPROC_INVOKE(ctx,fn) vp9_postproc_##fn
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "vpx_ports/mem.h"
|
2012-07-14 00:21:29 +02:00
|
|
|
struct postproc_state {
|
|
|
|
int last_q;
|
|
|
|
int last_noise;
|
|
|
|
char noise[3072];
|
|
|
|
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
|
|
|
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
|
|
|
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
2010-05-18 17:58:33 +02:00
|
|
|
};
|
|
|
|
#include "onyxc_int.h"
|
|
|
|
#include "ppflags.h"
|
2012-10-31 01:53:32 +01:00
|
|
|
int vp9_post_proc_frame(struct VP9Common *oci, YV12_BUFFER_CONFIG *dest,
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_ppflags_t *flags);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
|
2012-10-31 00:25:53 +01:00
|
|
|
void vp9_de_noise(YV12_BUFFER_CONFIG *source,
|
2010-05-18 17:58:33 +02:00
|
|
|
YV12_BUFFER_CONFIG *post,
|
|
|
|
int q,
|
|
|
|
int low_var_thresh,
|
|
|
|
int flag,
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_postproc_rtcd_vtable_t *rtcd);
|
2010-05-28 10:37:43 +02:00
|
|
|
|
2012-10-31 00:25:53 +01:00
|
|
|
void vp9_deblock(YV12_BUFFER_CONFIG *source,
|
2010-05-28 10:37:43 +02:00
|
|
|
YV12_BUFFER_CONFIG *post,
|
|
|
|
int q,
|
|
|
|
int low_var_thresh,
|
|
|
|
int flag,
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_postproc_rtcd_vtable_t *rtcd);
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|