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 __INC_IDCT_H
     13 #define __INC_IDCT_H
     14 
     15 #define prototype_second_order(sym) \
     16     void sym(short *input, short *output)
     17 
     18 #define prototype_idct(sym) \
     19     void sym(short *input, short *output, int pitch)
     20 
     21 #define prototype_idct_scalar_add(sym) \
     22     void sym(short input, \
     23              unsigned char *pred, unsigned char *output, \
     24              int pitch, int stride)
     25 
     26 #if ARCH_X86 || ARCH_X86_64
     27 #include "x86/idct_x86.h"
     28 #endif
     29 
     30 #if ARCH_ARM
     31 #include "arm/idct_arm.h"
     32 #endif
     33 
     34 #ifndef vp8_idct_idct1
     35 #define vp8_idct_idct1 vp8_short_idct4x4llm_1_c
     36 #endif
     37 extern prototype_idct(vp8_idct_idct1);
     38 
     39 #ifndef vp8_idct_idct16
     40 #define vp8_idct_idct16 vp8_short_idct4x4llm_c
     41 #endif
     42 extern prototype_idct(vp8_idct_idct16);
     43 
     44 #ifndef vp8_idct_idct1_scalar_add
     45 #define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_c
     46 #endif
     47 extern prototype_idct_scalar_add(vp8_idct_idct1_scalar_add);
     48 
     49 
     50 #ifndef vp8_idct_iwalsh1
     51 #define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_c
     52 #endif
     53 extern prototype_second_order(vp8_idct_iwalsh1);
     54 
     55 #ifndef vp8_idct_iwalsh16
     56 #define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_c
     57 #endif
     58 extern prototype_second_order(vp8_idct_iwalsh16);
     59 
     60 typedef prototype_idct((*vp8_idct_fn_t));
     61 typedef prototype_idct_scalar_add((*vp8_idct_scalar_add_fn_t));
     62 typedef prototype_second_order((*vp8_second_order_fn_t));
     63 
     64 typedef struct
     65 {
     66     vp8_idct_fn_t            idct1;
     67     vp8_idct_fn_t            idct16;
     68     vp8_idct_scalar_add_fn_t idct1_scalar_add;
     69 
     70     vp8_second_order_fn_t iwalsh1;
     71     vp8_second_order_fn_t iwalsh16;
     72 } vp8_idct_rtcd_vtable_t;
     73 
     74 #if CONFIG_RUNTIME_CPU_DETECT
     75 #define IDCT_INVOKE(ctx,fn) (ctx)->fn
     76 #else
     77 #define IDCT_INVOKE(ctx,fn) vp8_idct_##fn
     78 #endif
     79 
     80 #endif
     81