TUT HEVC Encoder
Loading...
Searching...
No Matches
picture-generic.c File Reference
Include dependency graph for picture-generic.c:

Macros

#define SATD_DUAL_NXN(n, pixel_type)
 
#define SATD_ANY_SIZE_MULTI_GENERIC(suffix, num_parallel_blocks)
 
#define SAD_NXN(n, pixel_type)
 
#define SAD_DUAL_NXN(n, pixel_type)
 

Functions

kvz_pixel kvz_fast_clip_16bit_to_pixel (int16_t value)
 
kvz_pixel kvz_fast_clip_32bit_to_pixel (int32_t value)
 
static unsigned reg_sad_generic (const kvz_pixel *const data1, const kvz_pixel *const data2, const int width, const int height, const unsigned stride1, const unsigned stride2)
 Calculate Sum of Absolute Differences (SAD)
 
static int32_t hadamard_4x4_generic (int32_t diff[4 *4])
 Transform differences between two 4x4 blocks.
 
static unsigned satd_4x4_generic (const kvz_pixel *piOrg, const kvz_pixel *piCur)
 Calculate SATD between two 4x4 blocks.
 
unsigned kvz_satd_4x4_subblock_generic (const kvz_pixel *buf1, const int32_t stride1, const kvz_pixel *buf2, const int32_t stride2)
 Calculate SATD between two 4x4 blocks inside bigger arrays.
 
void kvz_satd_4x4_subblock_quad_generic (const kvz_pixel *preds[4], const int stride, const kvz_pixel *orig, const int orig_stride, unsigned costs[4])
 
static unsigned satd_8x8_subblock_generic (const kvz_pixel *piOrg, const int32_t iStrideOrg, const kvz_pixel *piCur, const int32_t iStrideCur)
 Calculate SATD between two 8x8 blocks inside bigger arrays.
 
static void satd_8x8_subblock_quad_generic (const kvz_pixel **preds, const int stride, const kvz_pixel *orig, const int orig_stride, unsigned *costs)
 
 SATD_NxN (SATD_NxN(generic, 8)
 
static void satd_8x8_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void satd_16x16_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void satd_32x32_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void satd_64x64_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void satd_any_size_quad_generic (int width, int height, const kvz_pixel **preds, const int stride, const kvz_pixel *orig, const int orig_stride, unsigned num_modes, unsigned *costs_out, int8_t *valid)
 
static unsigned sad_4x4_generic (const kvz_pixel *const block1, const kvz_pixel *const block2)
 
static unsigned sad_8x8_generic (const kvz_pixel *const block1, const kvz_pixel *const block2)
 
static unsigned sad_16x16_generic (const kvz_pixel *const block1, const kvz_pixel *const block2)
 
static unsigned sad_32x32_generic (const kvz_pixel *const block1, const kvz_pixel *const block2)
 
static unsigned sad_64x64_generic (const kvz_pixel *const block1, const kvz_pixel *const block2)
 
static void sad_4x4_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void sad_8x8_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void sad_16x16_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void sad_32x32_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static void sad_64x64_dual_generic (const pred_buffer preds, const kvz_pixel *const orig, unsigned num_modes, unsigned *costs_out)
 
static unsigned pixels_calc_ssd_generic (const kvz_pixel *const ref, const kvz_pixel *const rec, const int ref_stride, const int rec_stride, const int width)
 
static void bipred_average_px_px (kvz_pixel *dst, kvz_pixel *px_L0, kvz_pixel *px_L1, unsigned pu_w, unsigned pu_h, unsigned dst_stride)
 
static void bipred_average_im_im (kvz_pixel *dst, kvz_pixel_im *im_L0, kvz_pixel_im *im_L1, unsigned pu_w, unsigned pu_h, unsigned dst_stride)
 
static void bipred_average_px_im (kvz_pixel *dst, kvz_pixel *px, kvz_pixel_im *im, unsigned pu_w, unsigned pu_h, unsigned dst_stride)
 
static void bipred_average_generic (lcu_t *const lcu, const yuv_t *const px_L0, const yuv_t *const px_L1, const yuv_im_t *const im_L0, const yuv_im_t *const im_L1, const unsigned pu_x, const unsigned pu_y, const unsigned pu_w, const unsigned pu_h, const unsigned im_flags_L0, const unsigned im_flags_L1, const bool predict_luma, const bool predict_chroma)
 
static optimized_sad_func_ptr_t get_optimized_sad_generic (int32_t width)
 
static uint32_t ver_sad_generic (const kvz_pixel *pic_data, const kvz_pixel *ref_data, int block_width, int block_height, unsigned pic_stride)
 Vertically interpolate SAD outside the frame.
 
static unsigned hor_sad (const kvz_pixel *pic_data, const kvz_pixel *ref_data, int block_width, int block_height, unsigned pic_stride, unsigned ref_stride)
 Horizontally interpolate SAD outside the frame.
 
static uint32_t hor_sad_generic (const kvz_pixel *pic_data, const kvz_pixel *ref_data, int32_t width, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right)
 
static double pixel_var_generic (const kvz_pixel *arr, const uint32_t len)
 
int kvz_strategy_register_picture_generic (void *opaque, uint8_t bitdepth)
 

Variables

static cost_pixel_any_size_multi_func satd_any_size_quad_generic
 
static cost_pixel_nxn_func sad_4x4_generic
 
static cost_pixel_nxn_func sad_8x8_generic
 
static cost_pixel_nxn_func sad_16x16_generic
 
static cost_pixel_nxn_func sad_32x32_generic
 
static cost_pixel_nxn_func sad_64x64_generic
 
static cost_pixel_nxn_multi_func sad_4x4_dual_generic
 
static cost_pixel_nxn_multi_func sad_8x8_dual_generic
 
static cost_pixel_nxn_multi_func sad_16x16_dual_generic
 
static cost_pixel_nxn_multi_func sad_32x32_dual_generic
 
static cost_pixel_nxn_multi_func sad_64x64_dual_generic
 

Macro Definition Documentation

◆ SAD_DUAL_NXN

#define SAD_DUAL_NXN ( n,
pixel_type )
Value:
static void sad_ ## n ## x ## n ## _dual_generic( \
const pred_buffer preds, const pixel_type * const orig, unsigned num_modes, unsigned *costs_out) \
{ \
unsigned i; \
unsigned sum = 0; \
for (i = 0; i < (n)*(n); ++i) { \
sum += abs(preds[0][i] - orig[i]); \
} \
costs_out[0] = sum>>(KVZ_BIT_DEPTH-8); \
\
sum = 0; \
for (i = 0; i < (n)*(n); ++i) { \
sum += abs(preds[1][i] - orig[i]); \
} \
costs_out[1] = sum>>(KVZ_BIT_DEPTH-8); \
}
#define KVZ_BIT_DEPTH
Definition kvazaar.h:91
kvz_pixel(* pred_buffer)[32 *32]
Definition strategies-picture.h:48

