mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Rename struct encoder_control to encoder_control_t.
Conflicts: src/encoder_state-geometry.h src/encoderstate.h
This commit is contained in:
parent
b14f89c88f
commit
f6147b410a
|
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||
config *cfg = NULL; //!< Global configuration
|
||||
FILE *input = NULL; //!< input file (YUV)
|
||||
FILE *output = NULL; //!< output file (HEVC NAL stream)
|
||||
encoder_control encoder;
|
||||
encoder_control_t encoder;
|
||||
double psnr[3] = { 0.0, 0.0, 0.0 };
|
||||
uint32_t stat_frames = 0;
|
||||
uint64_t curpos = 0;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "rdo.h"
|
||||
|
||||
|
||||
int encoder_control_init(encoder_control * const encoder, const config * const cfg) {
|
||||
int encoder_control_init(encoder_control_t * const encoder, const config * const cfg) {
|
||||
if (!cfg) {
|
||||
fprintf(stderr, "Config object must not be null!\n");
|
||||
return 0;
|
||||
|
@ -302,7 +302,7 @@ int encoder_control_init(encoder_control * const encoder, const config * const c
|
|||
return 1;
|
||||
}
|
||||
|
||||
int encoder_control_finalize(encoder_control * const encoder) {
|
||||
int encoder_control_finalize(encoder_control_t * const encoder) {
|
||||
//Slices
|
||||
FREE_POINTER(encoder->slice_addresses_in_ts);
|
||||
|
||||
|
@ -330,7 +330,7 @@ int encoder_control_finalize(encoder_control * const encoder) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
void encoder_control_input_init(encoder_control * const encoder,
|
||||
void encoder_control_input_init(encoder_control_t * const encoder,
|
||||
const int32_t width, const int32_t height)
|
||||
{
|
||||
encoder->in.width = width;
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef struct
|
|||
enum { FORMAT_400 = 0, FORMAT_420, FORMAT_422, FORMAT_444 };
|
||||
|
||||
/* Encoder control options, the main struct */
|
||||
typedef struct encoder_control
|
||||
typedef struct encoder_control_t
|
||||
{
|
||||
/* Configuration */
|
||||
const config *cfg;
|
||||
|
@ -148,10 +148,10 @@ typedef struct encoder_control
|
|||
|
||||
bool sign_hiding;
|
||||
|
||||
} encoder_control;
|
||||
} encoder_control_t;
|
||||
|
||||
int encoder_control_init(encoder_control *encoder, const config *cfg);
|
||||
int encoder_control_finalize(encoder_control *encoder);
|
||||
int encoder_control_init(encoder_control_t *encoder, const config *cfg);
|
||||
int encoder_control_finalize(encoder_control_t *encoder);
|
||||
|
||||
void encoder_control_input_init(encoder_control *encoder, int32_t width, int32_t height);
|
||||
void encoder_control_input_init(encoder_control_t *encoder, int32_t width, int32_t height);
|
||||
#endif
|
||||
|
|
|
@ -122,7 +122,7 @@ static void encoder_state_write_bitstream_vid_parameter_set(encoder_state_t * co
|
|||
|
||||
static void encoder_state_write_bitstream_scaling_list(encoder_state_t * const encoder_state)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
bitstream * const stream = &encoder_state->stream;
|
||||
uint32_t size_id;
|
||||
for (size_id = 0; size_id < SCALING_LIST_SIZE_NUM; size_id++) {
|
||||
|
@ -181,7 +181,7 @@ static void encoder_state_write_bitstream_scaling_list(encoder_state_t * const e
|
|||
static void encoder_state_write_bitstream_VUI(encoder_state_t * const encoder_state)
|
||||
{
|
||||
bitstream * const stream = &encoder_state->stream;
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
#ifdef _DEBUG
|
||||
printf("=========== VUI Set ID: 0 ===========\n");
|
||||
#endif
|
||||
|
@ -282,7 +282,7 @@ static void encoder_state_write_bitstream_VUI(encoder_state_t * const encoder_st
|
|||
static void encoder_state_write_bitstream_seq_parameter_set(encoder_state_t * const encoder_state)
|
||||
{
|
||||
bitstream * const stream = &encoder_state->stream;
|
||||
const encoder_control * encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * encoder = encoder_state->encoder_control;
|
||||
|
||||
#ifdef _DEBUG
|
||||
printf("=========== Sequence Parameter Set ID: 0 ===========\n");
|
||||
|
@ -385,7 +385,7 @@ static void encoder_state_write_bitstream_seq_parameter_set(encoder_state_t * co
|
|||
|
||||
static void encoder_state_write_bitstream_pic_parameter_set(encoder_state_t * const encoder_state)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
bitstream * const stream = &encoder_state->stream;
|
||||
#ifdef _DEBUG
|
||||
printf("=========== Picture Parameter Set ID: 0 ===========\n");
|
||||
|
@ -554,7 +554,7 @@ static int num_bitcount(unsigned int n) {
|
|||
|
||||
void encoder_state_write_bitstream_slice_header(encoder_state_t * const encoder_state)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
bitstream * const stream = &encoder_state->stream;
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -674,7 +674,7 @@ static void add_checksum(encoder_state_t * const encoder_state)
|
|||
}
|
||||
|
||||
static void encoder_state_write_bitstream_main(encoder_state_t * const main_state) {
|
||||
const encoder_control * const encoder = main_state->encoder_control;
|
||||
const encoder_control_t * const encoder = main_state->encoder_control;
|
||||
bitstream * const stream = &main_state->stream;
|
||||
uint64_t curpos;
|
||||
int i;
|
||||
|
@ -769,7 +769,7 @@ static void encoder_state_write_bitstream_main(encoder_state_t * const main_stat
|
|||
}
|
||||
|
||||
void encoder_state_write_bitstream_leaf(encoder_state_t * const encoder_state) {
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
//Write terminator of the leaf
|
||||
assert(encoder_state->is_leaf);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ static int encoder_state_config_tile_init(encoder_state_t * const encoder_state,
|
|||
const int lcu_offset_x, const int lcu_offset_y,
|
||||
const int width, const int height, const int width_in_lcu, const int height_in_lcu) {
|
||||
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
encoder_state->tile->frame = videoframe_alloc(width, height, 0);
|
||||
|
||||
encoder_state->tile->frame->rec = NULL;
|
||||
|
@ -154,7 +154,7 @@ static void encoder_state_dump_graphviz(const encoder_state_t * const encoder_st
|
|||
int i;
|
||||
|
||||
if (!encoder_state->parent) {
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
int y,x;
|
||||
//Empty lines (easier to copy-paste)
|
||||
printf("\n\n\n\n\n");
|
||||
|
@ -291,7 +291,7 @@ int encoder_state_init(encoder_state_t * const child_state, encoder_state_t * co
|
|||
child_state->stats_done = 1; //It avoids printing meaningless stats at the beginning
|
||||
|
||||
if (!parent_state) {
|
||||
const encoder_control * const encoder = child_state->encoder_control;
|
||||
const encoder_control_t * const encoder = child_state->encoder_control;
|
||||
child_state->type = ENCODER_STATE_TYPE_MAIN;
|
||||
assert(child_state->encoder_control);
|
||||
child_state->global = MALLOC(encoder_state_config_global, 1);
|
||||
|
@ -343,7 +343,7 @@ int encoder_state_init(encoder_state_t * const child_state, encoder_state_t * co
|
|||
|
||||
//Create sub-encoders
|
||||
{
|
||||
const encoder_control * const encoder = child_state->encoder_control;
|
||||
const encoder_control_t * const encoder = child_state->encoder_control;
|
||||
int child_count = 0;
|
||||
//We first check the type of this element.
|
||||
//If it's a MAIN, it can allow both slices or tiles as child
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
|
||||
|
||||
int lcu_at_slice_start(const encoder_control * const encoder, int lcu_addr_in_ts) {
|
||||
int lcu_at_slice_start(const encoder_control_t * const encoder, int lcu_addr_in_ts) {
|
||||
int i;
|
||||
assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu);
|
||||
if (lcu_addr_in_ts == 0) return 1;
|
||||
|
@ -34,7 +34,7 @@ int lcu_at_slice_start(const encoder_control * const encoder, int lcu_addr_in_ts
|
|||
return 0;
|
||||
}
|
||||
|
||||
int lcu_at_slice_end(const encoder_control * const encoder, int lcu_addr_in_ts) {
|
||||
int lcu_at_slice_end(const encoder_control_t * const encoder, int lcu_addr_in_ts) {
|
||||
int i;
|
||||
assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu);
|
||||
if (lcu_addr_in_ts == encoder->in.height_in_lcu * encoder->in.width_in_lcu - 1) return 1;
|
||||
|
@ -44,7 +44,7 @@ int lcu_at_slice_end(const encoder_control * const encoder, int lcu_addr_in_ts)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int lcu_at_tile_start(const encoder_control * const encoder, int lcu_addr_in_ts) {
|
||||
int lcu_at_tile_start(const encoder_control_t * const encoder, int lcu_addr_in_ts) {
|
||||
assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu);
|
||||
if (lcu_addr_in_ts == 0) return 1;
|
||||
if (encoder->tiles_tile_id[lcu_addr_in_ts - 1] != encoder->tiles_tile_id[lcu_addr_in_ts]) {
|
||||
|
@ -53,7 +53,7 @@ int lcu_at_tile_start(const encoder_control * const encoder, int lcu_addr_in_ts)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int lcu_at_tile_end(const encoder_control * const encoder, int lcu_addr_in_ts) {
|
||||
int lcu_at_tile_end(const encoder_control_t * const encoder, int lcu_addr_in_ts) {
|
||||
assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu);
|
||||
if (lcu_addr_in_ts == encoder->in.height_in_lcu * encoder->in.width_in_lcu - 1) return 1;
|
||||
if (encoder->tiles_tile_id[lcu_addr_in_ts + 1] != encoder->tiles_tile_id[lcu_addr_in_ts]) {
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
|
||||
// Forward declare because including the header would lead to a cyclic
|
||||
// dependency.
|
||||
struct encoder_control;
|
||||
struct encoder_control_t;
|
||||
struct encoder_state_t;
|
||||
|
||||
|
||||
int lcu_at_slice_start(const struct encoder_control * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_slice_end(const struct encoder_control * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_tile_start(const struct encoder_control * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_tile_end(const struct encoder_control * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_slice_start(const struct encoder_control_t * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_slice_end(const struct encoder_control_t * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_tile_start(const struct encoder_control_t * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_at_tile_end(const struct encoder_control_t * const encoder, int lcu_addr_in_ts);
|
||||
int lcu_in_first_row(const struct encoder_state_t * const encoder_state, int lcu_addr_in_ts);
|
||||
int lcu_in_last_row(const struct encoder_state_t * const encoder_state, int lcu_addr_in_ts);
|
||||
int lcu_in_first_column(const struct encoder_state_t * const encoder_state, int lcu_addr_in_ts);
|
||||
|
|
|
@ -221,7 +221,7 @@ static void encode_sao(encoder_state_t * const encoder_state,
|
|||
static void encoder_state_worker_encode_lcu(void * opaque) {
|
||||
const lcu_order_element * const lcu = opaque;
|
||||
encoder_state_t *encoder_state = lcu->encoder_state;
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
videoframe* const frame = encoder_state->tile->frame;
|
||||
|
||||
//This part doesn't write to bitstream, it's only search, deblock and sao
|
||||
|
@ -333,7 +333,7 @@ static void encoder_state_worker_encode_lcu(void * opaque) {
|
|||
}
|
||||
|
||||
static void encoder_state_encode_leaf(encoder_state_t * const encoder_state) {
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
@ -656,7 +656,7 @@ static void encoder_state_new_frame(encoder_state_t * const main_state) {
|
|||
int i;
|
||||
//FIXME Move this somewhere else!
|
||||
if (main_state->type == ENCODER_STATE_TYPE_MAIN) {
|
||||
const encoder_control * const encoder = main_state->encoder_control;
|
||||
const encoder_control_t * const encoder = main_state->encoder_control;
|
||||
|
||||
const int is_first_frame = (main_state->global->frame == 0);
|
||||
const int is_i_radl = (encoder->cfg->intra_period == 1 && main_state->global->frame % 2 == 0);
|
||||
|
@ -828,7 +828,7 @@ int read_one_frame(FILE* file, const encoder_state_t * const encoder_state)
|
|||
}
|
||||
|
||||
void encoder_compute_stats(encoder_state_t *encoder_state, FILE * const recout, uint32_t *stat_frames, double psnr[3], uint64_t *bitstream_length) {
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
|
||||
if (encoder_state->stats_done) return;
|
||||
encoder_state->stats_done = 1;
|
||||
|
@ -882,7 +882,7 @@ void encoder_compute_stats(encoder_state_t *encoder_state, FILE * const recout,
|
|||
|
||||
|
||||
void encoder_next_frame(encoder_state_t *encoder_state) {
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
|
||||
//Blocking call
|
||||
threadqueue_waitfor(encoder->threadqueue, encoder_state->tqj_bitstream_written);
|
||||
|
@ -1561,7 +1561,7 @@ void encode_transform_coeff(encoder_state_t * const encoder_state, int32_t x_pu,
|
|||
void encode_coeff_nxn(encoder_state_t * const encoder_state, coefficient *coeff, uint8_t width,
|
||||
uint8_t type, int8_t scan_mode, int8_t tr_skip)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
cabac_data * const cabac = &encoder_state->cabac;
|
||||
int c1 = 1;
|
||||
uint8_t last_coeff_x = 0;
|
||||
|
|
|
@ -141,7 +141,7 @@ typedef struct lcu_order_element {
|
|||
} lcu_order_element;
|
||||
|
||||
typedef struct encoder_state_t {
|
||||
const encoder_control *encoder_control;
|
||||
const encoder_control_t *encoder_control;
|
||||
encoder_state_type type;
|
||||
|
||||
//List of children, the last item of this list is a pseudo-encoder with encoder_control = NULL
|
||||
|
@ -192,7 +192,7 @@ void encode_coeff_nxn(encoder_state_t *encoder, int16_t *coeff, uint8_t width,
|
|||
uint8_t type, int8_t scan_mode, int8_t tr_skip);
|
||||
void encode_transform_coeff(encoder_state_t *encoder_state, int32_t x_cu, int32_t y_cu,
|
||||
int8_t depth, int8_t tr_depth, uint8_t parent_coeff_u, uint8_t parent_coeff_v);
|
||||
void encode_block_residual(const encoder_control * const encoder,
|
||||
void encode_block_residual(const encoder_control_t * const encoder,
|
||||
uint16_t x_ctb, uint16_t y_ctb, uint8_t depth);
|
||||
|
||||
int encoder_state_match_children_of_previous_frame(encoder_state_t * const encoder_state);
|
||||
|
|
|
@ -83,7 +83,7 @@ const int8_t g_chroma_filter[8][4] =
|
|||
/**
|
||||
* \brief
|
||||
*/
|
||||
INLINE void filter_deblock_luma(const encoder_control * const encoder, pixel *src, int32_t offset,
|
||||
INLINE void filter_deblock_luma(const encoder_control_t * const encoder, pixel *src, int32_t offset,
|
||||
int32_t tc, int8_t sw,
|
||||
int8_t part_P_nofilter, int8_t part_Q_nofilter,
|
||||
int32_t thr_cut,
|
||||
|
@ -143,7 +143,7 @@ INLINE void filter_deblock_luma(const encoder_control * const encoder, pixel *sr
|
|||
/**
|
||||
* \brief
|
||||
*/
|
||||
INLINE void filter_deblock_chroma(const encoder_control * const encoder, pixel *src, int32_t offset, int32_t tc,
|
||||
INLINE void filter_deblock_chroma(const encoder_control_t * const encoder, pixel *src, int32_t offset, int32_t tc,
|
||||
int8_t part_P_nofilter, int8_t part_Q_nofilter)
|
||||
{
|
||||
int32_t delta;
|
||||
|
@ -169,7 +169,7 @@ void filter_deblock_edge_luma(encoder_state_t * const encoder_state,
|
|||
int8_t depth, int8_t dir)
|
||||
{
|
||||
const videoframe * const frame = encoder_state->tile->frame;
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
|
||||
const cu_info *cu_q = videoframe_get_cu_const(frame, xpos>>MIN_SIZE, ypos>>MIN_SIZE);
|
||||
|
||||
|
@ -293,7 +293,7 @@ void filter_deblock_edge_chroma(encoder_state_t * const encoder_state,
|
|||
int32_t x, int32_t y,
|
||||
int8_t depth, int8_t dir)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
const videoframe * const frame = encoder_state->tile->frame;
|
||||
const cu_info *cu_q = videoframe_get_cu_const(frame, x>>(MIN_SIZE-1), y>>(MIN_SIZE-1));
|
||||
|
||||
|
|
|
@ -43,11 +43,11 @@ void filter_deblock_edge_chroma(encoder_state_t *encoder_state,
|
|||
int32_t xpos, int32_t ypos,
|
||||
int8_t depth, int8_t dir);
|
||||
void filter_deblock_lcu(encoder_state_t *encoder_state, int x_px, int y_px);
|
||||
void filter_deblock_luma(const encoder_control * const encoder, pixel *src, int32_t offset, int32_t tc , int8_t sw,
|
||||
void filter_deblock_luma(const encoder_control_t * const encoder, pixel *src, int32_t offset, int32_t tc , int8_t sw,
|
||||
int8_t part_p_nofilter, int8_t part_q_nofilter,
|
||||
int32_t thr_cut,
|
||||
int8_t filter_second_p, int8_t filter_second_q);
|
||||
void filter_deblock_chroma(const encoder_control * const encoder, pixel *src, int32_t offset, int32_t tc,
|
||||
void filter_deblock_chroma(const encoder_control_t * const encoder, pixel *src, int32_t offset, int32_t tc,
|
||||
int8_t part_p_nofilter, int8_t part_q_nofilter);
|
||||
|
||||
// SAO
|
||||
|
|
12
src/intra.c
12
src/intra.c
|
@ -222,7 +222,7 @@ void intra_filter(pixel *ref, int32_t stride,int32_t width, int8_t mode)
|
|||
* \param recstride Stride for rec pixel arrays.
|
||||
* \param dst
|
||||
*/
|
||||
void intra_get_pred(const encoder_control * const encoder, const pixel *rec, const pixel *rec_filtered, int recstride, pixel *dst, int width, int mode, int is_chroma)
|
||||
void intra_get_pred(const encoder_control_t * const encoder, const pixel *rec, const pixel *rec_filtered, int recstride, pixel *dst, int width, int mode, int is_chroma)
|
||||
{
|
||||
const pixel *ref_pixels = rec;
|
||||
if (is_chroma || mode == 1 || width == 4) {
|
||||
|
@ -271,7 +271,7 @@ void intra_get_pred(const encoder_control * const encoder, const pixel *rec, con
|
|||
* \param chroma chroma-block flag
|
||||
|
||||
*/
|
||||
void intra_recon(const encoder_control * const encoder, pixel* rec, int32_t recstride, uint32_t width, pixel* dst, int32_t dststride, int8_t mode, int8_t chroma)
|
||||
void intra_recon(const encoder_control_t * const encoder, pixel* rec, int32_t recstride, uint32_t width, pixel* dst, int32_t dststride, int8_t mode, int8_t chroma)
|
||||
{
|
||||
pixel pred[LCU_WIDTH * LCU_WIDTH];
|
||||
pixel rec_filtered_temp[(LCU_WIDTH * 2 + 8) * (LCU_WIDTH * 2 + 8) + 1];
|
||||
|
@ -303,7 +303,7 @@ void intra_recon(const encoder_control * const encoder, pixel* rec, int32_t recs
|
|||
* The end result is 2*width+8 x 2*width+8 array, with only the top and left
|
||||
* edge pixels filled with the reconstructed pixels.
|
||||
*/
|
||||
void intra_build_reference_border(const encoder_control * const encoder, int32_t x_luma, int32_t y_luma, int16_t out_width,
|
||||
void intra_build_reference_border(const encoder_control_t * const encoder, int32_t x_luma, int32_t y_luma, int16_t out_width,
|
||||
pixel *dst, int32_t dst_stride, int8_t chroma,
|
||||
int32_t pic_width, int32_t pic_height,
|
||||
lcu_t *lcu)
|
||||
|
@ -484,7 +484,7 @@ const int32_t inv_ang_table[9] = {0, 4096, 1638, 910, 630, 482, 390, 315, 256};
|
|||
* \brief this functions constructs the angular intra prediction from border samples
|
||||
*
|
||||
*/
|
||||
void intra_get_angular_pred(const encoder_control * const encoder, const pixel* src, int32_t src_stride, pixel* dst, int32_t dst_stride, int32_t width, int32_t dir_mode, int8_t filter)
|
||||
void intra_get_angular_pred(const encoder_control_t * const encoder, const pixel* src, int32_t src_stride, pixel* dst, int32_t dst_stride, int32_t width, int32_t dir_mode, int8_t filter)
|
||||
{
|
||||
int32_t k,l;
|
||||
int32_t blk_size = width;
|
||||
|
@ -659,7 +659,7 @@ void intra_get_planar_pred(const pixel* src, int32_t srcstride, uint32_t width,
|
|||
|
||||
void intra_recon_lcu_luma(encoder_state_t * const encoder_state, int x, int y, int depth, int8_t intra_mode, cu_info *cur_cu, lcu_t *lcu)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
const vector2d lcu_px = { x & 0x3f, y & 0x3f };
|
||||
if (cur_cu == NULL) {
|
||||
cur_cu = &lcu->cu[LCU_CU_OFFSET + (lcu_px.x >> 3) + (lcu_px.y >> 3)*LCU_T_CU_WIDTH];
|
||||
|
@ -708,7 +708,7 @@ void intra_recon_lcu_luma(encoder_state_t * const encoder_state, int x, int y, i
|
|||
|
||||
void intra_recon_lcu_chroma(encoder_state_t * const encoder_state, int x, int y, int depth, int8_t intra_mode, cu_info *cur_cu, lcu_t *lcu)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
const vector2d lcu_px = { x & 0x3f, y & 0x3f };
|
||||
const int8_t width = LCU_WIDTH >> depth;
|
||||
const int8_t width_c = (depth == MAX_PU_DEPTH ? width : width / 2);
|
||||
|
|
|
@ -37,17 +37,17 @@ int8_t intra_get_dir_luma_predictor(uint32_t x, uint32_t y, int8_t* preds,
|
|||
const cu_info* cur_cu, const cu_info* left_cu, const cu_info* above_cu);
|
||||
void intra_dc_pred_filtering(const pixel* src, int32_t src_stride, pixel* dst, int32_t dst_stride, int32_t width, int32_t height );
|
||||
|
||||
void intra_build_reference_border(const encoder_control *encoder, int32_t x_luma, int32_t y_luma, int16_t out_width, pixel *dst, int32_t dst_stride, int8_t chroma, int32_t pic_width, int32_t pic_height, lcu_t *lcu);
|
||||
void intra_build_reference_border(const encoder_control_t *encoder, int32_t x_luma, int32_t y_luma, int16_t out_width, pixel *dst, int32_t dst_stride, int8_t chroma, int32_t pic_width, int32_t pic_height, lcu_t *lcu);
|
||||
void intra_filter(pixel* ref, int32_t stride, int32_t width, int8_t mode);
|
||||
|
||||
/* Predictions */
|
||||
void intra_get_pred(const encoder_control * const encoder, const pixel *rec, const pixel *rec_filtered, int recstride, pixel *dst, int width, int mode, int is_chroma);
|
||||
void intra_get_pred(const encoder_control_t * const encoder, const pixel *rec, const pixel *rec_filtered, int recstride, pixel *dst, int width, int mode, int is_chroma);
|
||||
|
||||
pixel intra_get_dc_pred(const pixel* pic, uint16_t pic_width, uint8_t width);
|
||||
void intra_get_planar_pred(const pixel* src,int32_t srcstride, uint32_t width, pixel* dst, int32_t dststride);
|
||||
void intra_get_angular_pred(const encoder_control *encoder, const pixel* src, int32_t src_stride, pixel* dst, int32_t dst_stride, int32_t width, int32_t dir_mode, int8_t filter);
|
||||
void intra_get_angular_pred(const encoder_control_t *encoder, const pixel* src, int32_t src_stride, pixel* dst, int32_t dst_stride, int32_t width, int32_t dir_mode, int8_t filter);
|
||||
|
||||
void intra_recon(const encoder_control *encoder, pixel* rec, int32_t rec_stride, uint32_t width, pixel* dst, int32_t dst_stride, int8_t mode, int8_t chroma);
|
||||
void intra_recon(const encoder_control_t *encoder, pixel* rec, int32_t rec_stride, uint32_t width, pixel* dst, int32_t dst_stride, int8_t mode, int8_t chroma);
|
||||
|
||||
void intra_recon_lcu_luma(encoder_state_t *encoder_state, int x, int y, int depth, int8_t intra_mode, cu_info *cur_cu, lcu_t *lcu);
|
||||
void intra_recon_lcu_chroma(encoder_state_t *encoder_state, int x, int y, int depth, int8_t intra_mode, cu_info *cur_cu, lcu_t *lcu);
|
||||
|
|
|
@ -172,7 +172,7 @@ int intra_rdo_cost_compare(uint32_t *rdo_costs,int8_t rdo_modes_to_check, uint32
|
|||
*/
|
||||
uint32_t rdo_cost_intra(encoder_state_t * const encoder_state, pixel *pred, pixel *orig_block, int width, int8_t mode, int tr_depth)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
coefficient pre_quant_coeff[LCU_WIDTH*LCU_WIDTH>>2];
|
||||
int16_t block[LCU_WIDTH*LCU_WIDTH>>2];
|
||||
int16_t temp_block[LCU_WIDTH*LCU_WIDTH>>2];
|
||||
|
@ -446,7 +446,7 @@ void rdoq_sign_hiding(const encoder_state_t *const encoder_state,
|
|||
const coefficient *const coef,
|
||||
coefficient *const dest_coeff)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
const int32_t size = width * width;
|
||||
|
||||
int64_t rd_factor = (int64_t)(
|
||||
|
@ -551,7 +551,7 @@ void rdoq_sign_hiding(const encoder_state_t *const encoder_state,
|
|||
void rdoq(encoder_state_t * const encoder_state, coefficient *coef, coefficient *dest_coeff, int32_t width,
|
||||
int32_t height, int8_t type, int8_t scan_mode, int8_t block_type, int8_t tr_depth)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
cabac_data * const cabac = &encoder_state->cabac;
|
||||
uint32_t log2_tr_size = g_convert_to_bit[ width ] + 2;
|
||||
int32_t transform_shift = MAX_TR_DYNAMIC_RANGE - encoder->bitdepth - log2_tr_size; // Represents scaling through forward transform
|
||||
|
|
|
@ -243,7 +243,7 @@ static float sao_mode_bits_band(const encoder_state_t * const encoder_state,
|
|||
/**
|
||||
* \brief calculate an array of intensity correlations for each intensity value
|
||||
*/
|
||||
static void calc_sao_offset_array(const encoder_control * const encoder, const sao_info *sao, int *offset, color_index color_i)
|
||||
static void calc_sao_offset_array(const encoder_control_t * const encoder, const sao_info *sao, int *offset, color_index color_i)
|
||||
{
|
||||
int val;
|
||||
int values = (1<<encoder->bitdepth);
|
||||
|
@ -375,7 +375,7 @@ static void calc_sao_edge_dir(const pixel *orig_data, const pixel *rec_data,
|
|||
}
|
||||
}
|
||||
|
||||
static void sao_reconstruct_color(const encoder_control * const encoder,
|
||||
static void sao_reconstruct_color(const encoder_control_t * const encoder,
|
||||
const pixel *rec_data, pixel *new_rec_data,
|
||||
const sao_info *sao,
|
||||
int stride, int new_stride,
|
||||
|
@ -527,7 +527,7 @@ static void sao_calc_edge_block_dims(const videoframe * const frame, color_index
|
|||
rec->x = (rec->x == 0 ? 0 : -1);
|
||||
}
|
||||
|
||||
void sao_reconstruct(const encoder_control * const encoder, videoframe * frame, const pixel *old_rec,
|
||||
void sao_reconstruct(const encoder_control_t * const encoder, videoframe * frame, const pixel *old_rec,
|
||||
unsigned x_ctb, unsigned y_ctb,
|
||||
const sao_info *sao, color_index color_i)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef struct sao_info_struct {
|
|||
void init_sao_info(sao_info *sao);
|
||||
void sao_search_chroma(const encoder_state_t * encoder_state, const videoframe *frame, unsigned x_ctb, unsigned y_ctb, sao_info *sao, sao_info *sao_top, sao_info *sao_left, int32_t merge_cost[3]);
|
||||
void sao_search_luma(const encoder_state_t * encoder_state, const videoframe *frame, unsigned x_ctb, unsigned y_ctb, sao_info *sao, sao_info *sao_top, sao_info *sao_left, int32_t merge_cost[3]);
|
||||
void sao_reconstruct(const encoder_control * encoder, videoframe *frame, const pixel *old_rec,
|
||||
void sao_reconstruct(const encoder_control_t * encoder, videoframe *frame, const pixel *old_rec,
|
||||
unsigned x_ctb, unsigned y_ctb,
|
||||
const sao_info *sao, color_index color_i);
|
||||
void sao_reconstruct_frame(encoder_state_t *encoder_state);
|
||||
|
|
|
@ -1881,7 +1881,7 @@ static uint8_t get_ctx_cu_split_model(const lcu_t *lcu, int x, int y, int depth)
|
|||
*/
|
||||
static double search_cu(encoder_state_t * const encoder_state, int x, int y, int depth, lcu_t work_tree[MAX_PU_DEPTH])
|
||||
{
|
||||
const encoder_control* ctrl = encoder_state->encoder_control;
|
||||
const encoder_control_t* ctrl = encoder_state->encoder_control;
|
||||
const videoframe * const frame = encoder_state->tile->frame;
|
||||
int cu_width = LCU_WIDTH >> depth;
|
||||
double cost = MAX_INT;
|
||||
|
|
|
@ -120,7 +120,7 @@ int32_t four_tap_filter_ver_16bit_avx2(int8_t *filter, int16_t *data, int16_t st
|
|||
return temp;
|
||||
}
|
||||
|
||||
void filter_inter_quarterpel_luma_avx2(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_quarterpel_luma_avx2(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
|
||||
int32_t x, y;
|
||||
|
@ -211,7 +211,7 @@ void filter_inter_quarterpel_luma_avx2(const encoder_control * const encoder, pi
|
|||
* \param dst_stride stride of destination image
|
||||
*
|
||||
*/
|
||||
void filter_inter_halfpel_chroma_avx2(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_halfpel_chroma_avx2(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
/* ____________
|
||||
* | B0,0|ae0,0|
|
||||
|
@ -272,7 +272,7 @@ void filter_inter_halfpel_chroma_avx2(const encoder_control * const encoder, pix
|
|||
}
|
||||
}
|
||||
|
||||
void filter_inter_octpel_chroma_avx2(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_octpel_chroma_avx2(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
|
||||
int32_t x, y;
|
||||
|
|
|
@ -120,7 +120,7 @@ int32_t four_tap_filter_ver_16bit_generic(int8_t *filter, int16_t *data, int16_t
|
|||
return temp;
|
||||
}
|
||||
|
||||
void filter_inter_quarterpel_luma_generic(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_quarterpel_luma_generic(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
|
||||
int32_t x, y;
|
||||
|
@ -211,7 +211,7 @@ void filter_inter_quarterpel_luma_generic(const encoder_control * const encoder,
|
|||
* \param dst_stride stride of destination image
|
||||
*
|
||||
*/
|
||||
void filter_inter_halfpel_chroma_generic(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_halfpel_chroma_generic(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
/* ____________
|
||||
* | B0,0|ae0,0|
|
||||
|
@ -272,7 +272,7 @@ void filter_inter_halfpel_chroma_generic(const encoder_control * const encoder,
|
|||
}
|
||||
}
|
||||
|
||||
void filter_inter_octpel_chroma_generic(const encoder_control * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
void filter_inter_octpel_chroma_generic(const encoder_control_t * const encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag)
|
||||
{
|
||||
|
||||
int32_t x, y;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "encoder.h"
|
||||
|
||||
|
||||
typedef unsigned(ipol_func)(const encoder_control * encoder, pixel *src, int16_t src_stride, int width, int height, pixel *dst,
|
||||
typedef unsigned(ipol_func)(const encoder_control_t * encoder, pixel *src, int16_t src_stride, int width, int height, 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, pixel *ref, int ref_width, int ref_height,
|
||||
|
|
|
@ -77,7 +77,7 @@ int32_t get_scaled_qp(int8_t type, int8_t qp, int8_t qp_offset)
|
|||
* \param block output data (residual)
|
||||
* \param block_size input data (width of transform)
|
||||
*/
|
||||
void transformskip(const encoder_control * const encoder, int16_t *block,int16_t *coeff, int8_t block_size)
|
||||
void transformskip(const encoder_control_t * const encoder, int16_t *block,int16_t *coeff, int8_t block_size)
|
||||
{
|
||||
uint32_t log2_tr_size = g_convert_to_bit[block_size] + 2;
|
||||
int32_t shift = MAX_TR_DYNAMIC_RANGE - encoder->bitdepth - log2_tr_size;
|
||||
|
@ -95,7 +95,7 @@ void transformskip(const encoder_control * const encoder, int16_t *block,int16_t
|
|||
* \param block output data (residual)
|
||||
* \param block_size width of transform
|
||||
*/
|
||||
void itransformskip(const encoder_control * const encoder, int16_t *block,int16_t *coeff, int8_t block_size)
|
||||
void itransformskip(const encoder_control_t * const encoder, int16_t *block,int16_t *coeff, int8_t block_size)
|
||||
{
|
||||
uint32_t log2_tr_size = g_convert_to_bit[block_size] + 2;
|
||||
int32_t shift = MAX_TR_DYNAMIC_RANGE - encoder->bitdepth - log2_tr_size;
|
||||
|
@ -115,13 +115,13 @@ void itransformskip(const encoder_control * const encoder, int16_t *block,int16_
|
|||
* \param coeff transform coefficients
|
||||
* \param block_size width of transform
|
||||
*/
|
||||
void transform2d(const encoder_control * const encoder, int16_t *block, int16_t *coeff, int8_t block_size, int32_t mode)
|
||||
void transform2d(const encoder_control_t * const encoder, int16_t *block, int16_t *coeff, int8_t block_size, int32_t mode)
|
||||
{
|
||||
dct_func *dct_func = get_dct_func(block_size, mode);
|
||||
dct_func(encoder->bitdepth, block, coeff);
|
||||
}
|
||||
|
||||
void itransform2d(const encoder_control * const encoder, int16_t *block, int16_t *coeff, int8_t block_size, int32_t mode)
|
||||
void itransform2d(const encoder_control_t * const encoder, int16_t *block, int16_t *coeff, int8_t block_size, int32_t mode)
|
||||
{
|
||||
dct_func *idct_func = get_idct_func(block_size, mode);
|
||||
idct_func(encoder->bitdepth, coeff, block);
|
||||
|
@ -136,7 +136,7 @@ void itransform2d(const encoder_control * const encoder, int16_t *block, int16_t
|
|||
void quant(const encoder_state_t * const encoder_state, int16_t *coef, int16_t *q_coef, int32_t width,
|
||||
int32_t height, int8_t type, int8_t scan_idx, int8_t block_type )
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
const uint32_t log2_block_size = g_convert_to_bit[ width ] + 2;
|
||||
const uint32_t * const scan = g_sig_last_scan[ scan_idx ][ log2_block_size - 1 ];
|
||||
|
||||
|
@ -264,7 +264,7 @@ void quant(const encoder_state_t * const encoder_state, int16_t *coef, int16_t *
|
|||
*/
|
||||
void dequant(const encoder_state_t * const encoder_state, int16_t *q_coef, int16_t *coef, int32_t width, int32_t height,int8_t type, int8_t block_type)
|
||||
{
|
||||
const encoder_control * const encoder = encoder_state->encoder_control;
|
||||
const encoder_control_t * const encoder = encoder_state->encoder_control;
|
||||
int32_t shift,add,coeff_q;
|
||||
int32_t n;
|
||||
int32_t transform_shift = 15 - encoder->bitdepth - (g_convert_to_bit[ width ] + 2);
|
||||
|
|
|
@ -39,11 +39,11 @@ void quant(const encoder_state_t *encoder_state, int16_t *coef, int16_t *q_coef,
|
|||
int32_t height, int8_t type, int8_t scan_idx, int8_t block_type);
|
||||
void dequant(const encoder_state_t *encoder_state, int16_t *q_coef, int16_t *coef, int32_t width, int32_t height,int8_t type, int8_t block_type);
|
||||
|
||||
void transformskip(const encoder_control *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
|
||||
void itransformskip(const encoder_control *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
|
||||
void transformskip(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
|
||||
void itransformskip(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
|
||||
|
||||
void transform2d(const encoder_control *encoder, int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode);
|
||||
void itransform2d(const encoder_control *encoder, int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode);
|
||||
void transform2d(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode);
|
||||
void itransform2d(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode);
|
||||
|
||||
int32_t get_scaled_qp(int8_t type, int8_t qp, int8_t qp_offset);
|
||||
|
||||
|
|
Loading…
Reference in a new issue