0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

backward-frame rendering by slices

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@80 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi_esp 2001-03-11 01:28:31 +00:00
parent 5169f70160
commit 7c51933043
2 changed files with 35 additions and 17 deletions

View File

@ -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];
// 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;
}
}
#if 1
#ifdef MPEG12_POSTPROC
if(picture->pp_options)
picture->current_frame->copy=NULL; else
#endif
picture->current_frame->copy=copy_slice;
} else {
picture->current_frame = picture->forward_reference_frame;
picture->forward_reference_frame = picture->backward_reference_frame;
picture->backward_reference_frame = picture->current_frame;
picture->current_frame->copy=NULL;
}
}
#endif
picture->current_frame->vo=output;
picture->current_frame->slice=0;
picture->slice=0;
}

View File

@ -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 {