diff options
Diffstat (limited to 'vp8/decoder')
-rw-r--r-- | vp8/decoder/decodemv.c | 7 | ||||
-rw-r--r-- | vp8/decoder/decodframe.c | 30 | ||||
-rw-r--r-- | vp8/decoder/dequantize.c | 11 | ||||
-rw-r--r-- | vp8/decoder/dequantize.h | 2 | ||||
-rw-r--r-- | vp8/decoder/detokenize.c | 19 | ||||
-rw-r--r-- | vp8/decoder/idct_blk.c | 29 | ||||
-rw-r--r-- | vp8/decoder/onyxd_if.c | 5 | ||||
-rw-r--r-- | vp8/decoder/onyxd_int.h | 10 |
8 files changed, 63 insertions, 50 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 815112ed3..f23fd00b4 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -18,8 +18,6 @@ #if CONFIG_DEBUG #include <assert.h> #endif -extern int frame_count; - static int vp8_read_bmode(vp8_reader *bc, const vp8_prob *p) { const int i = vp8_treed_read(bc, vp8_bmode_tree, p); @@ -62,7 +60,6 @@ static void vp8_read_mb_features(vp8_reader *r, MB_MODE_INFO *mi, MACROBLOCKD *x else mi->segment_id = (unsigned char)(vp8_read(r, x->mb_segment_tree_probs[1])); } - //printf("vp8_read_mb_features Segment = %d of frame %d\n", mi->segment_id, frame_count); } static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_col) @@ -80,7 +77,6 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co if (pbi->mb.update_mb_segmentation_map) vp8_read_mb_features(bc, &m->mbmi, &pbi->mb); - //printf("vp8_kfread_modes segment = %d\n", m->mbmi.segment_id); /* Read the macroblock coeff skip flag if this feature is in use, else default to 0 */ if (pbi->common.mb_no_coeff_skip) @@ -316,14 +312,12 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, { mbmi->segment_id = pbi->segmentation_map[index]; mbmi->segment_flag = 0; - //printf("vp8_read_mb_modes_mv Temporal Update if %d\n", mbmi->segment_id); } else { vp8_read_mb_features(bc, &mi->mbmi, &pbi->mb); mbmi->segment_flag = 1; pbi->segmentation_map[index] = mbmi->segment_id; - //printf("vp8_read_mb_modes_mv Temporal Update else %d\n", mbmi->segment_id); } } @@ -331,7 +325,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, { vp8_read_mb_features(bc, &mi->mbmi, &pbi->mb); pbi->segmentation_map[index] = mbmi->segment_id; - //printf("vp8_read_mb_modes_mv Not Temporal Update %d\n", mbmi->segment_id); } index++; #else diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 09fb6d0df..dbfe909ae 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -241,13 +241,14 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, if (eobtotal == 0 && mode != B_PRED && mode != SPLITMV) { /* Special case: Force the loopfilter to skip when eobtotal and - * mb_skip_coeff are zero. - * */ + * mb_skip_coeff are zero. + * */ xd->mode_info_context->mbmi.mb_skip_coeff = 1; skip_recon_mb(pbi, xd); return; } + if (xd->segmentation_enabled) mb_init_dequantizer(pbi, xd); @@ -259,7 +260,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, if (mode != B_PRED) { RECON_INVOKE(&pbi->common.rtcd.recon, - build_intra_predictors_mby)(xd); + build_intra_predictors_mby)(xd); } else { vp8_intra_prediction_down_copy(xd); } @@ -275,8 +276,8 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, vp8dx_bool_error(xd->current_bc))) { /* MB with corrupt residuals or corrupt mode/motion vectors. - * Better to use the predictor as reconstruction. - */ + * Better to use the predictor as reconstruction. + */ vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff)); vp8_conceal_corrupt_mb(xd); return; @@ -290,7 +291,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, { BLOCKD *b = &xd->block[i]; RECON_INVOKE(RTCD_VTABLE(recon), intra4x4_predict) - (b, b->bmi.as_mode, b->predictor); + (b, b->bmi.as_mode, b->predictor); if (xd->eobs[i] > 1) { @@ -306,6 +307,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, ((int *)b->qcoeff)[0] = 0; } } + } else if (mode == SPLITMV) { @@ -366,8 +368,6 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, else #endif - { - DEQUANT_INVOKE(&pbi->dequant, block)(b); if (xd->eobs[24] > 1) { IDCT_INVOKE(RTCD_VTABLE(idct), iwalsh16)(&b->dqcoeff[0], b->diff); @@ -390,7 +390,6 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, (xd->qcoeff, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, xd->dst.y_stride, xd->eobs, xd->block[24].diff); - } } #if CONFIG_T8X8 if(xd->mode_info_context->mbmi.segment_id >= 2) @@ -403,15 +402,13 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, } else #endif - { - DEQUANT_INVOKE (&pbi->dequant, idct_add_uv_block) - (xd->qcoeff+16*16, xd->block[16].dequant, - xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer, - xd->dst.uv_stride, xd->eobs+16); - } + DEQUANT_INVOKE (&pbi->dequant, idct_add_uv_block) + (xd->qcoeff+16*16, xd->block[16].dequant, + xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer, + xd->dst.uv_stride, xd->eobs+16); - } +} static int get_delta_q(vp8_reader *bc, int prev, int *q_update) @@ -749,6 +746,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) const unsigned char *data = (const unsigned char *)pbi->Source; const unsigned char *data_end = data + pbi->source_sz; ptrdiff_t first_partition_length_in_bytes; + int mb_row; int i, j, k, l; const int *const mb_feature_data_bits = vp8_mb_feature_data_bits; diff --git a/vp8/decoder/dequantize.c b/vp8/decoder/dequantize.c index 0e17cf9af..956acba8f 100644 --- a/vp8/decoder/dequantize.c +++ b/vp8/decoder/dequantize.c @@ -36,7 +36,7 @@ void vp8_dequantize_b_c(BLOCKD *d) for (i = 0; i < 16; i++) { - DQ[i] = Q[i] * DQC[i]; + DQ[i] = Q[i] * DQC[i]; } } @@ -50,12 +50,12 @@ void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred, for (i = 0; i < 16; i++) { - input[i] = dq[i] * input[i]; - + input[i] = dq[i] * input[i]; } /* the idct halves ( >> 1) the pitch */ vp8_short_idct4x4llm_c(input, output, 4 << 1); + vpx_memset(input, 0, 32); for (r = 0; r < 4; r++) @@ -88,17 +88,18 @@ void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred, short *diff_ptr = output; int r, c; - input[0] = (short)Dc; for (i = 1; i < 16; i++) { - input[i] = dq[i] * input[i]; + input[i] = dq[i] * input[i]; } /* the idct halves ( >> 1) the pitch */ vp8_short_idct4x4llm_c(input, output, 4 << 1); + vpx_memset(input, 0, 32); + for (r = 0; r < 4; r++) { for (c = 0; c < 4; c++) diff --git a/vp8/decoder/dequantize.h b/vp8/decoder/dequantize.h index 15d5bbe91..5ae6f9619 100644 --- a/vp8/decoder/dequantize.h +++ b/vp8/decoder/dequantize.h @@ -42,7 +42,7 @@ unsigned char *pre, unsigned char *dst_u, \ unsigned char *dst_v, int stride, char *eobs) -#if 1//CONFIG_T8X8 +#if CONFIG_T8X8 #define prototype_dequant_dc_idct_add_y_block_8x8(sym) \ void sym(short *q, short *dq, \ unsigned char *pre, unsigned char *dst, \ diff --git a/vp8/decoder/detokenize.c b/vp8/decoder/detokenize.c index 6d78e6022..6121490eb 100644 --- a/vp8/decoder/detokenize.c +++ b/vp8/decoder/detokenize.c @@ -59,7 +59,7 @@ typedef struct UINT8 Probs[14]; } TOKENEXTRABITS; */ - +#if CONFIG_EXTEND_QRANGE DECLARE_ALIGNED(16, static const TOKENEXTRABITS, vp8d_token_extra_bits2[MAX_ENTROPY_TOKENS]) = { { 0, -1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* ZERO_TOKEN */ @@ -75,6 +75,23 @@ DECLARE_ALIGNED(16, static const TOKENEXTRABITS, vp8d_token_extra_bits2[MAX_ENTR { 67, 12, { 129, 130, 133, 140, 153, 177, 196, 230, 243, 249, 252, 254, 254, 0 } }, /* DCT_VAL_CATEGORY6 */ { 0, -1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* EOB TOKEN */ }; +#else +DECLARE_ALIGNED(16, static const TOKENEXTRABITS, vp8d_token_extra_bits2[MAX_ENTROPY_TOKENS]) = +{ + { 0, -1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* ZERO_TOKEN */ + { 1, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* ONE_TOKEN */ + { 2, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* TWO_TOKEN */ + { 3, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* THREE_TOKEN */ + { 4, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* FOUR_TOKEN */ + { 5, 0, { 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* DCT_VAL_CATEGORY1 */ + { 7, 1, { 145, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* DCT_VAL_CATEGORY2 */ + { 11, 2, { 140, 148, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* DCT_VAL_CATEGORY3 */ + { 19, 3, { 135, 140, 155, 176, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* DCT_VAL_CATEGORY4 */ + { 35, 4, { 130, 134, 141, 157, 180, 0, 0, 0, 0, 0, 0, 0 } }, /* DCT_VAL_CATEGORY5 */ + { 67, 10, { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254, 0 } }, /* DCT_VAL_CATEGORY6 */ + { 0, -1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* EOB TOKEN */ +}; +#endif void vp8_reset_mb_tokens_context(MACROBLOCKD *x) diff --git a/vp8/decoder/idct_blk.c b/vp8/decoder/idct_blk.c index 44a223157..2015d5255 100644 --- a/vp8/decoder/idct_blk.c +++ b/vp8/decoder/idct_blk.c @@ -30,13 +30,10 @@ void vp8_dequant_dc_idct_add_y_block_c { for (j = 0; j < 4; j++) { - if (*eobs++ <= 1) - { - vp8_dc_only_idct_add_c (dc[0], pre, dst, 16, stride); - } - - else + if (*eobs++ > 1) vp8_dequant_dc_idct_add_c (q, dq, pre, dst, 16, stride, dc[0]); + else + vp8_dc_only_idct_add_c (dc[0], pre, dst, 16, stride); q += 16; pre += 4; @@ -59,13 +56,14 @@ void vp8_dequant_idct_add_y_block_c { for (j = 0; j < 4; j++) { - if (*eobs++ <= 1) + if (*eobs++ > 1) + vp8_dequant_idct_add_c (q, dq, pre, dst, 16, stride); + else { vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dst, 16, stride); ((int *)q)[0] = 0; } - else - vp8_dequant_idct_add_c (q, dq, pre, dst, 16, stride); + q += 16; pre += 4; dst += 4; @@ -86,13 +84,14 @@ void vp8_dequant_idct_add_uv_block_c { for (j = 0; j < 2; j++) { - if (*eobs++ <= 1) + if (*eobs++ > 1) + vp8_dequant_idct_add_c (q, dq, pre, dstu, 8, stride); + else { vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstu, 8, stride); ((int *)q)[0] = 0; } - else - vp8_dequant_idct_add_c (q, dq, pre, dstu, 8, stride); + q += 16; pre += 4; dstu += 4; @@ -106,14 +105,14 @@ void vp8_dequant_idct_add_uv_block_c { for (j = 0; j < 2; j++) { - if (*eobs++ <= 1) + if (*eobs++ > 1) + vp8_dequant_idct_add_c (q, dq, pre, dstv, 8, stride); + else { vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstv, 8, stride); ((int *)q)[0] = 0; } - else - vp8_dequant_idct_add_c (q, dq, pre, dstv, 8, stride); q += 16; pre += 4; dstv += 4; diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c index 1e2c3138f..b4d78d656 100644 --- a/vp8/decoder/onyxd_if.c +++ b/vp8/decoder/onyxd_if.c @@ -157,7 +157,7 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr) if (!pbi) return; #if CONFIG_SEGMENTATION - // Delete sementation map + // Delete sementation map if (pbi->segmentation_map != 0) vpx_free(pbi->segmentation_map); #endif @@ -514,8 +514,6 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign { /* Apply the loop filter if appropriate. */ vp8_loop_filter_frame(cm, &pbi->mb, cm->filter_level); - //vp8_print_yuv_rec_mb(cm, 9, 10); - cm->last_frame_type = cm->frame_type; cm->last_filter_type = cm->filter_type; @@ -554,7 +552,6 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign /*vp8_print_modes_and_motion_vectors( cm->mi, cm->mb_rows,cm->mb_cols, cm->current_video_frame);*/ - //printf("Decoded frame (%d) %d\n", cm->show_frame, cm->current_video_frame); if (cm->show_frame) cm->current_video_frame++; diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h index c31623dfa..6309915ab 100644 --- a/vp8/decoder/onyxd_int.h +++ b/vp8/decoder/onyxd_int.h @@ -44,13 +44,21 @@ typedef struct int size; } DATARATE; +#if CONFIG_EXTEND_QRANGE typedef struct { INT16 min_val; INT16 Length; UINT8 Probs[14]; } TOKENEXTRABITS; - +#else +typedef struct +{ + INT16 min_val; + INT16 Length; + UINT8 Probs[12]; +} TOKENEXTRABITS; +#endif typedef struct { int const *scan; |