Commit 626635c2 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Lower case names for struct members.

Lower case member names inside VP9D_CONFIG and VP9D_COMP structs.

Change-Id: I75af9ad2d929a35c357207a3fd9ebedddabf79c3
parent 49bc402a
......@@ -86,17 +86,16 @@ void vp9_loop_filter_init(VP9_COMMON *cm) {
loop_filter_info_n *lfi = &cm->lf_info;
int i;
/* init limits for given sharpness*/
// init limits for given sharpness
vp9_loop_filter_update_sharpness(lfi, cm->sharpness_level);
cm->last_sharpness_level = cm->sharpness_level;
/* init LUT for lvl and hev thr picking */
// init LUT for lvl and hev thr picking
lf_init_lut(lfi);
/* init hev threshold const vectors */
for (i = 0; i < 4; i++) {
// init hev threshold const vectors
for (i = 0; i < 4; i++)
vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH);
}
}
void vp9_loop_filter_frame_init(VP9_COMMON *cm,
......
......@@ -100,7 +100,7 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) {
/* all the ac values =; */
for (i = 1; i < 16; i++) {
int rc = vp9_default_zig_zag1d_4x4[i];
const int rc = vp9_default_zig_zag1d_4x4[i];
pc->Y1dequant[q][rc] = (int16_t)vp9_ac_yquant(q);
pc->UVdequant[q][rc] = (int16_t)vp9_ac_uv_quant(q, pc->uvac_delta_q);
......@@ -1099,8 +1099,8 @@ static void setup_token_decoder(VP9D_COMP *pbi,
const unsigned char *cx_data,
BOOL_DECODER* const bool_decoder) {
VP9_COMMON *pc = &pbi->common;
const unsigned char *user_data_end = pbi->Source + pbi->source_sz;
const unsigned char *partition = cx_data;
const uint8_t *user_data_end = pbi->source + pbi->source_sz;
const uint8_t *partition = cx_data;
ptrdiff_t bytes_left = user_data_end - partition;
ptrdiff_t partition_size = bytes_left;
......@@ -1644,11 +1644,11 @@ static void decode_tiles(VP9D_COMP *pbi,
}
}
int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
BOOL_DECODER header_bc, residual_bc;
VP9_COMMON *const pc = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
const uint8_t *data = (const uint8_t *)pbi->Source;
const uint8_t *data = pbi->source;
const uint8_t *data_end = data + pbi->source_sz;
ptrdiff_t first_partition_length_in_bytes = 0;
int i, corrupt_tokens = 0;
......
......@@ -11,54 +11,56 @@
#ifndef VP9_COMMON_VP9_ONYXD_H_
#define VP9_COMMON_VP9_ONYXD_H_
/* Create/destroy static data structures. */
#ifdef __cplusplus
extern "C" {
#endif
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_ppflags.h"
#include "vpx_ports/mem.h"
#include "vpx/vpx_codec.h"
typedef void *VP9D_PTR;
typedef struct {
int Width;
int Height;
int Version;
int postprocess;
int max_threads;
int inv_tile_order;
int input_partition;
} VP9D_CONFIG;
typedef enum {
VP9_LAST_FLAG = 1,
VP9_GOLD_FLAG = 2,
VP9_ALT_FLAG = 4
} VP9_REFFRAME;
void vp9_initialize_dec(void);
int vp9_receive_compressed_data(VP9D_PTR comp, unsigned long size,
const unsigned char **dest,
int64_t time_stamp);
int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
int64_t *time_stamp, int64_t *time_end_stamp,
vp9_ppflags_t *flags);
vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
void vp9_remove_decompressor(VP9D_PTR comp);
typedef void *VP9D_PTR;
typedef struct {
int width;
int height;
int version;
int postprocess;
int max_threads;
int inv_tile_order;
int input_partition;
} VP9D_CONFIG;
typedef enum {
VP9_LAST_FLAG = 1,
VP9_GOLD_FLAG = 2,
VP9_ALT_FLAG = 4
} VP9_REFFRAME;
void vp9_initialize_dec();
int vp9_receive_compressed_data(VP9D_PTR comp,
uint64_t size, const uint8_t **dest,
int64_t time_stamp);
int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
int64_t *time_stamp, int64_t *time_end_stamp,
vp9_ppflags_t *flags);
vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
void vp9_remove_decompressor(VP9D_PTR comp);
#ifdef __cplusplus
}
......
......@@ -111,7 +111,7 @@ void vp9_initialize_dec() {
}
VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
VP9D_COMP *pbi = vpx_memalign(32, sizeof(VP9D_COMP));
VP9D_COMP *const pbi = vpx_memalign(32, sizeof(VP9D_COMP));
if (!pbi)
return NULL;
......@@ -121,40 +121,37 @@ VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
if (setjmp(pbi->common.error.jmp)) {
pbi->common.error.setjmp = 0;
vp9_remove_decompressor(pbi);
return 0;
return NULL;
}
pbi->common.error.setjmp = 1;
vp9_initialize_dec();
vp9_create_common(&pbi->common);
pbi->oxcf = *oxcf;
pbi->oxcf = *oxcf;
pbi->common.current_video_frame = 0;
pbi->ready_for_new_data = 1;
/* vp9_init_de_quantizer() is first called here. Add check in
* frame_init_dequantizer() to avoid unnecessary calling of
* vp9_init_de_quantizer() for every frame.
*/
// vp9_init_de_quantizer() is first called here. Add check in
// frame_init_dequantizer() to avoid unnecessary calling of
// vp9_init_de_quantizer() for every frame.
vp9_init_de_quantizer(pbi);
vp9_loop_filter_init(&pbi->common);
pbi->common.error.setjmp = 0;
pbi->decoded_key_frame = 0;
return (VP9D_PTR) pbi;
return pbi;
}
void vp9_remove_decompressor(VP9D_PTR ptr) {
VP9D_COMP *pbi = (VP9D_COMP *) ptr;
VP9D_COMP *const pbi = (VP9D_COMP *)ptr;
if (!pbi)
return;
// Delete segmentation map
if (pbi->common.last_frame_seg_map)
vpx_free(pbi->common.last_frame_seg_map);
......@@ -273,24 +270,23 @@ static void swap_frame_buffers(VP9D_COMP *pbi) {
pbi->common.active_ref_idx[ref_index] = INT_MAX;
}
int vp9_receive_compressed_data(VP9D_PTR ptr, unsigned long size,
const unsigned char **psource,
int vp9_receive_compressed_data(VP9D_PTR ptr,
uint64_t size, const uint8_t **psource,
int64_t time_stamp) {
VP9D_COMP *pbi = (VP9D_COMP *) ptr;
VP9_COMMON *cm = &pbi->common;
const unsigned char *source = *psource;
const uint8_t *source = *psource;
int retcode = 0;
/*if(pbi->ready_for_new_data == 0)
return -1;*/
if (ptr == 0) {
if (ptr == 0)
return -1;
}
pbi->common.error.error_code = VPX_CODEC_OK;
pbi->Source = source;
pbi->source = source;
pbi->source_sz = size;
if (pbi->source_sz == 0) {
......@@ -325,6 +321,7 @@ int vp9_receive_compressed_data(VP9D_PTR ptr, unsigned long size,
if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
return -1;
}
......
......@@ -25,13 +25,12 @@ typedef struct VP9Decompressor {
VP9D_CONFIG oxcf;
const unsigned char *Source;
unsigned int source_sz;
const uint8_t *source;
uint32_t source_sz;
vp9_reader *mbc;
int64_t last_time_stamp;
int ready_for_new_data;
int ready_for_new_data;
int refresh_frame_flags;
vp9_prob prob_skip_false;
......@@ -42,7 +41,7 @@ typedef struct VP9Decompressor {
int initial_height;
} VP9D_COMP;
int vp9_decode_frame(VP9D_COMP *cpi, const unsigned char **p_data_end);
int vp9_decode_frame(VP9D_COMP *cpi, const uint8_t **p_data_end);
#if CONFIG_DEBUG
......
......@@ -329,9 +329,9 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
vp9_initialize_dec();
oxcf.Width = ctx->si.w;
oxcf.Height = ctx->si.h;
oxcf.Version = 9;
oxcf.width = ctx->si.w;
oxcf.height = ctx->si.h;
oxcf.version = 9;
oxcf.postprocess = 0;
oxcf.max_threads = ctx->cfg.threads;
oxcf.inv_tile_order = ctx->invert_tile_order;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment