summaryrefslogtreecommitdiff
path: root/libavcodec/h264.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-25 14:02:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-25 14:02:39 +0000
commit5b0fb5244d3fb7758521c6988abdc26879c57968 (patch)
tree34e5f5e9da6a65b700b0669a3192b5dc170cebf3 /libavcodec/h264.h
parentc2186cbddcc8e13608bc2243785b4dbc02700ac3 (diff)
Store intra4x4_pred_mode per row only.
about 5 cpu cycles slower in the local code but should be overall faster due to reduced cache use. (my sample though has too few intra4x4 blocks for this to be meassureable easily either way) Originally committed as revision 22052 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r--libavcodec/h264.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index f443554f3e..cded523ed6 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -298,7 +298,7 @@ typedef struct H264Context{
int topleft_partition;
int8_t intra4x4_pred_mode_cache[5*8];
- int8_t (*intra4x4_pred_mode)[8];
+ int8_t (*intra4x4_pred_mode);
H264PredContext hpc;
unsigned int topleft_samples_available;
unsigned int top_samples_available;
@@ -886,10 +886,11 @@ static void fill_decode_caches(H264Context *h, int mb_type){
if(IS_INTRA4x4(mb_type)){
if(IS_INTRA4x4(top_type)){
- h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode[top_xy][4];
- h->intra4x4_pred_mode_cache[5+8*0]= h->intra4x4_pred_mode[top_xy][5];
- h->intra4x4_pred_mode_cache[6+8*0]= h->intra4x4_pred_mode[top_xy][6];
- h->intra4x4_pred_mode_cache[7+8*0]= h->intra4x4_pred_mode[top_xy][3];
+ int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[top_xy];
+ h->intra4x4_pred_mode_cache[4+8*0]= mode[4];
+ h->intra4x4_pred_mode_cache[5+8*0]= mode[5];
+ h->intra4x4_pred_mode_cache[6+8*0]= mode[6];
+ h->intra4x4_pred_mode_cache[7+8*0]= mode[3];
}else{
int pred;
if(!(top_type & type_mask))
@@ -904,8 +905,9 @@ static void fill_decode_caches(H264Context *h, int mb_type){
}
for(i=0; i<2; i++){
if(IS_INTRA4x4(left_type[i])){
- h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[0+2*i]];
- h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[1+2*i]];
+ int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]];
+ h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[left_block[0+2*i]];
+ h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[left_block[1+2*i]];
}else{
int pred;
if(!(left_type[i] & type_mask))