Commit 636bf329 authored by reimar's avatar reimar

Use sign_extend function instead of reimplementing it.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18599 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 208e45c9
...@@ -333,16 +333,10 @@ static void xan_wc3_decode_frame(XanContext *s) { ...@@ -333,16 +333,10 @@ static void xan_wc3_decode_frame(XanContext *s) {
} }
} else { } else {
/* run-based motion compensation from last frame */ /* run-based motion compensation from last frame */
motion_x = *vector_segment >> 4; motion_x = sign_extend(*vector_segment >> 4, 4);
motion_y = *vector_segment & 0xF; motion_y = sign_extend(*vector_segment & 0xF, 4);
vector_segment++; 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 */ /* copy a run of pixels from the previous frame */
xan_wc3_copy_pixel_run(s, x, y, size, motion_x, motion_y); xan_wc3_copy_pixel_run(s, x, y, size, motion_x, motion_y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment