Mercurial > libavcodec.hg
comparison h264.c @ 2471:805431763e84 libavcodec
fixing missaligned memory accesses in fill_rectangle()
author | michael |
---|---|
date | Sun, 30 Jan 2005 02:16:50 +0000 |
parents | 300f1207768d |
children | a3188eb4266c |
comparison
equal
deleted
inserted
replaced
2470:06aafb585f69 | 2471:805431763e84 |
---|---|
180 | 180 |
181 /** | 181 /** |
182 * non zero coeff count cache. | 182 * non zero coeff count cache. |
183 * is 64 if not available. | 183 * is 64 if not available. |
184 */ | 184 */ |
185 uint8_t non_zero_count_cache[6*8]; | 185 uint8_t non_zero_count_cache[6*8] __align8; |
186 uint8_t (*non_zero_count)[16]; | 186 uint8_t (*non_zero_count)[16]; |
187 | 187 |
188 /** | 188 /** |
189 * Motion vector cache. | 189 * Motion vector cache. |
190 */ | 190 */ |
191 int16_t mv_cache[2][5*8][2]; | 191 int16_t mv_cache[2][5*8][2] __align8; |
192 int8_t ref_cache[2][5*8]; | 192 int8_t ref_cache[2][5*8] __align8; |
193 #define LIST_NOT_USED -1 //FIXME rename? | 193 #define LIST_NOT_USED -1 //FIXME rename? |
194 #define PART_NOT_AVAILABLE -2 | 194 #define PART_NOT_AVAILABLE -2 |
195 | 195 |
196 /** | 196 /** |
197 * is 1 if the specific list MV&references are set to 0,0,-2. | 197 * is 1 if the specific list MV&references are set to 0,0,-2. |
316 int left_cbp; | 316 int left_cbp; |
317 /* chroma_pred_mode for i4x4 or i16x16, else 0 */ | 317 /* chroma_pred_mode for i4x4 or i16x16, else 0 */ |
318 uint8_t *chroma_pred_mode_table; | 318 uint8_t *chroma_pred_mode_table; |
319 int last_qscale_diff; | 319 int last_qscale_diff; |
320 int16_t (*mvd_table[2])[2]; | 320 int16_t (*mvd_table[2])[2]; |
321 int16_t mvd_cache[2][5*8][2]; | 321 int16_t mvd_cache[2][5*8][2] __align8; |
322 uint8_t *direct_table; | 322 uint8_t *direct_table; |
323 uint8_t direct_cache[5*8]; | 323 uint8_t direct_cache[5*8]; |
324 | 324 |
325 }H264Context; | 325 }H264Context; |
326 | 326 |
356 assert(size==1 || size==4); | 356 assert(size==1 || size==4); |
357 | 357 |
358 w *= size; | 358 w *= size; |
359 stride *= size; | 359 stride *= size; |
360 | 360 |
361 assert((((int)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0); | |
361 //FIXME check what gcc generates for 64 bit on x86 and possible write a 32 bit ver of it | 362 //FIXME check what gcc generates for 64 bit on x86 and possible write a 32 bit ver of it |
362 if(w==2 && h==2){ | 363 if(w==2 && h==2){ |
363 *(uint16_t*)(p + 0)= | 364 *(uint16_t*)(p + 0)= |
364 *(uint16_t*)(p + stride)= size==4 ? val : val*0x0101; | 365 *(uint16_t*)(p + stride)= size==4 ? val : val*0x0101; |
365 }else if(w==2 && h==4){ | 366 }else if(w==2 && h==4){ |