summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_bitstream.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-05-16 14:16:47 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-05-16 14:16:47 -0700
commit1e3cdc1dd2d0947b5bf90a5991db8f1f5e6f2ae2 (patch)
treed47cac18d7f384e94084ce863393372bad6d518f /vp9/encoder/vp9_bitstream.c
parente3869e9cfc3cb659525be45b35c8ad37103e573c (diff)
parent18375238e98676e8fcf4c024ed19bcae95a960b7 (diff)
downloadlibvpx-1e3cdc1dd2d0947b5bf90a5991db8f1f5e6f2ae2.tar
libvpx-1e3cdc1dd2d0947b5bf90a5991db8f1f5e6f2ae2.tar.gz
libvpx-1e3cdc1dd2d0947b5bf90a5991db8f1f5e6f2ae2.tar.bz2
libvpx-1e3cdc1dd2d0947b5bf90a5991db8f1f5e6f2ae2.zip
Merge "Combining integer and fractional parts of mvs for entropy coding." into experimental
Diffstat (limited to 'vp9/encoder/vp9_bitstream.c')
-rw-r--r--vp9/encoder/vp9_bitstream.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 3c234afd5..9d72a8827 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -455,16 +455,6 @@ static void write_sub_mv_ref(vp9_writer *bc, B_PREDICTION_MODE m,
vp9_sub_mv_ref_encoding_array - LEFT4X4 + m);
}
-static void write_nmv(VP9_COMP *cpi, vp9_writer *bc,
- const MV *mv, const int_mv *ref,
- const nmv_context *nmvc, int usehp) {
- MV e;
- e.row = mv->row - ref->as_mv.row;
- e.col = mv->col - ref->as_mv.col;
-
- vp9_encode_nmv(bc, &e, &ref->as_mv, nmvc);
- vp9_encode_nmv_fp(bc, &e, &ref->as_mv, nmvc, usehp);
-}
// This function writes the current macro block's segnment id to the bitstream
// It should only be called if a segment map update is indicated.
@@ -700,15 +690,14 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
#ifdef ENTROPY_STATS
active_section = 5;
#endif
- write_nmv(cpi, bc, &mi->mv[0].as_mv, &mi->best_mv,
- (const nmv_context*) nmvc,
- xd->allow_high_precision_mv);
-
- if (mi->second_ref_frame > 0) {
- write_nmv(cpi, bc, &mi->mv[1].as_mv, &mi->best_second_mv,
- (const nmv_context*) nmvc,
- xd->allow_high_precision_mv);
- }
+ vp9_encode_mv(bc,
+ &mi->mv[0].as_mv, &mi->best_mv.as_mv,
+ nmvc, xd->allow_high_precision_mv);
+
+ if (mi->second_ref_frame > 0)
+ vp9_encode_mv(bc,
+ &mi->mv[1].as_mv, &mi->best_second_mv.as_mv,
+ nmvc, xd->allow_high_precision_mv);
break;
case SPLITMV: {
int j = 0;
@@ -738,17 +727,14 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
#ifdef ENTROPY_STATS
active_section = 11;
#endif
- write_nmv(cpi, bc, &blockmv.as_mv, &mi->best_mv,
- (const nmv_context*) nmvc,
- xd->allow_high_precision_mv);
-
- if (mi->second_ref_frame > 0) {
- write_nmv(cpi, bc,
- &cpi->mb.partition_info->bmi[j].second_mv.as_mv,
- &mi->best_second_mv,
- (const nmv_context*) nmvc,
- xd->allow_high_precision_mv);
- }
+ vp9_encode_mv(bc, &blockmv.as_mv, &mi->best_mv.as_mv,
+ nmvc, xd->allow_high_precision_mv);
+
+ if (mi->second_ref_frame > 0)
+ vp9_encode_mv(bc,
+ &cpi->mb.partition_info->bmi[j].second_mv.as_mv,
+ &mi->best_second_mv.as_mv,
+ nmvc, xd->allow_high_precision_mv);
}
} while (++j < cpi->mb.partition_info->count);
break;