comparison libmpcodecs/vd_ffmpeg.c @ 6738:77f2713ae7fd

svq1 direct rendering
author michael
date Mon, 15 Jul 2002 21:33:46 +0000
parents 39619804c8b6
children 8a680d5f3a17
comparison
equal deleted inserted replaced
6737:39619804c8b6 6738:77f2713ae7fd
249 vd_ffmpeg_ctx *ctx = sh->context; 249 vd_ffmpeg_ctx *ctx = sh->context;
250 mp_image_t* mpi=NULL; 250 mp_image_t* mpi=NULL;
251 // int flags= MP_IMGFLAG_ALIGNED_STRIDE; 251 // int flags= MP_IMGFLAG_ALIGNED_STRIDE;
252 int flags= MP_IMGFLAG_ACCEPT_STRIDE; 252 int flags= MP_IMGFLAG_ACCEPT_STRIDE;
253 int type= MP_IMGTYPE_IPB; 253 int type= MP_IMGTYPE_IPB;
254 254 int align=15;
255
256 if(avctx->pix_fmt == PIX_FMT_YUV410P)
257 align=63; //yes seriously, its really needed (16x16 chroma blocks in SVQ1 -> 64x64)
258
255 if(init_vo(sh)<0){ 259 if(init_vo(sh)<0){
256 printf("init_vo failed\n"); 260 printf("init_vo failed\n");
257 return; 261 return;
258 } 262 }
259 263
271 } 275 }
272 #endif 276 #endif
273 mp_msg(MSGT_DECVIDEO,MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n"); 277 mp_msg(MSGT_DECVIDEO,MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n");
274 278
275 mpi= mpcodecs_get_image(sh,type, flags, 279 mpi= mpcodecs_get_image(sh,type, flags,
276 // MN: arpi, is the next line ok? (i doubt it), its needed for height%16!=0 files 280 (width+align)&(~align), (height+align)&(~align));
277 (width+15)&(~15), (height+15)&(~15));
278 281
279 // ok, lets see what did we get: 282 // ok, lets see what did we get:
280 if( mpi->flags&MP_IMGFLAG_DRAW_CALLBACK && 283 if( mpi->flags&MP_IMGFLAG_DRAW_CALLBACK &&
281 !(mpi->flags&MP_IMGFLAG_DIRECT)){ 284 !(mpi->flags&MP_IMGFLAG_DIRECT)){
282 // nice, filter/vo likes draw_callback :) 285 // nice, filter/vo likes draw_callback :)
336 339
337 ret = avcodec_decode_video(avctx, &lavc_picture, 340 ret = avcodec_decode_video(avctx, &lavc_picture,
338 &got_picture, data, len); 341 &got_picture, data, len);
339 if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n"); 342 if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n");
340 if(!got_picture) return NULL; // skipped image 343 if(!got_picture) return NULL; // skipped image
341 344
342 if(init_vo(sh)<0) return NULL; 345 if(init_vo(sh)<0) return NULL;
343 346
344 #if LIBAVCODEC_BUILD > 4615 347 #if LIBAVCODEC_BUILD > 4615
345 if(dr1 && avctx->dr_opaque_frame){ 348 if(dr1 && avctx->dr_opaque_frame){
346 mpi= (mp_image_t*)avctx->dr_opaque_frame; 349 mpi= (mp_image_t*)avctx->dr_opaque_frame;