TUT HEVC Encoder
|
#include "image.h"
#include <limits.h>
#include <stdlib.h>
#include "strategies/strategies-ipol.h"
#include "strategies/strategies-picture.h"
#include "threads.h"
Macros | |
#define | BLIT_PIXELS_CASE(n) |
BLock Image Transfer from one buffer to another. More... | |
Functions | |
kvz_picture * | kvz_image_alloc_420 (const int32_t width, const int32_t height) |
Allocate a new image with 420. More... | |
kvz_picture * | kvz_image_alloc (enum kvz_chroma_format chroma_format, const int32_t width, const int32_t height) |
Allocate a new image. More... | |
void | kvz_image_free (kvz_picture *const im) |
Free an image. More... | |
kvz_picture * | kvz_image_copy_ref (kvz_picture *im) |
Get a new pointer to an image. More... | |
kvz_picture * | kvz_image_make_subimage (kvz_picture *const orig_image, const unsigned x_offset, const unsigned y_offset, const unsigned width, const unsigned height) |
yuv_t * | kvz_yuv_t_alloc (int luma_size, int chroma_size) |
void | kvz_yuv_t_free (yuv_t *yuv) |
static uint32_t | reg_sad_maybe_optimized (const kvz_pixel *const data1, const kvz_pixel *const data2, const int32_t width, const int32_t height, const uint32_t stride1, const uint32_t stride2, optimized_sad_func_ptr_t optimized_sad) |
static unsigned | cor_sad (const kvz_pixel *pic_data, const kvz_pixel *ref_data, int block_width, int block_height, unsigned pic_stride) |
Diagonally interpolate SAD outside the frame. More... | |
static unsigned | image_interpolated_sad (const kvz_picture *pic, const kvz_picture *ref, int pic_x, int pic_y, int ref_x, int ref_y, int block_width, int block_height, optimized_sad_func_ptr_t optimized_sad) |
Handle special cases of comparing blocks that are not completely inside the frame. More... | |
unsigned | kvz_image_calc_sad (const kvz_picture *pic, const kvz_picture *ref, int pic_x, int pic_y, int ref_x, int ref_y, int block_width, int block_height, optimized_sad_func_ptr_t optimized_sad) |
Calculate interpolated SAD between two blocks. More... | |
unsigned | kvz_image_calc_satd (const kvz_picture *pic, const kvz_picture *ref, int pic_x, int pic_y, int ref_x, int ref_y, int block_width, int block_height) |
Calculate interpolated SATD between two blocks. More... | |
void | kvz_pixels_blit (const kvz_pixel *const orig, kvz_pixel *const dst, const unsigned width, const unsigned height, const unsigned orig_stride, const unsigned dst_stride) |
#define BLIT_PIXELS_CASE | ( | n | ) |
It's a stupidly simple loop that copies pixels.
orig | Start of the originating buffer. |
dst | Start of the destination buffer. |
width | Width of the copied region. |
height | Height of the copied region. |
orig_stride | Width of a row in the originating buffer. |
dst_stride | Width of a row in the destination buffer. |
This should be inlined, but it's defined here for now to see if Visual Studios LTCG will inline it.
|
static |
data1 | Starting point of the first picture. |
data2 | Starting point of the second picture. |
width | Width of the region for which SAD is calculated. |
height | Height of the region for which SAD is calculated. |
width | Width of the pixel array. |
|
static |
pic | First frame. |
ref | Second frame. |
pic_x | X coordinate of the first block. |
pic_y | Y coordinate of the first block. |
ref_x | X coordinate of the second block. |
ref_y | Y coordinate of the second block. |
block_width | Width of the blocks. |
block_height | Height of the blocks. |
kvz_picture * kvz_image_alloc | ( | enum kvz_chroma_format | chroma_format, |
const int32_t | width, | ||
const int32_t | height | ||
) |
kvz_picture * kvz_image_alloc_420 | ( | const int32_t | width, |
const int32_t | height | ||
) |
This function signature is part of the libkvz API.
unsigned kvz_image_calc_sad | ( | const kvz_picture * | pic, |
const kvz_picture * | ref, | ||
int | pic_x, | ||
int | pic_y, | ||
int | ref_x, | ||
int | ref_y, | ||
int | block_width, | ||
int | block_height, | ||
optimized_sad_func_ptr_t | optimized_sad | ||
) |
pic | Image for the block we are trying to find. |
ref | Image where we are trying to find the block. |
unsigned kvz_image_calc_satd | ( | const kvz_picture * | pic, |
const kvz_picture * | ref, | ||
int | pic_x, | ||
int | pic_y, | ||
int | ref_x, | ||
int | ref_y, | ||
int | block_width, | ||
int | block_height | ||
) |
pic | Image for the block we are trying to find. |
ref | Image where we are trying to find the block. |
kvz_picture * kvz_image_copy_ref | ( | kvz_picture * | im | ) |
Increment reference count and return the image.
void kvz_image_free | ( | kvz_picture *const | im | ) |
Decrement reference count of the image and deallocate associated memory if no references exist any more.
im | image to free |
kvz_picture * kvz_image_make_subimage | ( | kvz_picture *const | orig_image, |
const unsigned | x_offset, | ||
const unsigned | y_offset, | ||
const unsigned | width, | ||
const unsigned | height | ||
) |
void kvz_pixels_blit | ( | const kvz_pixel *const | orig, |
kvz_pixel *const | dst, | ||
const unsigned | width, | ||
const unsigned | height, | ||
const unsigned | orig_stride, | ||
const unsigned | dst_stride | ||
) |
yuv_t * kvz_yuv_t_alloc | ( | int | luma_size, |
int | chroma_size | ||
) |
void kvz_yuv_t_free | ( | yuv_t * | yuv | ) |
|
inlinestatic |