Adjust style to match Google Coding Style a little more closely.
Most of these were picked up in the previous commit (prefix change from vp8_ to vp9_), but I'm pushing this separately so that it's easier to review. Change-Id: Ifce2cdd6f008f4b1fbc2d89b5196d75e35fe115d
This commit is contained in:
@@ -43,21 +43,27 @@ extern "C"
|
||||
VP8D_OK = 0
|
||||
} VP8D_SETTING;
|
||||
|
||||
void vp9dx_initialize(void);
|
||||
void vp9_initialize_dec(void);
|
||||
|
||||
void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x);
|
||||
int vp9_receive_compressed_data(VP8D_PTR comp, unsigned long size,
|
||||
const unsigned char *dest,
|
||||
int64_t time_stamp);
|
||||
|
||||
int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst);
|
||||
int vp9_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd,
|
||||
int64_t *time_stamp, int64_t *time_end_stamp,
|
||||
vp8_ppflags_t *flags);
|
||||
|
||||
int vp9dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, int64_t time_stamp);
|
||||
int vp9dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags);
|
||||
vpx_codec_err_t vp9_get_reference_dec(VP8D_PTR comp,
|
||||
VP8_REFFRAME ref_frame_flag,
|
||||
YV12_BUFFER_CONFIG *sd);
|
||||
|
||||
vpx_codec_err_t vp9dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
|
||||
vpx_codec_err_t vp9dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
|
||||
vpx_codec_err_t vp9_set_reference_dec(VP8D_PTR comp,
|
||||
VP8_REFFRAME ref_frame_flag,
|
||||
YV12_BUFFER_CONFIG *sd);
|
||||
|
||||
VP8D_PTR vp9dx_create_decompressor(VP8D_CONFIG *oxcf);
|
||||
VP8D_PTR vp9_create_decompressor(VP8D_CONFIG *oxcf);
|
||||
|
||||
void vp9dx_remove_decompressor(VP8D_PTR comp);
|
||||
void vp9_remove_decompressor(VP8D_PTR comp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
int vp9dx_start_decode(BOOL_DECODER *br,
|
||||
const unsigned char *source,
|
||||
unsigned int source_sz) {
|
||||
int vp9_start_decode(BOOL_DECODER *br,
|
||||
const unsigned char *source,
|
||||
unsigned int source_sz) {
|
||||
br->user_buffer_end = source + source_sz;
|
||||
br->user_buffer = source;
|
||||
br->value = 0;
|
||||
@@ -26,13 +26,13 @@ int vp9dx_start_decode(BOOL_DECODER *br,
|
||||
return 1;
|
||||
|
||||
/* Populate the buffer */
|
||||
vp9dx_bool_decoder_fill(br);
|
||||
vp9_bool_decoder_fill(br);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void vp9dx_bool_decoder_fill(BOOL_DECODER *br) {
|
||||
void vp9_bool_decoder_fill(BOOL_DECODER *br) {
|
||||
const unsigned char *bufptr;
|
||||
const unsigned char *bufend;
|
||||
VP8_BD_VALUE value;
|
||||
|
||||
@@ -35,11 +35,11 @@ typedef struct {
|
||||
|
||||
DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
|
||||
|
||||
int vp9dx_start_decode(BOOL_DECODER *br,
|
||||
const unsigned char *source,
|
||||
unsigned int source_sz);
|
||||
int vp9_start_decode(BOOL_DECODER *br,
|
||||
const unsigned char *source,
|
||||
unsigned int source_sz);
|
||||
|
||||
void vp9dx_bool_decoder_fill(BOOL_DECODER *br);
|
||||
void vp9_bool_decoder_fill(BOOL_DECODER *br);
|
||||
|
||||
int vp9_decode_uniform(BOOL_DECODER *br, int n);
|
||||
int vp9_decode_term_subexp(BOOL_DECODER *br, int k, int num_syms);
|
||||
@@ -87,7 +87,7 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) {
|
||||
split = 1 + (((br->range - 1) * probability) >> 8);
|
||||
|
||||
if (br->count < 0)
|
||||
vp9dx_bool_decoder_fill(br);
|
||||
vp9_bool_decoder_fill(br);
|
||||
|
||||
value = br->value;
|
||||
count = br->count;
|
||||
|
||||
@@ -72,7 +72,7 @@ static vp8_prob read_prob_diff_update(vp8_reader *const bc, int oldp) {
|
||||
return (vp8_prob)inv_remap_prob(delp, oldp);
|
||||
}
|
||||
|
||||
void vp9cx_init_de_quantizer(VP8D_COMP *pbi) {
|
||||
void vp9_init_de_quantizer(VP8D_COMP *pbi) {
|
||||
int i;
|
||||
int Q;
|
||||
VP8_COMMON *const pc = &pbi->common;
|
||||
@@ -729,7 +729,7 @@ static void setup_token_decoder(VP8D_COMP *pbi,
|
||||
"%d length", 1);
|
||||
}
|
||||
|
||||
if (vp9dx_start_decode(bool_decoder, partition, partition_size))
|
||||
if (vp9_start_decode(bool_decoder, partition, partition_size))
|
||||
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
|
||||
"Failed to allocate bool decoder %d", 1);
|
||||
}
|
||||
@@ -986,7 +986,7 @@ int vp9_decode_frame(VP8D_COMP *pbi) {
|
||||
|
||||
init_frame(pbi);
|
||||
|
||||
if (vp9dx_start_decode(&header_bc, data, first_partition_length_in_bytes))
|
||||
if (vp9_start_decode(&header_bc, data, first_partition_length_in_bytes))
|
||||
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
|
||||
"Failed to allocate bool decoder 0");
|
||||
if (pc->frame_type == KEY_FRAME) {
|
||||
@@ -1143,7 +1143,7 @@ int vp9_decode_frame(VP8D_COMP *pbi) {
|
||||
pc->uvac_delta_q = get_delta_q(&header_bc, pc->uvac_delta_q, &q_update);
|
||||
|
||||
if (q_update)
|
||||
vp9cx_init_de_quantizer(pbi);
|
||||
vp9_init_de_quantizer(pbi);
|
||||
|
||||
/* MB level dequantizer setup */
|
||||
mb_init_dequantizer(pbi, &pbi->mb);
|
||||
|
||||
@@ -21,8 +21,10 @@ extern void vp8_short_idct8x8_c(short *input, short *output, int pitch);
|
||||
extern void vp8_short_idct8x8_1_c(short *input, short *output, int pitch);
|
||||
|
||||
#if CONFIG_LOSSLESS
|
||||
extern void vp8_short_inv_walsh4x4_x8_c(short *input, short *output, int pitch);
|
||||
extern void vp8_short_inv_walsh4x4_1_x8_c(short *input, short *output, int pitch);
|
||||
extern void vp8_short_inv_walsh4x4_x8_c(short *input, short *output,
|
||||
int pitch);
|
||||
extern void vp8_short_inv_walsh4x4_1_x8_c(short *input, short *output,
|
||||
int pitch);
|
||||
#endif
|
||||
|
||||
#ifdef DEC_DEBUG
|
||||
@@ -195,8 +197,9 @@ void vp9_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred,
|
||||
}
|
||||
|
||||
#if CONFIG_LOSSLESS
|
||||
void vp9_dequant_idct_add_lossless_c(short *input, short *dq, unsigned char *pred,
|
||||
unsigned char *dest, int pitch, int stride) {
|
||||
void vp9_dequant_idct_add_lossless_c(short *input, short *dq,
|
||||
unsigned char *pred, unsigned char *dest,
|
||||
int pitch, int stride) {
|
||||
short output[16];
|
||||
short *diff_ptr = output;
|
||||
int r, c;
|
||||
@@ -229,15 +232,16 @@ void vp9_dequant_idct_add_lossless_c(short *input, short *dq, unsigned char *pre
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_dequant_dc_idct_add_lossless_c(short *input, short *dq, unsigned char *pred,
|
||||
unsigned char *dest, int pitch, int stride,
|
||||
int Dc) {
|
||||
void vp9_dequant_dc_idct_add_lossless_c(short *input, short *dq,
|
||||
unsigned char *pred,
|
||||
unsigned char *dest,
|
||||
int pitch, int stride, int dc) {
|
||||
int i;
|
||||
short output[16];
|
||||
short *diff_ptr = output;
|
||||
int r, c;
|
||||
|
||||
input[0] = (short)Dc;
|
||||
input[0] = (short)dc;
|
||||
|
||||
for (i = 1; i < 16; i++) {
|
||||
input[i] = dq[i] * input[i];
|
||||
@@ -288,7 +292,7 @@ void vp9_dequantize_b_2x2_c(BLOCKD *d) {
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_8x8_c(short *input, short *dq, unsigned char *pred,
|
||||
unsigned char *dest, int pitch, int stride) { // , MACROBLOCKD *xd, short blk_idx
|
||||
unsigned char *dest, int pitch, int stride) {
|
||||
short output[64];
|
||||
short *diff_ptr = output;
|
||||
int r, c, b;
|
||||
|
||||
@@ -256,7 +256,7 @@ static int vp8_get_signed(BOOL_DECODER *br, int value_to_sign) {
|
||||
int v;
|
||||
|
||||
if (br->count < 0)
|
||||
vp9dx_bool_decoder_fill(br);
|
||||
vp9_bool_decoder_fill(br);
|
||||
|
||||
if (br->value < bigsplit) {
|
||||
br->range = split;
|
||||
|
||||
@@ -20,15 +20,19 @@ void vp9_dequant_idct_add_c(short *input, short *dq, unsigned char *pred,
|
||||
void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr,
|
||||
unsigned char *dst_ptr, int pitch, int stride);
|
||||
#if CONFIG_LOSSLESS
|
||||
void vp9_dequant_idct_add_lossless_c(short *input, short *dq, unsigned char *pred,
|
||||
unsigned char *dest, int pitch, int stride);
|
||||
void vp9_dequant_idct_add_lossless_c(short *input, short *dq,
|
||||
unsigned char *pred, unsigned char *dest,
|
||||
int pitch, int stride);
|
||||
void vp8_dc_only_idct_add_lossless_c(short input_dc, unsigned char *pred_ptr,
|
||||
unsigned char *dst_ptr, int pitch, int stride);
|
||||
unsigned char *dst_ptr,
|
||||
int pitch, int stride);
|
||||
#endif
|
||||
|
||||
void vp9_dequant_dc_idct_add_y_block_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs, short *dc) {
|
||||
void vp9_dequant_dc_idct_add_y_block_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs,
|
||||
short *dc) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -49,9 +53,10 @@ void vp9_dequant_dc_idct_add_y_block_c
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_y_block_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs) {
|
||||
void vp9_dequant_idct_add_y_block_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -73,9 +78,9 @@ void vp9_dequant_idct_add_y_block_c
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_uv_block_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) {
|
||||
void vp9_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dstu, unsigned char *dstv,
|
||||
int stride, char *eobs) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
@@ -116,48 +121,57 @@ void vp9_dequant_idct_add_uv_block_c
|
||||
}
|
||||
|
||||
|
||||
void vp9_dequant_dc_idct_add_y_block_8x8_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs, short *dc, MACROBLOCKD *xd) {
|
||||
|
||||
void vp9_dequant_dc_idct_add_y_block_8x8_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs, short *dc,
|
||||
MACROBLOCKD *xd) {
|
||||
vp9_dequant_dc_idct_add_8x8_c(q, dq, pre, dst, 16, stride, dc[0]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[64], dq, pre + 8, dst + 8, 16, stride, dc[1]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[128], dq, pre + 8 * 16, dst + 8 * stride, 16, stride, dc[4]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[192], dq, pre + 8 * 16 + 8, dst + 8 * stride + 8, 16, stride, dc[8]);
|
||||
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[128], dq, pre + 8 * 16,
|
||||
dst + 8 * stride, 16, stride, dc[4]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[192], dq, pre + 8 * 16 + 8,
|
||||
dst + 8 * stride + 8, 16, stride, dc[8]);
|
||||
}
|
||||
|
||||
#if CONFIG_SUPERBLOCKS
|
||||
void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c
|
||||
(short *q, short *dq,
|
||||
unsigned char *dst, int stride, char *eobs, short *dc, MACROBLOCKD *xd) {
|
||||
|
||||
void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, short *dq,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs,
|
||||
short *dc, MACROBLOCKD *xd) {
|
||||
vp9_dequant_dc_idct_add_8x8_c(q, dq, dst, dst, stride, stride, dc[0]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[64], dq, dst + 8, dst + 8, stride, stride, dc[1]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[128], dq, dst + 8 * stride, dst + 8 * stride, stride, stride, dc[4]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8, dst + 8 * stride + 8, stride, stride, dc[8]);
|
||||
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[64], dq, dst + 8,
|
||||
dst + 8, stride, stride, dc[1]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[128], dq, dst + 8 * stride,
|
||||
dst + 8 * stride, stride, stride, dc[4]);
|
||||
vp9_dequant_dc_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8,
|
||||
dst + 8 * stride + 8, stride, stride, dc[8]);
|
||||
}
|
||||
#endif
|
||||
|
||||
void vp9_dequant_idct_add_y_block_8x8_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs, MACROBLOCKD *xd) {
|
||||
|
||||
|
||||
void vp9_dequant_idct_add_y_block_8x8_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs,
|
||||
MACROBLOCKD *xd) {
|
||||
unsigned char *origdest = dst;
|
||||
unsigned char *origpred = pre;
|
||||
|
||||
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride);
|
||||
vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8, origdest + 8, 16, stride);
|
||||
vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16, origdest + 8 * stride, 16, stride);
|
||||
vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8, origdest + 8 * stride + 8, 16, stride);
|
||||
|
||||
vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
|
||||
origdest + 8, 16, stride);
|
||||
vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
|
||||
origdest + 8 * stride, 16, stride);
|
||||
vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
|
||||
origdest + 8 * stride + 8, 16, stride);
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_uv_block_8x8_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dstu, unsigned char *dstv, int stride, char *eobs, MACROBLOCKD *xd) {
|
||||
void vp9_dequant_idct_add_uv_block_8x8_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dstu,
|
||||
unsigned char *dstv,
|
||||
int stride, char *eobs,
|
||||
MACROBLOCKD *xd) {
|
||||
vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride);
|
||||
|
||||
q += 64;
|
||||
@@ -167,9 +181,11 @@ void vp9_dequant_idct_add_uv_block_8x8_c
|
||||
}
|
||||
|
||||
#if CONFIG_SUPERBLOCKS
|
||||
void vp9_dequant_idct_add_uv_block_8x8_inplace_c
|
||||
(short *q, short *dq,
|
||||
unsigned char *dstu, unsigned char *dstv, int stride, char *eobs, MACROBLOCKD *xd) {
|
||||
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq,
|
||||
unsigned char *dstu,
|
||||
unsigned char *dstv,
|
||||
int stride, char *eobs,
|
||||
MACROBLOCKD *xd) {
|
||||
vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride);
|
||||
|
||||
q += 64;
|
||||
@@ -179,9 +195,11 @@ void vp9_dequant_idct_add_uv_block_8x8_inplace_c
|
||||
#endif
|
||||
|
||||
#if CONFIG_LOSSLESS
|
||||
void vp9_dequant_dc_idct_add_y_block_lossless_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs, short *dc) {
|
||||
void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs,
|
||||
short *dc) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -202,9 +220,10 @@ void vp9_dequant_dc_idct_add_y_block_lossless_c
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_y_block_lossless_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dst, int stride, char *eobs) {
|
||||
void vp9_dequant_idct_add_y_block_lossless_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dst,
|
||||
int stride, char *eobs) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -226,9 +245,11 @@ void vp9_dequant_idct_add_y_block_lossless_c
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_dequant_idct_add_uv_block_lossless_c
|
||||
(short *q, short *dq, unsigned char *pre,
|
||||
unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) {
|
||||
void vp9_dequant_idct_add_uv_block_lossless_c(short *q, short *dq,
|
||||
unsigned char *pre,
|
||||
unsigned char *dstu,
|
||||
unsigned char *dstv,
|
||||
int stride, char *eobs) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#endif
|
||||
|
||||
extern void vp8_init_loop_filter(VP8_COMMON *cm);
|
||||
extern void vp9cx_init_de_quantizer(VP8D_COMP *pbi);
|
||||
extern void vp9_init_de_quantizer(VP8D_COMP *pbi);
|
||||
static int get_free_fb(VP8_COMMON *cm);
|
||||
static void ref_cnt_fb(int *buf, int *idx, int new_idx);
|
||||
|
||||
@@ -104,7 +104,7 @@ void write_dx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void vp9dx_initialize() {
|
||||
void vp9_initialize_dec(void) {
|
||||
static int init_done = 0;
|
||||
|
||||
if (!init_done) {
|
||||
@@ -115,7 +115,7 @@ void vp9dx_initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
VP8D_PTR vp9dx_create_decompressor(VP8D_CONFIG *oxcf) {
|
||||
VP8D_PTR vp9_create_decompressor(VP8D_CONFIG *oxcf) {
|
||||
VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));
|
||||
|
||||
if (!pbi)
|
||||
@@ -125,22 +125,23 @@ VP8D_PTR vp9dx_create_decompressor(VP8D_CONFIG *oxcf) {
|
||||
|
||||
if (setjmp(pbi->common.error.jmp)) {
|
||||
pbi->common.error.setjmp = 0;
|
||||
vp9dx_remove_decompressor(pbi);
|
||||
vp9_remove_decompressor(pbi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pbi->common.error.setjmp = 1;
|
||||
vp9dx_initialize();
|
||||
vp9_initialize_dec();
|
||||
|
||||
vp8_create_common(&pbi->common);
|
||||
|
||||
pbi->common.current_video_frame = 0;
|
||||
pbi->ready_for_new_data = 1;
|
||||
|
||||
/* vp9cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
|
||||
* unnecessary calling of vp8cx_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.
|
||||
*/
|
||||
vp9cx_init_de_quantizer(pbi);
|
||||
vp9_init_de_quantizer(pbi);
|
||||
|
||||
vp8_loop_filter_init(&pbi->common);
|
||||
|
||||
@@ -151,7 +152,7 @@ VP8D_PTR vp9dx_create_decompressor(VP8D_CONFIG *oxcf) {
|
||||
return (VP8D_PTR) pbi;
|
||||
}
|
||||
|
||||
void vp9dx_remove_decompressor(VP8D_PTR ptr) {
|
||||
void vp9_remove_decompressor(VP8D_PTR ptr) {
|
||||
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
|
||||
|
||||
if (!pbi)
|
||||
@@ -167,7 +168,8 @@ void vp9dx_remove_decompressor(VP8D_PTR ptr) {
|
||||
}
|
||||
|
||||
|
||||
vpx_codec_err_t vp9dx_get_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) {
|
||||
vpx_codec_err_t vp9_get_reference_dec(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag,
|
||||
YV12_BUFFER_CONFIG *sd) {
|
||||
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
|
||||
VP8_COMMON *cm = &pbi->common;
|
||||
int ref_fb_idx;
|
||||
@@ -197,7 +199,8 @@ vpx_codec_err_t vp9dx_get_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, Y
|
||||
}
|
||||
|
||||
|
||||
vpx_codec_err_t vp9dx_set_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) {
|
||||
vpx_codec_err_t vp9_set_reference_dec(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag,
|
||||
YV12_BUFFER_CONFIG *sd) {
|
||||
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
|
||||
VP8_COMMON *cm = &pbi->common;
|
||||
int *ref_fb_ptr = NULL;
|
||||
@@ -331,7 +334,9 @@ static void vp8_print_yuv_rec_mb(VP8_COMMON *cm, int mb_row, int mb_col)
|
||||
}
|
||||
*/
|
||||
|
||||
int vp9dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsigned char *source, int64_t time_stamp) {
|
||||
int vp9_receive_compressed_data(VP8D_PTR ptr, unsigned long size,
|
||||
const unsigned char *source,
|
||||
int64_t time_stamp) {
|
||||
#if HAVE_ARMV7
|
||||
int64_t dx_store_reg[8];
|
||||
#endif
|
||||
@@ -459,7 +464,8 @@ int vp9dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
|
||||
(cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
|
||||
}
|
||||
|
||||
/*vp8_print_modes_and_motion_vectors( cm->mi, cm->mb_rows,cm->mb_cols, cm->current_video_frame);*/
|
||||
/*vp8_print_modes_and_motion_vectors(cm->mi, cm->mb_rows,cm->mb_cols,
|
||||
cm->current_video_frame);*/
|
||||
|
||||
if (cm->show_frame)
|
||||
cm->current_video_frame++;
|
||||
@@ -479,7 +485,10 @@ int vp9dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
|
||||
pbi->common.error.setjmp = 0;
|
||||
return retcode;
|
||||
}
|
||||
int vp9dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags) {
|
||||
|
||||
int vp9_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd,
|
||||
int64_t *time_stamp, int64_t *time_end_stamp,
|
||||
vp8_ppflags_t *flags) {
|
||||
int ret = -1;
|
||||
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
|
||||
|
||||
|
||||
@@ -24,17 +24,20 @@ void vp9_dequant_dc_idct_add_y_block_mmx
|
||||
vp9_dc_only_idct_add_mmx(dc[0], pre, dst, 16, stride);
|
||||
|
||||
if (eobs[1] > 1)
|
||||
vp9_dequant_dc_idct_add_mmx(q + 16, dq, pre + 4, dst + 4, 16, stride, dc[1]);
|
||||
vp9_dequant_dc_idct_add_mmx(q + 16, dq, pre + 4,
|
||||
dst + 4, 16, stride, dc[1]);
|
||||
else
|
||||
vp9_dc_only_idct_add_mmx(dc[1], pre + 4, dst + 4, 16, stride);
|
||||
|
||||
if (eobs[2] > 1)
|
||||
vp9_dequant_dc_idct_add_mmx(q + 32, dq, pre + 8, dst + 8, 16, stride, dc[2]);
|
||||
vp9_dequant_dc_idct_add_mmx(q + 32, dq, pre + 8,
|
||||
dst + 8, 16, stride, dc[2]);
|
||||
else
|
||||
vp9_dc_only_idct_add_mmx(dc[2], pre + 8, dst + 8, 16, stride);
|
||||
|
||||
if (eobs[3] > 1)
|
||||
vp9_dequant_dc_idct_add_mmx(q + 48, dq, pre + 12, dst + 12, 16, stride, dc[3]);
|
||||
vp9_dequant_dc_idct_add_mmx(q + 48, dq, pre + 12,
|
||||
dst + 12, 16, stride, dc[3]);
|
||||
else
|
||||
vp9_dc_only_idct_add_mmx(dc[3], pre + 12, dst + 12, 16, stride);
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ struct vpx_codec_alg_priv {
|
||||
int img_avail;
|
||||
};
|
||||
|
||||
static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t flags) {
|
||||
static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si,
|
||||
vpx_codec_flags_t flags) {
|
||||
/* Although this declaration is constant, we can't use it in the requested
|
||||
* segments list because we want to define the requested segments list
|
||||
* before defining the private type (so that the number of memory maps is
|
||||
@@ -98,8 +99,8 @@ static vpx_codec_err_t vp8_mmap_alloc(vpx_codec_mmap_t *mmap) {
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_validate_mmaps(const vp8_stream_info_t *si,
|
||||
const vpx_codec_mmap_t *mmaps,
|
||||
vpx_codec_flags_t init_flags) {
|
||||
const vpx_codec_mmap_t *mmaps,
|
||||
vpx_codec_flags_t init_flags) {
|
||||
int i;
|
||||
vpx_codec_err_t res = VPX_CODEC_OK;
|
||||
|
||||
@@ -193,7 +194,7 @@ static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx) {
|
||||
static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) {
|
||||
int i;
|
||||
|
||||
vp9dx_remove_decompressor(ctx->pbi);
|
||||
vp9_remove_decompressor(ctx->pbi);
|
||||
|
||||
for (i = NELEMENTS(ctx->mmaps) - 1; i >= 0; i--) {
|
||||
if (ctx->mmaps[i].dtor)
|
||||
@@ -353,14 +354,14 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
|
||||
VP8D_CONFIG oxcf;
|
||||
VP8D_PTR optr;
|
||||
|
||||
vp9dx_initialize();
|
||||
vp9_initialize_dec();
|
||||
|
||||
oxcf.Width = ctx->si.w;
|
||||
oxcf.Height = ctx->si.h;
|
||||
oxcf.Version = 9;
|
||||
oxcf.postprocess = 0;
|
||||
oxcf.max_threads = ctx->cfg.threads;
|
||||
optr = vp9dx_create_decompressor(&oxcf);
|
||||
optr = vp9_create_decompressor(&oxcf);
|
||||
|
||||
/* If postprocessing was enabled by the application and a
|
||||
* configuration has not been provided, default it.
|
||||
@@ -407,12 +408,13 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (vp9dx_receive_compressed_data(ctx->pbi, data_sz, data, deadline)) {
|
||||
if (vp9_receive_compressed_data(ctx->pbi, data_sz, data, deadline)) {
|
||||
VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi;
|
||||
res = update_error_state(ctx, &pbi->common.error);
|
||||
}
|
||||
|
||||
if (!res && 0 == vp9dx_get_raw_frame(ctx->pbi, &sd, &time_stamp, &time_end_stamp, &flags)) {
|
||||
if (!res && 0 == vp9_get_raw_frame(ctx->pbi, &sd, &time_stamp,
|
||||
&time_end_stamp, &flags)) {
|
||||
yuvconfig2image(&ctx->img, &sd, user_priv);
|
||||
ctx->img_avail = 1;
|
||||
}
|
||||
@@ -524,7 +526,8 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
|
||||
yv12->uv_stride = img->stride[VPX_PLANE_U];
|
||||
|
||||
yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2;
|
||||
yv12->clrtype = (img->fmt == VPX_IMG_FMT_VPXI420 || img->fmt == VPX_IMG_FMT_VPXYV12);
|
||||
yv12->clrtype = (img->fmt == VPX_IMG_FMT_VPXI420 ||
|
||||
img->fmt == VPX_IMG_FMT_VPXYV12);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -542,7 +545,7 @@ static vpx_codec_err_t vp9_set_reference(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
image2yuvconfig(&frame->img, &sd);
|
||||
|
||||
return vp9dx_set_reference(ctx->pbi, frame->frame_type, &sd);
|
||||
return vp9_set_reference_dec(ctx->pbi, frame->frame_type, &sd);
|
||||
} else
|
||||
return VPX_CODEC_INVALID_PARAM;
|
||||
|
||||
@@ -560,7 +563,7 @@ static vpx_codec_err_t vp9_get_reference(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
image2yuvconfig(&frame->img, &sd);
|
||||
|
||||
return vp9dx_get_reference(ctx->pbi, frame->frame_type, &sd);
|
||||
return vp9_get_reference_dec(ctx->pbi, frame->frame_type, &sd);
|
||||
} else
|
||||
return VPX_CODEC_INVALID_PARAM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user