1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
/*
* Copyright (C) 2007-2008 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* ----------------------------------------------------------------
*
*
* File Name: armVCM4P10_PredictIntraDC4x4.c
* OpenMAX DL: v1.0.2
* Revision: 9641
* Date: Thursday, February 7, 2008
*
*
*
*
* H.264 4x4 intra prediction module
*
*/
#include "omxtypes.h"
#include "armOMX.h"
#include "omxVC.h"
#include "armCOMM.h"
#include "armVC.h"
/*
* Description:
* Perform DC style intra prediction, averaging upper and left block
*
* Parameters:
* [in] pSrcLeft Pointer to the buffer of 16 left coefficients:
* p[x, y] (x = -1, y = 0..3)
* [in] pSrcAbove Pointer to the buffer of 16 above coefficients:
* p[x,y] (x = 0..3, y = -1)
* [in] leftStep Step of left coefficient buffer
* [in] dstStep Step of the destination buffer
* [in] availability Neighboring 16x16 MB availability flag
* [out] pDst Pointer to the destination buffer
*
* Return Value:
* None
*/
void armVCM4P10_PredictIntraDC4x4(
const OMX_U8* pSrcLeft,
const OMX_U8 *pSrcAbove,
OMX_U8* pDst,
OMX_INT leftStep,
OMX_INT dstStep,
OMX_S32 availability
)
{
int x, y, Sum=0, Count = 0;
if (availability & OMX_VC_LEFT)
{
for (y=0; y<4; y++)
{
Sum += pSrcLeft[y*leftStep];
}
Count++;
}
if (availability & OMX_VC_UPPER)
{
for (x=0; x<4; x++)
{
Sum += pSrcAbove[x];
}
Count++;
}
if (Count==0)
{
Sum = 128;
}
else if (Count==1)
{
Sum = (Sum + 2) >> 2;
}
else /* Count = 2 */
{
Sum = (Sum + 4) >> 3;
}
for (y=0; y<4; y++)
{
for (x=0; x<4; x++)
{
pDst[y*dstStep+x] = (OMX_U8)Sum;
}
}
}
|