blob: 9268c01b531750f0120a49c3240403fd11c7d754 [file] [log] [blame]
Venkatarama Avadhaniaed24ee2015-03-11 10:08:57 +05301/******************************************************************************
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* impeg2_utils.c
24*
25* @brief
26* Contains utility function definitions for MPEG2 codec
27*
28* @author
29* Harish
30*
31* @par List of Functions:
32* - impeg2_memset0_16bit_8x8_linear_block()
33* - impeg2_memset_8bit_8x8_block()
34*
35* @remarks
36* None
37*
38*******************************************************************************
39*/
40
41#include <stdio.h>
42#include <string.h>
43#include "iv_datatypedef.h"
44#include "impeg2_defs.h"
45
46/*******************************************************************************
47* Function Name : impeg2_memset0_16bit_8x8_linear_block
48*
49* Description : memsets resudial buf to 0
50*
51* Arguments : destination buffer
52*
53* Values Returned : None
54*******************************************************************************/
55
56
57void impeg2_memset0_16bit_8x8_linear_block (WORD16 *pi2_buf)
58{
59 memset(pi2_buf,0,64 * sizeof(WORD16));
60}
61
62
63
64/*******************************************************************************
65* Function Name : impeg2_memset_8bit_8x8_block
66*
67* Description : memsets residual buf to value
68*
69* Arguments : destination buffer, value and stride
70*
71* Values Returned : None
72*******************************************************************************/
73
74
75void impeg2_memset_8bit_8x8_block(UWORD8 *pu1_dst, WORD32 u4_dc_val, WORD32 u4_dst_wd)
76{
77 WORD32 j;
78
79 for(j = BLK_SIZE; j > 0; j--)
80 {
81 memset(pu1_dst, u4_dc_val, BLK_SIZE);
82 pu1_dst += u4_dst_wd;
83 }
84}
85
86
87