1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 06:17:00 +00:00

imgtype IP support

enabling dr1 by default, lets see if its bugfree ...


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6738 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2002-07-15 14:30:12 +00:00
parent 9db1a07b9e
commit 8c6996f712

View File

@ -250,6 +250,7 @@ static void get_buffer(struct AVCodecContext *avctx, int width, int height, int
mp_image_t* mpi=NULL;
// int flags= MP_IMGFLAG_ALIGNED_STRIDE;
int flags= MP_IMGFLAG_ACCEPT_STRIDE;
int type= MP_IMGTYPE_IPB;
if(init_vo(sh)<0){
printf("init_vo failed\n");
@ -262,7 +263,16 @@ static void get_buffer(struct AVCodecContext *avctx, int width, int height, int
else
flags|= MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE;
mpi= mpcodecs_get_image(sh,MP_IMGTYPE_IPB, flags,
#if LIBAVCODEC_BUILD > 4616
if(avctx->has_b_frames){
type= MP_IMGTYPE_IPB;
}else{
type= MP_IMGTYPE_IP;
}
#endif
mp_msg(MSGT_DECVIDEO,MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n");
mpi= mpcodecs_get_image(sh,type, flags,
// MN: arpi, is the next line ok? (i doubt it), its needed for height%16!=0 files
(width+15)&(~15), (height+15)&(~15));
@ -282,13 +292,10 @@ static void get_buffer(struct AVCodecContext *avctx, int width, int height, int
}
avctx->dr_stride = mpi->stride[0];
avctx->dr_uvstride = mpi->stride[1];
if(mpi->stride[0]>>1 != mpi->stride[1]
||mpi->stride[0]>>1 != mpi->stride[2]){
mp_msg(MSGT_DECVIDEO,MSGL_ERR, "Error: chroma stride != luma stride >>1\n");
}
avctx->dr_opaque_frame = mpi;
avctx->dr_ip_buffer_count=2; //FIXME
}
#endif
@ -300,7 +307,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
vd_ffmpeg_ctx *ctx = sh->context;
AVCodecContext *avctx = ctx->avctx;
mp_image_t* mpi=NULL;
int dr1= ctx->do_dr1=0;
int dr1= ctx->do_dr1;
if(len<=0) return NULL; // skipped frame