-static ALWAYS_INLINE void x264_macroblock_cache_rect1( void *dst, int width, int height, uint8_t val )
-{
- if( width == 4 )
- {
- uint32_t val2 = val * 0x01010101;
- ((uint32_t*)dst)[0] = val2;
- if( height >= 2 ) ((uint32_t*)dst)[2] = val2;
- if( height == 4 ) ((uint32_t*)dst)[4] = val2;
- if( height == 4 ) ((uint32_t*)dst)[6] = val2;
- }
- else // 2
- {
- uint32_t val2 = val * 0x0101;
- ((uint16_t*)dst)[ 0] = val2;
- if( height >= 2 ) ((uint16_t*)dst)[ 4] = val2;
- if( height == 4 ) ((uint16_t*)dst)[ 8] = val2;
- if( height == 4 ) ((uint16_t*)dst)[12] = val2;
- }
-}
-static ALWAYS_INLINE void x264_macroblock_cache_rect4( void *dst, int width, int height, uint32_t val )
-{
- int dy;
- if( width == 1 || WORD_SIZE < 8 )
- {
- for( dy = 0; dy < height; dy++ )
- {
- ((uint32_t*)dst)[8*dy+0] = val;
- if( width >= 2 ) ((uint32_t*)dst)[8*dy+1] = val;
- if( width == 4 ) ((uint32_t*)dst)[8*dy+2] = val;
- if( width == 4 ) ((uint32_t*)dst)[8*dy+3] = val;
- }
- }
- else
- {
- uint64_t val64 = val + ((uint64_t)val<<32);
- for( dy = 0; dy < height; dy++ )
- {
- ((uint64_t*)dst)[4*dy+0] = val64;
- if( width == 4 ) ((uint64_t*)dst)[4*dy+1] = val64;
- }
- }
-}
-#define x264_macroblock_cache_mv_ptr(a,x,y,w,h,l,mv) x264_macroblock_cache_mv(a,x,y,w,h,l,*(uint32_t*)mv)
-static ALWAYS_INLINE void x264_macroblock_cache_mv( x264_t *h, int x, int y, int width, int height, int i_list, uint32_t mv )
-{
- x264_macroblock_cache_rect4( &h->mb.cache.mv[i_list][X264_SCAN8_0+x+8*y], width, height, mv );
-}
-static ALWAYS_INLINE void x264_macroblock_cache_mvd( x264_t *h, int x, int y, int width, int height, int i_list, uint32_t mv )
-{
- x264_macroblock_cache_rect4( &h->mb.cache.mvd[i_list][X264_SCAN8_0+x+8*y], width, height, mv );
-}
-static ALWAYS_INLINE void x264_macroblock_cache_ref( x264_t *h, int x, int y, int width, int height, int i_list, uint8_t ref )
-{
- x264_macroblock_cache_rect1( &h->mb.cache.ref[i_list][X264_SCAN8_0+x+8*y], width, height, ref );
-}
-static ALWAYS_INLINE void x264_macroblock_cache_skip( x264_t *h, int x, int y, int width, int height, int b_skip )
-{
- x264_macroblock_cache_rect1( &h->mb.cache.skip[X264_SCAN8_0+x+8*y], width, height, b_skip );
-}
-static ALWAYS_INLINE void x264_macroblock_cache_intra8x8_pred( x264_t *h, int x, int y, int i_mode )
-{
- int8_t *cache = &h->mb.cache.intra4x4_pred_mode[X264_SCAN8_0+x+8*y];
- cache[0] = cache[1] = cache[8] = cache[9] = i_mode;
-}
-#define array_non_zero(a) array_non_zero_int(a, sizeof(a))
-#define array_non_zero_int array_non_zero_int_c
-static ALWAYS_INLINE int array_non_zero_int_c( void *v, int i_count )