diff options
author | John Koleszar <jkoleszar@google.com> | 2012-10-17 15:15:59 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2012-10-17 15:15:59 -0700 |
commit | cdd0ed13524f18c062b82bccdae057c40d33eef7 (patch) | |
tree | b3e19bfe4fca32de0ce19baa1890f6a1bf8b0c0c /vp8/encoder/bitstream.c | |
parent | c6f13f32784330350f176f453c8a4c2a9f6b90a6 (diff) | |
parent | 17fd972aea132a9867e20bb9e5588969b19669a3 (diff) | |
download | libvpx-cdd0ed13524f18c062b82bccdae057c40d33eef7.tar libvpx-cdd0ed13524f18c062b82bccdae057c40d33eef7.tar.gz libvpx-cdd0ed13524f18c062b82bccdae057c40d33eef7.tar.bz2 libvpx-cdd0ed13524f18c062b82bccdae057c40d33eef7.zip |
Merge "consolidate update_mb_segmentation_map data" into experimental
Diffstat (limited to 'vp8/encoder/bitstream.c')
-rw-r--r-- | vp8/encoder/bitstream.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index d69650630..cd779ddb6 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -2440,9 +2440,33 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) if (xd->update_mb_segmentation_map) { // Select the coding strategy (temporal or spatial) choose_segmap_coding_method(cpi); + // Send the tree probabilities used to decode unpredicted + // macro-block segments + for (i = 0; i < MB_FEATURE_TREE_PROBS; i++) { + int data = xd->mb_segment_tree_probs[i]; + + if (data != 255) { + vp8_write_bit(bc, 1); + vp8_write_literal(bc, data, 8); + } else { + vp8_write_bit(bc, 0); + } + } // Write out the chosen coding method. vp8_write_bit(bc, (pc->temporal_update) ? 1 : 0); + if (pc->temporal_update) { + for (i = 0; i < PREDICTION_PROBS; i++) { + int data = pc->segment_pred_probs[i]; + + if (data != 255) { + vp8_write_bit(bc, 1); + vp8_write_literal(bc, data, 8); + } else { + vp8_write_bit(bc, 0); + } + } + } } vp8_write_bit(bc, (xd->update_mb_segmentation_data) ? 1 : 0); @@ -2536,33 +2560,6 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) save_segment_info(xd); #endif - if (xd->update_mb_segmentation_map) { - // Send the tree probabilities used to decode unpredicted - // macro-block segments - for (i = 0; i < MB_FEATURE_TREE_PROBS; i++) { - int Data = xd->mb_segment_tree_probs[i]; - - if (Data != 255) { - vp8_write_bit(bc, 1); - vp8_write_literal(bc, Data, 8); - } else - vp8_write_bit(bc, 0); - } - - // If predictive coding of segment map is enabled send the - // prediction probabilities. - if (pc->temporal_update) { - for (i = 0; i < PREDICTION_PROBS; i++) { - int Data = pc->segment_pred_probs[i]; - - if (Data != 255) { - vp8_write_bit(bc, 1); - vp8_write_literal(bc, Data, 8); - } else - vp8_write_bit(bc, 0); - } - } - } } // Encode the common prediction model status flag probability updates for |