CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / media / libvpx / vp8 / common / postproc.h
blob4a4493802e3f22d7b35e1409157b9526e71c0f5e
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
12 #ifndef POSTPROC_H
13 #define POSTPROC_H
15 #define prototype_postproc_inplace(sym)\
16 void sym (unsigned char *dst, int pitch, int rows, int cols,int flimit)
18 #define prototype_postproc(sym)\
19 void sym (unsigned char *src, unsigned char *dst, int src_pitch,\
20 int dst_pitch, int rows, int cols, int flimit)
22 #define prototype_postproc_addnoise(sym) \
23 void sym (unsigned char *s, char *noise, char blackclamp[16],\
24 char whiteclamp[16], char bothclamp[16],\
25 unsigned int w, unsigned int h, int pitch)
27 #define prototype_postproc_blend_mb(sym)\
28 void sym (unsigned char *y, unsigned char *u, unsigned char *v,\
29 int y1, int u1, int v1, int alpha, int stride)
31 #if ARCH_X86 || ARCH_X86_64
32 #include "x86/postproc_x86.h"
33 #endif
35 #ifndef vp8_postproc_down
36 #define vp8_postproc_down vp8_mbpost_proc_down_c
37 #endif
38 extern prototype_postproc_inplace(vp8_postproc_down);
40 #ifndef vp8_postproc_across
41 #define vp8_postproc_across vp8_mbpost_proc_across_ip_c
42 #endif
43 extern prototype_postproc_inplace(vp8_postproc_across);
45 #ifndef vp8_postproc_downacross
46 #define vp8_postproc_downacross vp8_post_proc_down_and_across_c
47 #endif
48 extern prototype_postproc(vp8_postproc_downacross);
50 #ifndef vp8_postproc_addnoise
51 #define vp8_postproc_addnoise vp8_plane_add_noise_c
52 #endif
53 extern prototype_postproc_addnoise(vp8_postproc_addnoise);
55 #ifndef vp8_postproc_blend_mb
56 #define vp8_postproc_blend_mb vp8_blend_mb_c
57 #endif
58 extern prototype_postproc_blend_mb(vp8_postproc_blend_mb);
60 typedef prototype_postproc((*vp8_postproc_fn_t));
61 typedef prototype_postproc_inplace((*vp8_postproc_inplace_fn_t));
62 typedef prototype_postproc_addnoise((*vp8_postproc_addnoise_fn_t));
63 typedef prototype_postproc_blend_mb((*vp8_postproc_blend_mb_fn_t));
64 typedef struct
66 vp8_postproc_inplace_fn_t down;
67 vp8_postproc_inplace_fn_t across;
68 vp8_postproc_fn_t downacross;
69 vp8_postproc_addnoise_fn_t addnoise;
70 vp8_postproc_blend_mb_fn_t blend_mb;
71 } vp8_postproc_rtcd_vtable_t;
73 #if CONFIG_RUNTIME_CPU_DETECT
74 #define POSTPROC_INVOKE(ctx,fn) (ctx)->fn
75 #else
76 #define POSTPROC_INVOKE(ctx,fn) vp8_postproc_##fn
77 #endif
79 #include "vpx_ports/mem.h"
80 struct postproc_state
82 int last_q;
83 int last_noise;
84 char noise[3072];
85 DECLARE_ALIGNED(16, char, blackclamp[16]);
86 DECLARE_ALIGNED(16, char, whiteclamp[16]);
87 DECLARE_ALIGNED(16, char, bothclamp[16]);
89 #include "onyxc_int.h"
90 #include "ppflags.h"
91 int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest,
92 int deblock_level, int noise_level, int flags);
95 void vp8_de_noise(YV12_BUFFER_CONFIG *source,
96 YV12_BUFFER_CONFIG *post,
97 int q,
98 int low_var_thresh,
99 int flag,
100 vp8_postproc_rtcd_vtable_t *rtcd);
102 void vp8_deblock(YV12_BUFFER_CONFIG *source,
103 YV12_BUFFER_CONFIG *post,
104 int q,
105 int low_var_thresh,
106 int flag,
107 vp8_postproc_rtcd_vtable_t *rtcd);
108 #endif