diff options
author | John Koleszar <jkoleszar@google.com> | 2012-10-16 13:52:39 -0700 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2012-10-17 13:19:41 -0700 |
commit | 6ef5a00538d6862634ce7d95507e9d4d3e037736 (patch) | |
tree | fd55128f5df62084759eb08424ad3b5ad5497546 /vp8/decoder | |
parent | c073e5ca96bc5cf2e20c1c6cbc000be025b2e008 (diff) | |
download | libvpx-6ef5a00538d6862634ce7d95507e9d4d3e037736.tar libvpx-6ef5a00538d6862634ce7d95507e9d4d3e037736.tar.gz libvpx-6ef5a00538d6862634ce7d95507e9d4d3e037736.tar.bz2 libvpx-6ef5a00538d6862634ce7d95507e9d4d3e037736.zip |
Interleave modes/residual per macroblock
Packs the bitstream with each mb's residual following its mode/mv
information.
TODO: There are still a few fields that should be packed into partition
0 but are included in partition 1, due to them being serialized from
write_kfmodes/pack_inter_mode_mvs, which execute after the first
partition is finalized. These need to be separated out into a separate
function, similar to mb_mode_mv_init() in decodemv.c.
Change-Id: I43a46c363601ab36954d07ebe498760e1e2e3af4
Diffstat (limited to 'vp8/decoder')
-rw-r--r-- | vp8/decoder/decodemv.c | 14 | ||||
-rw-r--r-- | vp8/decoder/decodframe.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 4408ae7f9..c5fc6d58d 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -78,7 +78,7 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, int mb_row, int mb_col) { VP8_COMMON *const cm = & pbi->common; - vp8_reader *const bc = & pbi->bc; + vp8_reader *const bc = pbi->mb.current_bc; const int mis = pbi->common.mode_info_stride; int map_index = mb_row * pbi->common.mb_cols + mb_col; MB_PREDICTION_MODE y_mode; @@ -612,9 +612,8 @@ static void read_switchable_interp_probs(VP8D_COMP *pbi) { } #endif -static void mb_mode_mv_init(VP8D_COMP *pbi) { +static void mb_mode_mv_init(VP8D_COMP *pbi, vp8_reader *bc) { VP8_COMMON *const cm = & pbi->common; - vp8_reader *const bc = & pbi->bc; #if CONFIG_NEWMVENTROPY nmv_context *const nmvc = &pbi->common.fc.nmvc; #else @@ -682,9 +681,9 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) { // value static void read_mb_segment_id(VP8D_COMP *pbi, int mb_row, int mb_col) { - vp8_reader *const bc = & pbi->bc; VP8_COMMON *const cm = & pbi->common; MACROBLOCKD *const xd = & pbi->mb; + vp8_reader *const bc = xd->current_bc; MODE_INFO *mi = xd->mode_info_context; MB_MODE_INFO *mbmi = &mi->mbmi; int index = mb_row * pbi->common.mb_cols + mb_col; @@ -755,7 +754,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, MODE_INFO *prev_mi, int mb_row, int mb_col) { VP8_COMMON *const cm = & pbi->common; - vp8_reader *const bc = & pbi->bc; #if CONFIG_NEWMVENTROPY nmv_context *const nmvc = &pbi->common.fc.nmvc; #else @@ -764,6 +762,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, #endif const int mis = pbi->common.mode_info_stride; MACROBLOCKD *const xd = & pbi->mb; + vp8_reader *const bc = xd->current_bc; int_mv *const mv = & mbmi->mv; int mb_to_left_edge; @@ -1304,9 +1303,10 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, void vpx_decode_mode_mvs_init(VP8D_COMP *pbi){ VP8_COMMON *cm = &pbi->common; - mb_mode_mv_init(pbi); + + mb_mode_mv_init(pbi, pbi->mb.current_bc); if (cm->frame_type == KEY_FRAME && !cm->kf_ymode_probs_update) - cm->kf_ymode_probs_index = vp8_read_literal(&pbi->bc, 3); + cm->kf_ymode_probs_index = vp8_read_literal(pbi->mb.current_bc, 3); } void vpx_decode_mb_mode_mv(VP8D_COMP *pbi, MACROBLOCKD *xd, diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index bcf6ea3d4..4d12d7a3e 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -1149,7 +1149,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) { init_frame(pbi); - if (vp8dx_start_decode(bc, data, data_end - data)) + if (vp8dx_start_decode(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) { |