◆ SAD_NXN

#define SAD_NXN ( n,
pixel_type )
Value:
static unsigned sad_ ## n ## x ## n ## _generic( \
const pixel_type * const block1, const pixel_type * const block2) \
{ \
unsigned i; \
unsigned sum = 0; \
for (i = 0; i < (n)*(n); ++i) { \
sum += abs(block1[i] - block2[i]); \
} \
return sum>>(KVZ_BIT_DEPTH-8); \
}

◆ SATD_ANY_SIZE_MULTI_GENERIC

#define SATD_ANY_SIZE_MULTI_GENERIC ( suffix,
num_parallel_blocks )

◆ SATD_DUAL_NXN

#define SATD_DUAL_NXN ( n,
pixel_type )
Value:
static void satd_ ## n ## x ## n ## _dual_generic( \
const pred_buffer preds, const pixel_type * const orig, unsigned num_modes, unsigned *costs_out) \
{ \
unsigned x, y; \
unsigned sum = 0; \
for (y = 0; y < (n); y += 8) { \
unsigned row = y * (n); \
for (x = 0; x < (n); x += 8) { \
sum += satd_8x8_subblock_generic(&preds[0][row + x], (n), &orig[row + x], (n)); \
} \
} \
costs_out[0] = sum>>(KVZ_BIT_DEPTH-8); \
\
sum = 0; \
for (y = 0; y < (n); y += 8) { \
unsigned row = y * (n); \
for (x = 0; x < (n); x += 8) { \
sum += satd_8x8_subblock_generic(&preds[1][row + x], (n), &orig[row + x], (n)); \
} \
} \
costs_out[1] = sum>>(KVZ_BIT_DEPTH-8); \
}
static unsigned satd_8x8_subblock_generic(const kvz_pixel *piOrg, const int32_t iStrideOrg, const kvz_pixel *piCur, const int32_t iStrideCur)
Calculate SATD between two 8x8 blocks inside bigger arrays.
Definition picture-generic.c:252

