diff options
Diffstat (limited to 'vp8/encoder/encodeframe.c')
-rw-r--r-- | vp8/encoder/encodeframe.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index f784cf434..adfbfc79b 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -120,8 +120,8 @@ static unsigned int tt_activity_measure(VP8_COMP *cpi, MACROBLOCK *x) { * lambda using a non-linear combination (e.g., the smallest, or second * smallest, etc.). */ - act = VARIANCE_INVOKE(&cpi->rtcd.variance, var16x16)(x->src.y_buffer, - x->src.y_stride, VP8_VAR_OFFS, 0, &sse); + act = vp8_variance16x16(x->src.y_buffer, x->src.y_stride, VP8_VAR_OFFS, 0, + &sse); act = act << 4; /* If the region is flat, lower the activity some more. */ @@ -222,7 +222,7 @@ static void calc_av_activity(VP8_COMP *cpi, int64_t activity_sum) { #if USE_ACT_INDEX // Calculate and activity index for each mb static void calc_activity_index(VP8_COMP *cpi, MACROBLOCK *x) { - VP8_COMMON *const cm = & cpi->common; + VP8_COMMON *const cm = &cpi->common; int mb_row, mb_col; int64_t act; @@ -276,9 +276,9 @@ static void calc_activity_index(VP8_COMP *cpi, MACROBLOCK *x) { // Loop through all MBs. Note activity of each, average activity and // calculate a normalized activity for each static void build_activity_map(VP8_COMP *cpi) { - MACROBLOCK *const x = & cpi->mb; + MACROBLOCK *const x = &cpi->mb; MACROBLOCKD *xd = &x->e_mbd; - VP8_COMMON *const cm = & cpi->common; + VP8_COMMON *const cm = &cpi->common; #if ALT_ACT_MEASURE YV12_BUFFER_CONFIG *new_yv12 = &cm->yv12_fb[cm->new_fb_idx]; @@ -1051,9 +1051,6 @@ static void encode_sb(VP8_COMP *cpi, cpi->inter_zz_count++; } - // TODO Partitioning is broken! - cpi->tplist[mb_row].stop = *tp; - #if CONFIG_SUPERBLOCKS if (xd->mode_info_context->mbmi.encoded_as_sb) { x->src.y_buffer += 32; @@ -1064,7 +1061,10 @@ static void encode_sb(VP8_COMP *cpi, x->partition_info += 2; xd->mode_info_context += 2; xd->prev_mode_info_context += 2; - + + (*tp)->Token = EOSB_TOKEN; + (*tp)++; + if (mb_row < cm->mb_rows) cpi->tplist[mb_row].stop = *tp; break; } #endif @@ -1086,6 +1086,9 @@ static void encode_sb(VP8_COMP *cpi, assert((xd->prev_mode_info_context - cpi->common.prev_mip) == (xd->mode_info_context - cpi->common.mip)); #endif + (*tp)->Token = EOSB_TOKEN; + (*tp)++; + if (mb_row < cm->mb_rows) cpi->tplist[mb_row].stop = *tp; } // debug output @@ -1216,9 +1219,9 @@ void encode_sb_row(VP8_COMP *cpi, } void init_encode_frame_mb_context(VP8_COMP *cpi) { - MACROBLOCK *const x = & cpi->mb; - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; + MACROBLOCK *const x = &cpi->mb; + VP8_COMMON *const cm = &cpi->common; + MACROBLOCKD *const xd = &x->e_mbd; // GF active flags data structure x->gf_active_ptr = (signed char *)cpi->gf_active_flags; @@ -1287,9 +1290,9 @@ void init_encode_frame_mb_context(VP8_COMP *cpi) { static void encode_frame_internal(VP8_COMP *cpi) { int mb_row; - MACROBLOCK *const x = & cpi->mb; - VP8_COMMON *const cm = & cpi->common; - MACROBLOCKD *const xd = & x->e_mbd; + MACROBLOCK *const x = &cpi->mb; + VP8_COMMON *const cm = &cpi->common; + MACROBLOCKD *const xd = &x->e_mbd; TOKENEXTRA *tp = cpi->tok; int totalrate; @@ -1719,7 +1722,7 @@ void vp8_build_block_offsets(MACROBLOCK *x) { } static void sum_intra_stats(VP8_COMP *cpi, MACROBLOCK *x) { - const MACROBLOCKD *xd = & x->e_mbd; + const MACROBLOCKD *xd = &x->e_mbd; const MB_PREDICTION_MODE m = xd->mode_info_context->mbmi.mode; const MB_PREDICTION_MODE uvm = xd->mode_info_context->mbmi.uv_mode; @@ -1928,7 +1931,7 @@ void vp8cx_encode_intra_super_block(VP8_COMP *cpi, update_sb_skip_coeff_state(cpi, x, ta, tl, tp, t, skip); } } -#endif +#endif /* CONFIG_SUPERBLOCKS */ void vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, @@ -1939,14 +1942,15 @@ void vp8cx_encode_intra_macro_block(VP8_COMP *cpi, adjust_act_zbin(cpi, x); vp8_update_zbin_extra(cpi, x); } - if (mbmi->mode == I8X8_PRED) { vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra8x8mbuv(IF_RTCD(&cpi->rtcd), x); - } else if (mbmi->mode == B_PRED) + } else if (mbmi->mode == B_PRED) { + vp8_intra_prediction_down_copy(&x->e_mbd); vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x); - else + } else { vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x); + } if (mbmi->mode != I8X8_PRED) { vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); @@ -2047,6 +2051,7 @@ void vp8cx_encode_inter_macroblock (VP8_COMP *cpi, MACROBLOCK *x, if (mbmi->ref_frame == INTRA_FRAME) { if (mbmi->mode == B_PRED) { + vp8_intra_prediction_down_copy(xd); vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x); } else if (mbmi->mode == I8X8_PRED) { |