- \
- MOTION_DMV (mpeg2_mc.avg, motion->ref[0], motion_x, motion_y); \
-} \
- \
-static void motion_reuse_##FORMAT (mpeg2_decoder_t * const decoder, \
- motion_t * const motion, \
- mpeg2_mc_fct * const * const table) \
-{ \
- int motion_x, motion_y; \
- unsigned int pos_x, pos_y, xy_half, offset; \
- \
- motion_x = motion->pmv[0][0]; \
- motion_y = motion->pmv[0][1]; \
- \
- MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0); \
-} \
- \
-static void motion_zero_##FORMAT (mpeg2_decoder_t * const decoder, \
- motion_t * const motion, \
- mpeg2_mc_fct * const * const table) \
-{ \
- unsigned int offset; \
- \
- motion->pmv[0][0] = motion->pmv[0][1] = 0; \
- motion->pmv[1][0] = motion->pmv[1][1] = 0; \
- \
- MOTION_ZERO (table, motion->ref[0]); \
-} \
- \
-static void motion_fi_field_##FORMAT (mpeg2_decoder_t * const decoder, \
- motion_t * const motion, \
- mpeg2_mc_fct * const * const table) \
-{ \
- int motion_x, motion_y; \
- uint8_t ** ref_field; \
- unsigned int pos_x, pos_y, xy_half, offset; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
- DUMPBITS (bit_buf, bits, 1); \
- \
- motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
- motion->f_code[0]); \
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
- motion->f_code[1]); \
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \
- \
- MOTION (table, ref_field, motion_x, motion_y, 16, 0); \
-} \
- \
-static void motion_fi_16x8_##FORMAT (mpeg2_decoder_t * const decoder, \
- motion_t * const motion, \
- mpeg2_mc_fct * const * const table) \
-{ \
- int motion_x, motion_y; \
- uint8_t ** ref_field; \
- unsigned int pos_x, pos_y, xy_half, offset; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
- DUMPBITS (bit_buf, bits, 1); \
- \
- motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
- motion->f_code[0]); \
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
- motion->pmv[0][0] = motion_x; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
- motion->f_code[1]); \
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
- motion->pmv[0][1] = motion_y; \
- \
- MOTION (table, ref_field, motion_x, motion_y, 8, 0); \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
- DUMPBITS (bit_buf, bits, 1); \
- \
- motion_x = motion->pmv[1][0] + get_motion_delta (decoder, \
- motion->f_code[0]); \
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
- motion->pmv[1][0] = motion_x; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- motion_y = motion->pmv[1][1] + get_motion_delta (decoder, \
- motion->f_code[1]); \
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
- motion->pmv[1][1] = motion_y; \
- \
- MOTION (table, ref_field, motion_x, motion_y, 8, 8); \
-} \
- \
-static void motion_fi_dmv_##FORMAT (mpeg2_decoder_t * const decoder, \
- motion_t * const motion, \
- mpeg2_mc_fct * const * const table) \
-{ \
- int motion_x, motion_y, other_x, other_y; \
- unsigned int pos_x, pos_y, xy_half, offset; \
- \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
- motion->f_code[0]); \
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \
- NEEDBITS (bit_buf, bits, bit_ptr); \
- other_x = ((motion_x + (motion_x > 0)) >> 1) + get_dmv (decoder); \
- \
- motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
- motion->f_code[1]); \
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \
- other_y = (((motion_y + (motion_y > 0)) >> 1) + get_dmv (decoder) + \
- decoder->dmv_offset); \
- \
- MOTION (mpeg2_mc.put, motion->ref[0], motion_x, motion_y, 16, 0); \
- MOTION (mpeg2_mc.avg, motion->ref[1], other_x, other_y, 16, 0); \
-} \
+ \
+ MOTION_DMV (mpeg2_mc.avg, motion->ref[0], motion_x, motion_y); \
+} \
+ \
+static void motion_reuse_##FORMAT (mpeg2_decoder_t * const decoder, \
+ motion_t * const motion, \
+ mpeg2_mc_fct * const * const table) \
+{ \
+ int motion_x, motion_y; \
+ unsigned int pos_x, pos_y, xy_half, offset; \
+ \
+ motion_x = motion->pmv[0][0]; \
+ motion_y = motion->pmv[0][1]; \
+ \
+ MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0); \
+} \
+ \
+static void motion_zero_##FORMAT (mpeg2_decoder_t * const decoder, \
+ motion_t * const motion, \
+ mpeg2_mc_fct * const * const table) \
+{ \
+ unsigned int offset; \
+ \
+ motion->pmv[0][0] = motion->pmv[0][1] = 0; \
+ motion->pmv[1][0] = motion->pmv[1][1] = 0; \
+ \
+ MOTION_ZERO (table, motion->ref[0]); \
+} \
+ \
+static void motion_fi_field_##FORMAT (mpeg2_decoder_t * const decoder, \
+ motion_t * const motion, \
+ mpeg2_mc_fct * const * const table) \
+{ \
+ int motion_x, motion_y; \
+ uint8_t ** ref_field; \
+ unsigned int pos_x, pos_y, xy_half, offset; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
+ DUMPBITS (bit_buf, bits, 1); \
+ \
+ motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
+ motion->f_code[0]); \
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
+ motion->f_code[1]); \
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \
+ \
+ MOTION (table, ref_field, motion_x, motion_y, 16, 0); \
+} \
+ \
+static void motion_fi_16x8_##FORMAT (mpeg2_decoder_t * const decoder, \
+ motion_t * const motion, \
+ mpeg2_mc_fct * const * const table) \
+{ \
+ int motion_x, motion_y; \
+ uint8_t ** ref_field; \
+ unsigned int pos_x, pos_y, xy_half, offset; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
+ DUMPBITS (bit_buf, bits, 1); \
+ \
+ motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
+ motion->f_code[0]); \
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
+ motion->pmv[0][0] = motion_x; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
+ motion->f_code[1]); \
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
+ motion->pmv[0][1] = motion_y; \
+ \
+ MOTION (table, ref_field, motion_x, motion_y, 8, 0); \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ ref_field = motion->ref2[UBITS (bit_buf, 1)]; \
+ DUMPBITS (bit_buf, bits, 1); \
+ \
+ motion_x = motion->pmv[1][0] + get_motion_delta (decoder, \
+ motion->f_code[0]); \
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
+ motion->pmv[1][0] = motion_x; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ motion_y = motion->pmv[1][1] + get_motion_delta (decoder, \
+ motion->f_code[1]); \
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
+ motion->pmv[1][1] = motion_y; \
+ \
+ MOTION (table, ref_field, motion_x, motion_y, 8, 8); \
+} \
+ \
+static void motion_fi_dmv_##FORMAT (mpeg2_decoder_t * const decoder, \
+ motion_t * const motion, \
+ mpeg2_mc_fct * const * const table) \
+{ \
+ int motion_x, motion_y, other_x, other_y; \
+ unsigned int pos_x, pos_y, xy_half, offset; \
+ \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \
+ motion->f_code[0]); \
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \
+ NEEDBITS (bit_buf, bits, bit_ptr); \
+ other_x = ((motion_x + (motion_x > 0)) >> 1) + get_dmv (decoder); \
+ \
+ motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \
+ motion->f_code[1]); \
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \
+ other_y = (((motion_y + (motion_y > 0)) >> 1) + get_dmv (decoder) + \
+ decoder->dmv_offset); \
+ \
+ MOTION (mpeg2_mc.put, motion->ref[0], motion_x, motion_y, 16, 0); \
+ MOTION (mpeg2_mc.avg, motion->ref[1], other_x, other_y, 16, 0); \
+} \