Home | History | Annotate | Download | only in common
      1 /******************************************************************************
      2  *
      3  * Copyright (C) 2015 The Android Open Source Project
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at:
      8  *
      9  * http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  *
     17  *****************************************************************************
     18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
     19 */
     20 /**
     21 *******************************************************************************
     22 * @file
     23 *  ideint.h
     24 *
     25 * @brief
     26 *  Deinterlacer API file
     27 *
     28 * @author
     29 *  Ittiam
     30 *
     31 * @par List of Functions:
     32 *
     33 * @remarks
     34 *  None
     35 *
     36 *******************************************************************************
     37 */
     38 
     39 #ifndef __IDEINT_H__
     40 #define __IDEINT_H__
     41 
     42 /** Error codes */
     43 typedef enum
     44 {
     45     /** Dummy error code */
     46     IDEINT_ERROR_NA = 0x7FFFFFFF,
     47 
     48     /** No error */
     49     IDEINT_ERROR_NONE = 0,
     50 
     51     /** Invalid Context */
     52     IDEINT_INVALID_CTXT,
     53 
     54     /** Start row not aligned to 8 */
     55     IDEINT_START_ROW_UNALIGNED,
     56 
     57 
     58 }IDEINT_ERROR_T;
     59 
     60 /** Modes of deinterlacing */
     61 typedef enum
     62 {
     63     /** Dummy mode */
     64     IDEINT_MODE_NA = 0x7FFFFFFF,
     65 
     66     /** Weave two fields to get a frame, no filtering */
     67     IDEINT_MODE_WEAVE = 0,
     68 
     69     /** Weave two fields in static blocks and
     70      spatial filtering for non-static blocks */
     71     IDEINT_MODE_SPATIAL,
     72 
     73 }IDEINT_MODE_T;
     74 
     75 /** Deinterlacer parameters */
     76 typedef struct
     77 {
     78     /** Mode for deinterlacing */
     79     IDEINT_MODE_T e_mode;
     80 
     81     /** Flag to indicate if the current field is top field,
     82      * Prev and Next field are assumed to be of opposite parity
     83      */
     84     WORD32  i4_cur_fld_top;
     85 
     86     /** Flag to signal if weave should be disabled.
     87      * i.e. output already contains weaved fields
     88      */
     89     WORD32  i4_disable_weave;
     90 
     91     /** CPU Architecture */
     92     ICV_ARCH_T e_arch;
     93 
     94     /** SOC */
     95     ICV_SOC_T e_soc;
     96 
     97     /** Pointer to a function for aligned allocation.
     98      * If NULL, then malloc will be used internally
     99      * Module will allocate if any extra memory is needed
    100      */
    101     void *(*pf_aligned_alloc)(WORD32 alignment, WORD32 size);
    102 
    103     /** Pointer to a function for aligned free.
    104      * If NULL, then free will be used internally
    105      */
    106     void   (*pf_aligned_free)(void *pv_buf);
    107 
    108 }ideint_params_t;
    109 
    110 /** Deinterlacer context size */
    111 WORD32 ideint_ctxt_size(void);
    112 
    113 /** Deinterlacer process */
    114 IDEINT_ERROR_T ideint_process(void *pv_ctxt,
    115                               icv_pic_t *ps_prv_fld,
    116                               icv_pic_t *ps_cur_fld,
    117                               icv_pic_t *ps_nxt_fld,
    118                               icv_pic_t *ps_out_frm,
    119                               ideint_params_t *ps_params,
    120                               WORD32 start_row,
    121                               WORD32 num_rows);
    122 
    123 #endif /* __IDEINT_H__ */
    124