@ -192,43 +192,66 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, i
}
}
static void FUNCC ( add_pixels8 ) ( uint8_t * restrict _pixels , DCTELEM * _block , int line_size )
{
int i ;
pixel * restrict pixels = ( pixel * restrict ) _pixels ;
dctcoef * block = ( dctcoef * ) _block ;
line_size / = sizeof ( pixel ) ;
for ( i = 0 ; i < 8 ; i + + ) {
pixels [ 0 ] + = block [ 0 ] ;
pixels [ 1 ] + = block [ 1 ] ;
pixels [ 2 ] + = block [ 2 ] ;
pixels [ 3 ] + = block [ 3 ] ;
pixels [ 4 ] + = block [ 4 ] ;
pixels [ 5 ] + = block [ 5 ] ;
pixels [ 6 ] + = block [ 6 ] ;
pixels [ 7 ] + = block [ 7 ] ;
pixels + = line_size ;
block + = 8 ;
}
# define DCTELEM_FUNCS(dctcoef, suffix) \
static void FUNCC ( add_pixels8 # # suffix ) ( uint8_t * restrict _pixels , \
DCTELEM * _block , \
int line_size ) \
{ \
int i ; \
pixel * restrict pixels = ( pixel * restrict ) _pixels ; \
dctcoef * block = ( dctcoef * ) _block ; \
line_size / = sizeof ( pixel ) ; \
\
for ( i = 0 ; i < 8 ; i + + ) { \
pixels [ 0 ] + = block [ 0 ] ; \
pixels [ 1 ] + = block [ 1 ] ; \
pixels [ 2 ] + = block [ 2 ] ; \
pixels [ 3 ] + = block [ 3 ] ; \
pixels [ 4 ] + = block [ 4 ] ; \
pixels [ 5 ] + = block [ 5 ] ; \
pixels [ 6 ] + = block [ 6 ] ; \
pixels [ 7 ] + = block [ 7 ] ; \
pixels + = line_size ; \
block + = 8 ; \
} \
} \
\
static void FUNCC ( add_pixels4 # # suffix ) ( uint8_t * restrict _pixels , \
DCTELEM * _block , \
int line_size ) \
{ \
int i ; \
pixel * restrict pixels = ( pixel * restrict ) _pixels ; \
dctcoef * block = ( dctcoef * ) _block ; \
line_size / = sizeof ( pixel ) ; \
\
for ( i = 0 ; i < 4 ; i + + ) { \
pixels [ 0 ] + = block [ 0 ] ; \
pixels [ 1 ] + = block [ 1 ] ; \
pixels [ 2 ] + = block [ 2 ] ; \
pixels [ 3 ] + = block [ 3 ] ; \
pixels + = line_size ; \
block + = 4 ; \
} \
} \
\
static void FUNCC ( clear_block # # suffix ) ( DCTELEM * block ) \
{ \
memset ( block , 0 , sizeof ( dctcoef ) * 64 ) ; \
} \
\
/** \
* memset ( blocks , 0 , sizeof ( DCTELEM ) * 6 * 64 ) \
*/ \
static void FUNCC ( clear_blocks # # suffix ) ( DCTELEM * blocks ) \
{ \
memset ( blocks , 0 , sizeof ( dctcoef ) * 6 * 64 ) ; \
}
static void FUNCC ( add_pixels4 ) ( uint8_t * restrict _pixels , DCTELEM * _block , int line_size )
{
int i ;
pixel * restrict pixels = ( pixel * restrict ) _pixels ;
dctcoef * block = ( dctcoef * ) _block ;
line_size / = sizeof ( pixel ) ;
for ( i = 0 ; i < 4 ; i + + ) {
pixels [ 0 ] + = block [ 0 ] ;
pixels [ 1 ] + = block [ 1 ] ;
pixels [ 2 ] + = block [ 2 ] ;
pixels [ 3 ] + = block [ 3 ] ;
pixels + = line_size ;
block + = 4 ;
}
}
DCTELEM_FUNCS ( DCTELEM , _16 )
# if BIT_DEPTH > 8
DCTELEM_FUNCS ( dctcoef , _32 )
# endif
# define PIXOP2(OPNAME, OP) \
static void FUNCC ( OPNAME # # _pixels2 ) ( uint8_t * block , const uint8_t * pixels , int line_size , int h ) { \
@ -1231,16 +1254,3 @@ void FUNCC(ff_put_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
void FUNCC ( ff_avg_pixels16x16 ) ( uint8_t * dst , uint8_t * src , int stride ) {
FUNCC ( avg_pixels16 ) ( dst , src , stride , 16 ) ;
}
static void FUNCC ( clear_block ) ( DCTELEM * block )
{
memset ( block , 0 , sizeof ( dctcoef ) * 64 ) ;
}
/**
* memset ( blocks , 0 , sizeof ( DCTELEM ) * 6 * 64 )
*/
static void FUNCC ( clear_blocks ) ( DCTELEM * blocks )
{
memset ( blocks , 0 , sizeof ( dctcoef ) * 6 * 64 ) ;
}