Browse Source

Use sign_extend function instead of reimplementing it.

Originally committed as revision 18599 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Reimar Döffinger 17 years ago
parent
commit
d7670f2827
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      libavcodec/xan.c

+ 2
- 8
libavcodec/xan.c View File

@@ -333,16 +333,10 @@ static void xan_wc3_decode_frame(XanContext *s) {
}
} else {
/* run-based motion compensation from last frame */
motion_x = *vector_segment >> 4;
motion_y = *vector_segment & 0xF;
motion_x = sign_extend(*vector_segment >> 4, 4);
motion_y = sign_extend(*vector_segment & 0xF, 4);
vector_segment++;

/* sign extension */
if (motion_x & 0x8)
motion_x |= 0xFFFFFFF0;
if (motion_y & 0x8)
motion_y |= 0xFFFFFFF0;

/* copy a run of pixels from the previous frame */
xan_wc3_copy_pixel_run(s, x, y, size, motion_x, motion_y);



Loading…
Cancel
Save