Function Documentation

◆ bipred_average_generic()

static void bipred_average_generic ( lcu_t *const lcu,
const yuv_t *const px_L0,
const yuv_t *const px_L1,
const yuv_im_t *const im_L0,
const yuv_im_t *const im_L1,
const unsigned pu_x,
const unsigned pu_y,
const unsigned pu_w,
const unsigned pu_h,
const unsigned im_flags_L0,
const unsigned im_flags_L1,
const bool predict_luma,
const bool predict_chroma )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bipred_average_im_im()

static void bipred_average_im_im ( kvz_pixel * dst,
kvz_pixel_im * im_L0,
kvz_pixel_im * im_L1,
unsigned pu_w,
unsigned pu_h,
unsigned dst_stride )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bipred_average_px_im()

static void bipred_average_px_im ( kvz_pixel * dst,
kvz_pixel * px,
kvz_pixel_im * im,
unsigned pu_w,
unsigned pu_h,
unsigned dst_stride )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bipred_average_px_px()

static void bipred_average_px_px ( kvz_pixel * dst,
kvz_pixel * px_L0,
kvz_pixel * px_L1,
unsigned pu_w,
unsigned pu_h,
unsigned dst_stride )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_optimized_sad_generic()

static optimized_sad_func_ptr_t get_optimized_sad_generic ( int32_t width)
static
Here is the caller graph for this function:

◆ hadamard_4x4_generic()

static int32_t hadamard_4x4_generic ( int32_t diff[4 *4])
static

From HM 13.0

Here is the caller graph for this function:

◆ hor_sad()

static unsigned hor_sad ( const kvz_pixel * pic_data,
const kvz_pixel * ref_data,
int block_width,
int block_height,
unsigned pic_stride,
unsigned ref_stride )
static
Parameters
data1Starting point of the first picture.
data2Starting point of the second picture.
widthWidth of the region for which SAD is calculated.
heightHeight of the region for which SAD is calculated.
widthWidth of the pixel array.
Returns
Sum of Absolute Differences
Here is the caller graph for this function:

◆ hor_sad_generic()

static uint32_t hor_sad_generic ( const kvz_pixel * pic_data,
const kvz_pixel * ref_data,
int32_t width,
int32_t height,
uint32_t pic_stride,
uint32_t ref_stride,
uint32_t left,
uint32_t right )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_fast_clip_16bit_to_pixel()

kvz_pixel kvz_fast_clip_16bit_to_pixel ( int16_t value)
Here is the caller graph for this function:

◆ kvz_fast_clip_32bit_to_pixel()

kvz_pixel kvz_fast_clip_32bit_to_pixel ( int32_t value)
Here is the caller graph for this function:

◆ kvz_satd_4x4_subblock_generic()

unsigned kvz_satd_4x4_subblock_generic ( const kvz_pixel * buf1,
const int32_t stride1,
const kvz_pixel * buf2,
const int32_t stride2 )
Here is the call graph for this function:

◆ kvz_satd_4x4_subblock_quad_generic()

void kvz_satd_4x4_subblock_quad_generic ( const kvz_pixel * preds[4],
const int stride,
const kvz_pixel * orig,
const int orig_stride,
unsigned costs[4] )
Here is the call graph for this function:

◆ kvz_strategy_register_picture_generic()

int kvz_strategy_register_picture_generic ( void * opaque,
uint8_t bitdepth )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pixel_var_generic()

static double pixel_var_generic ( const kvz_pixel * arr,
const uint32_t len )
static
Here is the caller graph for this function:

◆ pixels_calc_ssd_generic()

static unsigned pixels_calc_ssd_generic ( const kvz_pixel *const ref,
const kvz_pixel *const rec,
const int ref_stride,
const int rec_stride,
const int width )
static
Here is the caller graph for this function:

◆ reg_sad_generic()

static unsigned reg_sad_generic ( const kvz_pixel *const data1,
const kvz_pixel *const data2,
const int width,
const int height,
const unsigned stride1,
const unsigned stride2 )
static

Calculate Sum of Absolute Differences (SAD) between two rectangular regions located in arbitrary points in the picture.

Parameters
data1Starting point of the first picture.
data2Starting point of the second picture.
widthWidth of the region for which SAD is calculated.
heightHeight of the region for which SAD is calculated.
strideWidth of the pixel array.
Returns
Sum of Absolute Differences
Here is the caller graph for this function:

