diff --git a/src/inter.c b/src/inter.c index 862c0071..19bba5eb 100644 --- a/src/inter.c +++ b/src/inter.c @@ -72,10 +72,10 @@ void inter_recon_frac_luma(const encoder_state_t * const state, const kvz_pictur #define FILTER_SIZE_Y 8 //Luma filter size // Fractional luma 1/4-pel - extended_block src = {0, 0, 0}; + kvz_extended_block src = {0, 0, 0}; // Fractional luma - extend_borders(xpos, ypos, mv_param[0] >> 2, mv_param[1] >> 2, state->tile->lcu_offset_x * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH, + get_extended_block(xpos, ypos, mv_param[0] >> 2, mv_param[1] >> 2, state->tile->lcu_offset_x * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH, ref->y, ref->width, ref->height, FILTER_SIZE_Y, block_width, block_width, &src); sample_quarterpel_luma_generic(state->encoder_control, src.orig_topleft, src.stride, block_width, block_width, lcu->rec.y + (ypos%LCU_WIDTH)*LCU_WIDTH + (xpos%LCU_WIDTH), LCU_WIDTH, mv_frac_x, mv_frac_y, mv_param); @@ -91,10 +91,10 @@ void inter_recon_14bit_frac_luma(const encoder_state_t * const state, const kvz_ #define FILTER_SIZE_Y 8 //Luma filter size // Fractional luma 1/4-pel - extended_block src = {0, 0, 0}; + kvz_extended_block src = { 0, 0, 0 }; // Fractional luma - extend_borders(xpos, ypos, mv_param[0] >> 2, mv_param[1] >> 2, state->tile->lcu_offset_x * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH, + get_extended_block(xpos, ypos, mv_param[0] >> 2, mv_param[1] >> 2, state->tile->lcu_offset_x * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH, ref->y, ref->width, ref->height, FILTER_SIZE_Y, block_width, block_width, &src); sample_14bit_quarterpel_luma_generic(state->encoder_control, src.orig_topleft, src.stride, block_width, block_width, hi_prec_out->y + (ypos%LCU_WIDTH)*LCU_WIDTH + (xpos%LCU_WIDTH), LCU_WIDTH, mv_frac_x, mv_frac_y, mv_param); @@ -115,17 +115,17 @@ void inter_recon_frac_chroma(const encoder_state_t * const state, const kvz_pict #define FILTER_SIZE_C 4 //Chroma filter size // Fractional chroma 1/8-pel - extended_block src_u = { 0, 0, 0 }; - extended_block src_v = { 0, 0, 0 }; + kvz_extended_block src_u = { 0, 0, 0 }; + kvz_extended_block src_v = { 0, 0, 0 }; //Fractional chroma U - extend_borders(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, + get_extended_block(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, ref->u, ref->width >> 1, ref->height >> 1, FILTER_SIZE_C, block_width, block_width, &src_u); sample_octpel_chroma_generic(state->encoder_control, src_u.orig_topleft, src_u.stride, block_width, block_width, lcu->rec.u + (ypos % LCU_WIDTH_C)*LCU_WIDTH_C + (xpos % LCU_WIDTH_C), LCU_WIDTH_C, mv_frac_x, mv_frac_y, mv_param); //Fractional chroma V - extend_borders(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, + get_extended_block(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, ref->v, ref->width >> 1, ref->height >> 1, FILTER_SIZE_C, block_width, block_width, &src_v); sample_octpel_chroma_generic(state->encoder_control, src_v.orig_topleft, src_u.stride, block_width, block_width, lcu->rec.v + (ypos % LCU_WIDTH_C)*LCU_WIDTH_C + (xpos % LCU_WIDTH_C), LCU_WIDTH_C, mv_frac_x, mv_frac_y, mv_param); @@ -147,17 +147,17 @@ void inter_recon_14bit_frac_chroma(const encoder_state_t * const state, const kv #define FILTER_SIZE_C 4 //Chroma filter size // Fractional chroma 1/8-pel - extended_block src_u = {0, 0, 0}; - extended_block src_v = { 0, 0, 0 }; + kvz_extended_block src_u = { 0, 0, 0 }; + kvz_extended_block src_v = { 0, 0, 0 }; //Fractional chroma U - extend_borders(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, + get_extended_block(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, ref->u, ref->width >> 1, ref->height >> 1, FILTER_SIZE_C, block_width, block_width, &src_u); sample_14bit_octpel_chroma_generic(state->encoder_control, src_u.orig_topleft, src_u.stride, block_width, block_width, hi_prec_out->u + (ypos % LCU_WIDTH_C)*LCU_WIDTH_C + (xpos % LCU_WIDTH_C), LCU_WIDTH_C, mv_frac_x, mv_frac_y, mv_param); //Fractional chroma V - extend_borders(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, + get_extended_block(xpos, ypos, (mv_param[0] >> 2) >> 1, (mv_param[1] >> 2) >> 1, state->tile->lcu_offset_x * LCU_WIDTH_C, state->tile->lcu_offset_y * LCU_WIDTH_C, ref->v, ref->width >> 1, ref->height >> 1, FILTER_SIZE_C, block_width, block_width, &src_v); sample_14bit_octpel_chroma_generic(state->encoder_control, src_v.orig_topleft, src_v.stride, block_width, block_width, hi_prec_out->v + (ypos % LCU_WIDTH_C)*LCU_WIDTH_C + (xpos % LCU_WIDTH_C), LCU_WIDTH_C, mv_frac_x, mv_frac_y, mv_param); diff --git a/src/search_inter.c b/src/search_inter.c index 2c6f5812..642bbd3d 100644 --- a/src/search_inter.c +++ b/src/search_inter.c @@ -815,14 +815,14 @@ static unsigned search_frac(const encoder_state_t * const state, #define FILTER_SIZE 8 #define HALF_FILTER (FILTER_SIZE>>1) - extended_block src = {0, 0, 0}; + kvz_extended_block src = { 0, 0, 0 }; //destination buffer for interpolation int dst_stride = (block_width+1)*4; kvz_pixel dst[(LCU_WIDTH+1) * (LCU_WIDTH+1) * 16]; kvz_pixel* dst_off = &dst[dst_stride*4+4]; - extend_borders(orig->x, orig->y, mv.x-1, mv.y-1, + get_extended_block(orig->x, orig->y, mv.x-1, mv.y-1, state->tile->lcu_offset_x * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH, ref->y, ref->width, ref->height, FILTER_SIZE, block_width+1, block_width+1, &src); diff --git a/src/strategies/avx2/ipol-avx2.c b/src/strategies/avx2/ipol-avx2.c index 40798206..77fee78f 100644 --- a/src/strategies/avx2/ipol-avx2.c +++ b/src/strategies/avx2/ipol-avx2.c @@ -481,8 +481,8 @@ void filter_inter_octpel_chroma_avx2(const encoder_control_t * const encoder, kv } } -void extend_borders_avx2(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, - int filterSize, int width, int height, extended_block *out) { +void get_extended_block_avx2(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, + int filterSize, int width, int height, kvz_extended_block *out) { int halfFilterSize = filterSize >> 1; @@ -543,7 +543,7 @@ int strategy_register_ipol_avx2(void* opaque, uint8_t bitdepth) success &= strategyselector_register(opaque, "filter_inter_halfpel_chroma", "avx2", 40, &filter_inter_halfpel_chroma_avx2); success &= strategyselector_register(opaque, "filter_inter_octpel_chroma", "avx2", 40, &filter_inter_octpel_chroma_avx2); } - success &= strategyselector_register(opaque, "extend_borders", "avx2", 40, &extend_borders_avx2); + success &= strategyselector_register(opaque, "get_extended_block", "avx2", 40, &get_extended_block_avx2); #endif //COMPILE_INTEL_AVX2 return success; } diff --git a/src/strategies/generic/ipol-generic.c b/src/strategies/generic/ipol-generic.c index 166b2fb2..43416f5f 100644 --- a/src/strategies/generic/ipol-generic.c +++ b/src/strategies/generic/ipol-generic.c @@ -482,8 +482,8 @@ void sample_14bit_octpel_chroma_generic(const encoder_control_t * const encoder, } -void extend_borders_generic(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, - int filterSize, int width, int height, extended_block *out) { +void get_extended_block_generic(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, + int filterSize, int width, int height, kvz_extended_block *out) { int halfFilterSize = filterSize >> 1; @@ -541,7 +541,7 @@ int strategy_register_ipol_generic(void* opaque, uint8_t bitdepth) success &= strategyselector_register(opaque, "filter_inter_quarterpel_luma", "generic", 0, &filter_inter_quarterpel_luma_generic); success &= strategyselector_register(opaque, "filter_inter_halfpel_chroma", "generic", 0, &filter_inter_halfpel_chroma_generic); success &= strategyselector_register(opaque, "filter_inter_octpel_chroma", "generic", 0, &filter_inter_octpel_chroma_generic); - success &= strategyselector_register(opaque, "extend_borders", "generic", 0, &extend_borders_generic); + success &= strategyselector_register(opaque, "get_extended_block", "generic", 0, &get_extended_block_generic); return success; } diff --git a/src/strategies/strategies-ipol.c b/src/strategies/strategies-ipol.c index ec0e8fdc..92f5c7d7 100644 --- a/src/strategies/strategies-ipol.c +++ b/src/strategies/strategies-ipol.c @@ -25,7 +25,7 @@ ipol_func *filter_inter_quarterpel_luma; ipol_func *filter_inter_halfpel_chroma; ipol_func *filter_inter_octpel_chroma; -epol_func *extend_borders; +epol_func *get_extended_block; // Headers for platform optimizations. #include "generic/ipol-generic.h" diff --git a/src/strategies/strategies-ipol.h b/src/strategies/strategies-ipol.h index 1fe3514b..e6765c6c 100644 --- a/src/strategies/strategies-ipol.h +++ b/src/strategies/strategies-ipol.h @@ -24,20 +24,20 @@ #include "encoder.h" -typedef struct { kvz_pixel *buffer; kvz_pixel *orig_topleft; unsigned stride; unsigned malloc_used; } extended_block; +typedef struct { kvz_pixel *buffer; kvz_pixel *orig_topleft; unsigned stride; unsigned malloc_used; } kvz_extended_block; typedef unsigned(ipol_func)(const encoder_control_t * encoder, kvz_pixel *src, int16_t src_stride, int width, int height, kvz_pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag); typedef unsigned(epol_func)(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, - int filterSize, int width, int height, extended_block *out); + int filterSize, int width, int height, kvz_extended_block *out); // Declare function pointers. extern ipol_func * filter_inter_quarterpel_luma; extern ipol_func * filter_inter_halfpel_chroma; extern ipol_func * filter_inter_octpel_chroma; -extern epol_func * extend_borders; +extern epol_func * get_extended_block; int strategy_register_ipol(void* opaque, uint8_t bitdepth); @@ -47,7 +47,7 @@ int strategy_register_ipol(void* opaque, uint8_t bitdepth); {"filter_inter_quarterpel_luma", (void**) &filter_inter_quarterpel_luma}, \ {"filter_inter_halfpel_chroma", (void**) &filter_inter_halfpel_chroma}, \ {"filter_inter_octpel_chroma", (void**) &filter_inter_octpel_chroma}, \ - {"extend_borders", (void**) &extend_borders}, \ + {"get_extended_block", (void**) &get_extended_block}, \