summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/native
diff options
context:
space:
mode:
authoriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-18 17:08:08 +0000
committeriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-18 17:08:08 +0000
commit9a1a85ec2efc945e577cd21f0ed28605cb04cd2d (patch)
tree0e9a191ba7d8fb760c79e879acb1a67b984f6d8b /libmpcodecs/native
parent6c4797e017ff0a97f5fbbd2e1c6b3cad406e6c44 (diff)
downloadmpv-9a1a85ec2efc945e577cd21f0ed28605cb04cd2d.tar.bz2
mpv-9a1a85ec2efc945e577cd21f0ed28605cb04cd2d.tar.xz
fixed block artefacts and speedup at the same time
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5685 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/native')
-rw-r--r--libmpcodecs/native/roqav.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmpcodecs/native/roqav.c b/libmpcodecs/native/roqav.c
index a32bdade20..dfc41a92cb 100644
--- a/libmpcodecs/native/roqav.c
+++ b/libmpcodecs/native/roqav.c
@@ -64,6 +64,7 @@ typedef struct
roq_v2_codebook v2[MAX_ROQ_CODEBOOK_SIZE];
roq_v4_codebook v4[MAX_ROQ_CODEBOOK_SIZE];
mp_image_t *prev_frame;
+ uint32_t numframe;
} roqvideo_info;
@@ -232,6 +233,7 @@ void *roq_decode_video_init(void)
(roqvideo_info *)calloc(sizeof(roqvideo_info), 1);
info->prev_frame = NULL;
+ info->numframe=0;
return info;
}
@@ -386,9 +388,11 @@ void roq_decode_video(void *context, unsigned char *encoded,
mean_motion_y = encoded[stream_ptr++];
mean_motion_x = encoded[stream_ptr++];
- // start by copying entire previous frame
- if (info->prev_frame)
+ //RoQ reuses its buffers so a transparent block keeps content
+ //from 2 frames ago. The only exception is 2'd frame (#1)
+ if(info->numframe==1)
{
+ CHECK_PREV_FRAME();
memcpy(mpi->planes[0], info->prev_frame->planes[0],
mpi->width * mpi->height);
memcpy(mpi->planes[1], info->prev_frame->planes[1],
@@ -606,6 +610,7 @@ void roq_decode_video(void *context, unsigned char *encoded,
}
// save the current frame as the previous frame for the next iteration
+ info->numframe++;
info->prev_frame = mpi;
}