◆ sad_16x16_dual_generic()

static void sad_16x16_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static

◆ sad_16x16_generic()

static unsigned sad_16x16_generic ( const kvz_pixel *const block1,
const kvz_pixel *const block2 )
static

◆ sad_32x32_dual_generic()

static void sad_32x32_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static

◆ sad_32x32_generic()

static unsigned sad_32x32_generic ( const kvz_pixel *const block1,
const kvz_pixel *const block2 )
static

◆ sad_4x4_dual_generic()

static void sad_4x4_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static

◆ sad_4x4_generic()

static unsigned sad_4x4_generic ( const kvz_pixel *const block1,
const kvz_pixel *const block2 )
static

◆ sad_64x64_dual_generic()

static void sad_64x64_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static

◆ sad_64x64_generic()

static unsigned sad_64x64_generic ( const kvz_pixel *const block1,
const kvz_pixel *const block2 )
static

◆ sad_8x8_dual_generic()

static void sad_8x8_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static

◆ sad_8x8_generic()

static unsigned sad_8x8_generic ( const kvz_pixel *const block1,
const kvz_pixel *const block2 )
static

◆ satd_16x16_dual_generic()

static void satd_16x16_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static
Here is the caller graph for this function:

◆ satd_32x32_dual_generic()

static void satd_32x32_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static
Here is the caller graph for this function:

◆ satd_4x4_generic()

static unsigned satd_4x4_generic ( const kvz_pixel * piOrg,
const kvz_pixel * piCur )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ satd_64x64_dual_generic()

static void satd_64x64_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static
Here is the caller graph for this function:

◆ satd_8x8_dual_generic()

static void satd_8x8_dual_generic ( const pred_buffer preds,
const kvz_pixel *const orig,
unsigned num_modes,
unsigned * costs_out )
static
Here is the caller graph for this function:

◆ satd_8x8_subblock_generic()

static unsigned satd_8x8_subblock_generic ( const kvz_pixel * piOrg,
const int32_t iStrideOrg,
const kvz_pixel * piCur,
const int32_t iStrideCur )
static
Here is the caller graph for this function:

◆ satd_8x8_subblock_quad_generic()

static void satd_8x8_subblock_quad_generic ( const kvz_pixel ** preds,
const int stride,
const kvz_pixel * orig,
const int orig_stride,
unsigned * costs )
static
Here is the call graph for this function:

◆ satd_any_size_quad_generic()

static void satd_any_size_quad_generic ( int width,
int height,
const kvz_pixel ** preds,
const int stride,
const kvz_pixel * orig,
const int orig_stride,
unsigned num_modes,
unsigned * costs_out,
int8_t * valid )
static

◆ SATD_NxN()

SATD_NxN ( SATD_NxN( generic,
8  )
Here is the call graph for this function:

◆ ver_sad_generic()

static uint32_t ver_sad_generic ( const kvz_pixel * pic_data,
const kvz_pixel * ref_data,
int block_width,
int block_height,
unsigned pic_stride )
static
Parameters
data1Starting point of the first picture.
data2Starting point of the second picture.
widthWidth of the region for which SAD is calculated.
heightHeight of the region for which SAD is calculated.
widthWidth of the pixel array.
Returns
Sum of Absolute Differences
Here is the caller graph for this function:

Variable Documentation

◆ sad_16x16_dual_generic

cost_pixel_nxn_multi_func sad_16x16_dual_generic
static

◆ sad_16x16_generic

cost_pixel_nxn_func sad_16x16_generic
static

◆ sad_32x32_dual_generic

cost_pixel_nxn_multi_func sad_32x32_dual_generic
static

◆ sad_32x32_generic

cost_pixel_nxn_func sad_32x32_generic
static

◆ sad_4x4_dual_generic

cost_pixel_nxn_multi_func sad_4x4_dual_generic
static

◆ sad_4x4_generic

cost_pixel_nxn_func sad_4x4_generic
static

◆ sad_64x64_dual_generic

cost_pixel_nxn_multi_func sad_64x64_dual_generic
static

◆ sad_64x64_generic

cost_pixel_nxn_func sad_64x64_generic
static

◆ sad_8x8_dual_generic

cost_pixel_nxn_multi_func sad_8x8_dual_generic
static

◆ sad_8x8_generic

cost_pixel_nxn_func sad_8x8_generic
static

◆ satd_any_size_quad_generic

cost_pixel_any_size_multi_func satd_any_size_quad_generic
static