summaryrefslogtreecommitdiffstats
path: root/libmpeg2
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-11 01:28:31 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-11 01:28:31 +0000
commit7c51933043faf6fdaf48a827bc04949e92b7f118 (patch)
tree14b4638bc26f89b6f577ebe0d447cceb3b62b21a /libmpeg2
parent5169f70160881a9e281652f9360842343abfc9c8 (diff)
downloadmpv-7c51933043faf6fdaf48a827bc04949e92b7f118.tar.bz2
mpv-7c51933043faf6fdaf48a827bc04949e92b7f118.tar.xz
backward-frame rendering by slices
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@80 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpeg2')
-rw-r--r--libmpeg2/decode.c44
-rw-r--r--libmpeg2/mpeg2_internal.h6
2 files changed, 34 insertions, 16 deletions
diff --git a/libmpeg2/decode.c b/libmpeg2/decode.c
index 451050d0bb..b5779b0139 100644
--- a/libmpeg2/decode.c
+++ b/libmpeg2/decode.c
@@ -111,7 +111,6 @@ void mpeg2_allocate_image_buffers (picture_t * picture)
frames[i].base[2] = base + frame_size;
frames[i].copy = NULL;
frames[i].vo = NULL;
- frames[i].slice=0;
}
picture->forward_reference_frame=&frames[0];
@@ -123,18 +122,27 @@ void mpeg2_allocate_image_buffers (picture_t * picture)
static void copy_slice (vo_frame_t * frame, uint8_t ** src){
vo_functions_t * output = frame->vo;
int stride[3];
- int y=frame->slice*16;
+ int y=picture->slice<<4;
+ uint8_t* src_tmp[3];
stride[0]=picture->coded_picture_width;
stride[1]=stride[2]=stride[0]/2;
-
- output->draw_slice (src, stride,
- picture->display_picture_width,
+
+ if(frame!=picture->display_frame){
+ uint8_t** base=picture->display_frame->base;
+ src_tmp[0]=base[0]+stride[0]*y;
+ src_tmp[1]=base[1]+stride[1]*(y>>1);
+ src_tmp[2]=base[2]+stride[2]*(y>>1);
+ src=src_tmp;
+ }
+
+ output->draw_slice (src,
+ stride, picture->display_picture_width,
(y+16<=picture->display_picture_height) ? 16 :
picture->display_picture_height-y,
0, y);
- ++frame->slice;
+ ++picture->slice;
}
static int in_slice_flag=0;
@@ -169,9 +177,9 @@ static int parse_chunk (vo_functions_t * output, int code, uint8_t * buffer)
output->draw_slice (frames[3].base, stride,
picture->display_picture_width,
picture->display_picture_height, 0, 0);
- } else
+ }// else
#endif
-#if 1
+#if 0
if (picture->picture_coding_type != B_TYPE) {
int stride[3];
stride[0]=picture->coded_picture_width;
@@ -228,22 +236,28 @@ static int parse_chunk (vo_functions_t * output, int code, uint8_t * buffer)
// vo_field (picture->current_frame, picture->picture_structure);
} else {
if (picture->picture_coding_type == B_TYPE){
+ picture->display_frame=
picture->current_frame = &frames[2];
-#ifdef MPEG12_POSTPROC
- if(picture->pp_options)
- picture->current_frame->copy=NULL; else
-#endif
- picture->current_frame->copy=copy_slice;
+// picture->current_frame->copy=copy_slice;
} else {
picture->current_frame = picture->forward_reference_frame;
+ picture->display_frame=
picture->forward_reference_frame = picture->backward_reference_frame;
picture->backward_reference_frame = picture->current_frame;
- picture->current_frame->copy=NULL;
+// picture->current_frame->copy=NULL;
}
}
+
+#if 1
+#ifdef MPEG12_POSTPROC
+ if(picture->pp_options)
+ picture->current_frame->copy=NULL; else
+#endif
+ picture->current_frame->copy=copy_slice;
+#endif
picture->current_frame->vo=output;
- picture->current_frame->slice=0;
+ picture->slice=0;
}
diff --git a/libmpeg2/mpeg2_internal.h b/libmpeg2/mpeg2_internal.h
index 8eb3e924da..cb79406a38 100644
--- a/libmpeg2/mpeg2_internal.h
+++ b/libmpeg2/mpeg2_internal.h
@@ -55,7 +55,7 @@ typedef struct vo_frame_s {
uint8_t * base[3]; /* pointer to 3 planes */
void (* copy) (struct vo_frame_s * frame, uint8_t ** src);
void* vo;
- int slice;
+// int slice;
// void (* field) (struct vo_frame_s * frame, int flags);
// void (* draw) (struct vo_frame_s * frame);
// vo_instance_t * instance;
@@ -147,6 +147,10 @@ typedef struct picture_s {
int display_picture_height;
int pp_options;
int repeat_count;
+
+ struct vo_frame_s * display_frame;
+ int slice;
+
} picture_t;
typedef struct mpeg2_config_s {