/*****************************************************************************
* macroblock.h: macroblock common functions
*****************************************************************************
- * Copyright (C) 2005-2011 x264 project
+ * Copyright (C) 2005-2012 x264 project
*
* Authors: Loren Merritt <lorenm@u.washington.edu>
* Laurent Aimar <fenrir@via.ecp.fr>
enum cabac_ctx_block_cat_e
{
- DCT_LUMA_DC = 0,
- DCT_LUMA_AC = 1,
- DCT_LUMA_4x4 = 2,
- DCT_CHROMA_DC = 3,
- DCT_CHROMA_AC = 4,
- DCT_LUMA_8x8 = 5,
+ DCT_LUMA_DC = 0,
+ DCT_LUMA_AC = 1,
+ DCT_LUMA_4x4 = 2,
+ DCT_CHROMA_DC = 3,
+ DCT_CHROMA_AC = 4,
+ DCT_LUMA_8x8 = 5,
+ DCT_CHROMAU_DC = 6,
+ DCT_CHROMAU_AC = 7,
+ DCT_CHROMAU_4x4 = 8,
+ DCT_CHROMAU_8x8 = 9,
+ DCT_CHROMAV_DC = 10,
+ DCT_CHROMAV_AC = 11,
+ DCT_CHROMAV_4x4 = 12,
+ DCT_CHROMAV_8x8 = 13,
+};
+
+static const uint8_t ctx_cat_plane[6][3] =
+{
+ { DCT_LUMA_DC, DCT_CHROMAU_DC, DCT_CHROMAV_DC},
+ { DCT_LUMA_AC, DCT_CHROMAU_AC, DCT_CHROMAV_AC},
+ {DCT_LUMA_4x4, DCT_CHROMAU_4x4, DCT_CHROMAV_4x4},
+ {0},
+ {0},
+ {DCT_LUMA_8x8, DCT_CHROMAU_8x8, DCT_CHROMAV_8x8}
};
/* Per-frame allocation: is allocated per-thread only in frame-threads mode. */
void x264_macroblock_slice_init( x264_t *h );
void x264_macroblock_thread_init( x264_t *h );
-void x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y );
-void x264_macroblock_cache_load_deblock( x264_t *h );
-void x264_macroblock_cache_load_neighbours_deblock( x264_t *h, int mb_x, int mb_y );
+void x264_macroblock_cache_load_progressive( x264_t *h, int mb_x, int mb_y );
+void x264_macroblock_cache_load_interlaced( x264_t *h, int mb_x, int mb_y );
+void x264_macroblock_deblock_strength( x264_t *h );
void x264_macroblock_cache_save( x264_t *h );
void x264_macroblock_bipred_init( x264_t *h );
void x264_mb_mc( x264_t *h );
void x264_mb_mc_8x8( x264_t *h, int i8 );
-static ALWAYS_INLINE uint32_t pack16to32( int a, int b )
+static ALWAYS_INLINE uint32_t pack16to32( uint32_t a, uint32_t b )
{
#if WORDS_BIGENDIAN
return b + (a<<16);
return a + (b<<16);
#endif
}
-static ALWAYS_INLINE uint32_t pack8to16( int a, int b )
+static ALWAYS_INLINE uint32_t pack8to16( uint32_t a, uint32_t b )
{
#if WORDS_BIGENDIAN
return b + (a<<8);
return a + (b<<8);
#endif
}
-static ALWAYS_INLINE uint32_t pack8to32( int a, int b, int c, int d )
+static ALWAYS_INLINE uint32_t pack8to32( uint32_t a, uint32_t b, uint32_t c, uint32_t d )
{
#if WORDS_BIGENDIAN
return d + (c<<8) + (b<<16) + (a<<24);
# define pack_pixel_2to4 pack16to32
#endif
-#define array_non_zero(a) array_non_zero_int(a, sizeof(a)/sizeof(dctcoef))
-#define array_non_zero_int array_non_zero_int
-static ALWAYS_INLINE int array_non_zero_int( dctcoef *v, int i_count )
-{
- for( int i = 0; i < i_count; i++ )
- if( v[i] )
- return 1;
- return 0;
-}
static ALWAYS_INLINE int x264_mb_predict_intra4x4_mode( x264_t *h, int idx )
{
const int ma = h->mb.cache.intra4x4_pred_mode[x264_scan8[idx] - 1];