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_proc_fxns.c
24 *
25 * @brief
26 *  This file contains the definitions of the core  processing of the de
27 * interlacer.
28 *
29 * @author
30 *  Ittiam
31 *
32 * @par List of Functions:
33 *  ideint_corrupt_pic()
34 *
35 * @remarks
36 *  None
37 *
38 *******************************************************************************
39 */
40 /*****************************************************************************/
41 /* File Includes                                                             */
42 /*****************************************************************************/
43 /* System include files */
44 #include <stdio.h>
45 #include <stdint.h>
46 #include <string.h>
47 #include <stdlib.h>
48 #include <assert.h>
49 
50 
51 /* User include files */
52 #include "icv_datatypes.h"
53 #include "icv_macros.h"
54 #include "icv_platform_macros.h"
55 #include "icv.h"
56 #include "icv_variance.h"
57 #include "icv_sad.h"
58 #include "ideint.h"
59 
60 #include "ideint_defs.h"
61 #include "ideint_structs.h"
62 #include "ideint_utils.h"
63 #include "ideint_cac.h"
64 #include "ideint_debug.h"
65 
66 /**
67 *******************************************************************************
68 *
69 * @brief
70 *  Corrupt a picture with given value
71 *
72 * @par   Description
73 *  Corrupt a picture with given value
74 *
75 * @param[in] ps_pic
76 *  Picture to be corrupted
77 *
78 * @param[in] val
79 *  Value to be used to corrupt the picture
80 *
81 * @returns
82 *  None
83 *
84 * @remarks
85 *
86 *******************************************************************************
87 */
88 void ideint_corrupt_pic(icv_pic_t *ps_pic, WORD32 val)
89 {
90     WORD32 i, j;
91     WORD32 num_comp;
92 
93     num_comp = 3;
94     for (i = 0; i < num_comp; i++)
95     {
96         WORD32 wd, ht, strd;
97         UWORD8 *pu1_buf;
98         wd = ps_pic->ai4_wd[i];
99         ht = ps_pic->ai4_ht[i];
100         strd = ps_pic->ai4_strd[i];
101         pu1_buf = ps_pic->apu1_buf[i];
102 
103         for (j = 0; j < ht; j++)
104         {
105             memset(pu1_buf, val, wd);
106             pu1_buf += strd;
107         }
108 
109     }
110 }
111