comparison h264.c @ 11285:613370892df2 libavcodec

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)
author michael
date Thu, 25 Feb 2010 14:02:39 +0000
parents 853e93a50fe5
children db94c9bc5694
comparison
equal deleted inserted replaced
11284:aaca4b58880f 11285:613370892df2
50 static const uint8_t div6[52]={ 50 static const uint8_t div6[52]={
51 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 51 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
52 }; 52 };
53 53
54 void ff_h264_write_back_intra_pred_mode(H264Context *h){ 54 void ff_h264_write_back_intra_pred_mode(H264Context *h){
55 const int mb_xy= h->mb_xy; 55 int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[h->mb_xy];
56 56
57 h->intra4x4_pred_mode[mb_xy][0]= h->intra4x4_pred_mode_cache[7+8*1]; 57 mode[0]= h->intra4x4_pred_mode_cache[7+8*1];
58 h->intra4x4_pred_mode[mb_xy][1]= h->intra4x4_pred_mode_cache[7+8*2]; 58 mode[1]= h->intra4x4_pred_mode_cache[7+8*2];
59 h->intra4x4_pred_mode[mb_xy][2]= h->intra4x4_pred_mode_cache[7+8*3]; 59 mode[2]= h->intra4x4_pred_mode_cache[7+8*3];
60 h->intra4x4_pred_mode[mb_xy][3]= h->intra4x4_pred_mode_cache[7+8*4]; 60 mode[3]= h->intra4x4_pred_mode_cache[7+8*4];
61 h->intra4x4_pred_mode[mb_xy][4]= h->intra4x4_pred_mode_cache[4+8*4]; 61 mode[4]= h->intra4x4_pred_mode_cache[4+8*4];
62 h->intra4x4_pred_mode[mb_xy][5]= h->intra4x4_pred_mode_cache[5+8*4]; 62 mode[5]= h->intra4x4_pred_mode_cache[5+8*4];
63 h->intra4x4_pred_mode[mb_xy][6]= h->intra4x4_pred_mode_cache[6+8*4]; 63 mode[6]= h->intra4x4_pred_mode_cache[6+8*4];
64 } 64 }
65 65
66 /** 66 /**
67 * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks. 67 * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
68 */ 68 */