3 


4 
cbpFuncPtr calc_cbp; 
cbpFuncPtr calc_cbp; 
5 


6 

/* 
7 

* Returns a field of bits that indicates non zero ac blocks 
8 

* for this macro block 
9 

*/ 
10 
uint32_t calc_cbp_c(const int16_t codes[6][64]) 
uint32_t calc_cbp_c(const int16_t codes[6][64]) 
11 
{ 
{ 
12 
uint32_t i, j; 
uint32_t i, j; 
13 
uint32_t cbp = 0; 
uint32_t cbp = 0; 
14 


15 
for (i = 0; i < 6; i++) { 
for (i = 0; i < 6; i++) { 
16 
for (j = 1; j < 64/4; j+=4) { 
for (j = 1; j < 61; j+=4) { 
17 
if (codes[i][j] codes[i][j+1] 
if (codes[i][j] codes[i][j+1] 
18 
codes[i][j+2]codes[i][j+3]) { 
codes[i][j+2]codes[i][j+3]) { 
19 
cbp = 1 << (5  i); 
cbp = 1 << (5  i); 
20 
break; 
break; 
21 
} 
} 
22 
} 
} 
23 


24 

if(codes[i][j]codes[i][j+1]codes[i][j+2]) 
25 

cbp = 1 << (5  i); 
26 


27 
} 
} 
28 


29 
return cbp; 
return cbp; 
30 


31 
} 
} 