Home | History | Annotate | Download | only in generic
      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 __VPX_SCALE_ARBITRARY_H__
     13 #define __VPX_SCALE_ARBITRARY_H__
     14 
     15 #include "vpx_scale/yv12config.h"
     16 
     17 typedef struct
     18 {
     19     int in_width;
     20     int in_height;
     21 
     22     int out_width;
     23     int out_height;
     24     int max_usable_out_width;
     25 
     26     // numerator for the width and height
     27     int nw;
     28     int nh;
     29     int nh_uv;
     30 
     31     // output to input correspondance array
     32     short *l_w;
     33     short *l_h;
     34     short *l_h_uv;
     35 
     36     // polyphase coefficients
     37     short *c_w;
     38     short *c_h;
     39     short *c_h_uv;
     40 
     41     // buffer for horizontal filtering.
     42     unsigned char *hbuf;
     43     unsigned char *hbuf_uv;
     44 } BICUBIC_SCALER_STRUCT;
     45 
     46 int bicubic_coefficient_setup(int in_width, int in_height, int out_width, int out_height);
     47 int bicubic_scale(int in_width, int in_height, int in_stride,
     48                   int out_width, int out_height, int out_stride,
     49                   unsigned char *input_image, unsigned char *output_image);
     50 void bicubic_scale_frame_reset();
     51 void bicubic_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
     52                          int new_width, int new_height);
     53 void bicubic_coefficient_init();
     54 void bicubic_coefficient_destroy();
     55 
     56 #endif /* __VPX_SCALE_ARBITRARY_H__ */
     57