Rename extend_borders to get_extended_block. Add kvz_ prefix to type definition.

This commit is contained in:
Ari Lemmetti 2015-08-17 11:12:49 +03:00
parent d82582c37c
commit 6a5eaf08de
6 changed files with 25 additions and 25 deletions

View file

@ -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 #define FILTER_SIZE_Y 8 //Luma filter size
// Fractional luma 1/4-pel // Fractional luma 1/4-pel
extended_block src = {0, 0, 0}; kvz_extended_block src = {0, 0, 0};
// Fractional luma // 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); 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, 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); 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 #define FILTER_SIZE_Y 8 //Luma filter size
// Fractional luma 1/4-pel // Fractional luma 1/4-pel
extended_block src = {0, 0, 0}; kvz_extended_block src = { 0, 0, 0 };
// Fractional luma // 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); 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, 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); 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 #define FILTER_SIZE_C 4 //Chroma filter size
// Fractional chroma 1/8-pel // Fractional chroma 1/8-pel
extended_block src_u = { 0, 0, 0 }; kvz_extended_block src_u = { 0, 0, 0 };
extended_block src_v = { 0, 0, 0 }; kvz_extended_block src_v = { 0, 0, 0 };
//Fractional chroma U //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); 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, 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); 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 //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); 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, 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); 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 #define FILTER_SIZE_C 4 //Chroma filter size
// Fractional chroma 1/8-pel // Fractional chroma 1/8-pel
extended_block src_u = {0, 0, 0}; kvz_extended_block src_u = { 0, 0, 0 };
extended_block src_v = { 0, 0, 0 }; kvz_extended_block src_v = { 0, 0, 0 };
//Fractional chroma U //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); 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, 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); 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 //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); 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, 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); 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);

View file

@ -815,14 +815,14 @@ static unsigned search_frac(const encoder_state_t * const state,
#define FILTER_SIZE 8 #define FILTER_SIZE 8
#define HALF_FILTER (FILTER_SIZE>>1) #define HALF_FILTER (FILTER_SIZE>>1)
extended_block src = {0, 0, 0}; kvz_extended_block src = { 0, 0, 0 };
//destination buffer for interpolation //destination buffer for interpolation
int dst_stride = (block_width+1)*4; int dst_stride = (block_width+1)*4;
kvz_pixel dst[(LCU_WIDTH+1) * (LCU_WIDTH+1) * 16]; kvz_pixel dst[(LCU_WIDTH+1) * (LCU_WIDTH+1) * 16];
kvz_pixel* dst_off = &dst[dst_stride*4+4]; 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_x * LCU_WIDTH,
state->tile->lcu_offset_y * LCU_WIDTH, state->tile->lcu_offset_y * LCU_WIDTH,
ref->y, ref->width, ref->height, FILTER_SIZE, block_width+1, block_width+1, &src); ref->y, ref->width, ref->height, FILTER_SIZE, block_width+1, block_width+1, &src);

View file

@ -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, 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, extended_block *out) { int filterSize, int width, int height, kvz_extended_block *out) {
int halfFilterSize = filterSize >> 1; 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_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, "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 #endif //COMPILE_INTEL_AVX2
return success; return success;
} }

View file

@ -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, 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, extended_block *out) { int filterSize, int width, int height, kvz_extended_block *out) {
int halfFilterSize = filterSize >> 1; 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_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_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, "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; return success;
} }

View file

@ -25,7 +25,7 @@
ipol_func *filter_inter_quarterpel_luma; ipol_func *filter_inter_quarterpel_luma;
ipol_func *filter_inter_halfpel_chroma; ipol_func *filter_inter_halfpel_chroma;
ipol_func *filter_inter_octpel_chroma; ipol_func *filter_inter_octpel_chroma;
epol_func *extend_borders; epol_func *get_extended_block;
// Headers for platform optimizations. // Headers for platform optimizations.
#include "generic/ipol-generic.h" #include "generic/ipol-generic.h"

View file

@ -24,20 +24,20 @@
#include "encoder.h" #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, 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); 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, 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. // Declare function pointers.
extern ipol_func * filter_inter_quarterpel_luma; extern ipol_func * filter_inter_quarterpel_luma;
extern ipol_func * filter_inter_halfpel_chroma; extern ipol_func * filter_inter_halfpel_chroma;
extern ipol_func * filter_inter_octpel_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); 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_quarterpel_luma", (void**) &filter_inter_quarterpel_luma}, \
{"filter_inter_halfpel_chroma", (void**) &filter_inter_halfpel_chroma}, \ {"filter_inter_halfpel_chroma", (void**) &filter_inter_halfpel_chroma}, \
{"filter_inter_octpel_chroma", (void**) &filter_inter_octpel_chroma}, \ {"filter_inter_octpel_chroma", (void**) &filter_inter_octpel_chroma}, \
{"extend_borders", (void**) &extend_borders}, \ {"get_extended_block", (void**) &get_extended_block}, \