Home | History | Annotate | Download | only in common
      1 /*
      2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
      3  *
      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  */
     10 
     11 
     12 #ifndef POSTPROC_H
     13 #define POSTPROC_H
     14 
     15 #define prototype_postproc_inplace(sym)\
     16     void sym (unsigned char *dst, int pitch, int rows, int cols,int flimit)
     17 
     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)
     21 
     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)
     26 
     27 #if ARCH_X86 || ARCH_X86_64
     28 #include "x86/postproc_x86.h"
     29 #endif
     30 
     31 #ifndef vp8_postproc_down
     32 #define vp8_postproc_down vp8_mbpost_proc_down_c
     33 #endif
     34 extern prototype_postproc_inplace(vp8_postproc_down);
     35 
     36 #ifndef vp8_postproc_across
     37 #define vp8_postproc_across vp8_mbpost_proc_across_ip_c
     38 #endif
     39 extern prototype_postproc_inplace(vp8_postproc_across);
     40 
     41 #ifndef vp8_postproc_downacross
     42 #define vp8_postproc_downacross vp8_post_proc_down_and_across_c
     43 #endif
     44 extern prototype_postproc(vp8_postproc_downacross);
     45 
     46 #ifndef vp8_postproc_addnoise
     47 #define vp8_postproc_addnoise vp8_plane_add_noise_c
     48 #endif
     49 extern prototype_postproc_addnoise(vp8_postproc_addnoise);
     50 
     51 
     52 typedef prototype_postproc((*vp8_postproc_fn_t));
     53 typedef prototype_postproc_inplace((*vp8_postproc_inplace_fn_t));
     54 typedef prototype_postproc_addnoise((*vp8_postproc_addnoise_fn_t));
     55 typedef struct
     56 {
     57     vp8_postproc_inplace_fn_t   down;
     58     vp8_postproc_inplace_fn_t   across;
     59     vp8_postproc_fn_t           downacross;
     60     vp8_postproc_addnoise_fn_t  addnoise;
     61 } vp8_postproc_rtcd_vtable_t;
     62 
     63 #if CONFIG_RUNTIME_CPU_DETECT
     64 #define POSTPROC_INVOKE(ctx,fn) (ctx)->fn
     65 #else
     66 #define POSTPROC_INVOKE(ctx,fn) vp8_postproc_##fn
     67 #endif
     68 
     69 #include "vpx_ports/mem.h"
     70 struct postproc_state
     71 {
     72     int           last_q;
     73     int           last_noise;
     74     char          noise[3072];
     75     DECLARE_ALIGNED(16, char, blackclamp[16]);
     76     DECLARE_ALIGNED(16, char, whiteclamp[16]);
     77     DECLARE_ALIGNED(16, char, bothclamp[16]);
     78 };
     79 #include "onyxc_int.h"
     80 #include "ppflags.h"
     81 int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest,
     82                         int deblock_level, int noise_level, int flags);
     83 
     84 
     85 void vp8_de_noise(YV12_BUFFER_CONFIG         *source,
     86                   YV12_BUFFER_CONFIG         *post,
     87                   int                         q,
     88                   int                         low_var_thresh,
     89                   int                         flag,
     90                   vp8_postproc_rtcd_vtable_t *rtcd);
     91 
     92 void vp8_deblock(YV12_BUFFER_CONFIG         *source,
     93                  YV12_BUFFER_CONFIG         *post,
     94                  int                         q,
     95                  int                         low_var_thresh,
     96                  int                         flag,
     97                  vp8_postproc_rtcd_vtable_t *rtcd);
     98 #endif
     99