[Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.133,1.134
Arpi
arpi at mplayerhq.hu
Sun Sep 26 19:04:59 CEST 2004
Hi,
> Modified Files:
> vd_ffmpeg.c
> Log Message:
> low resolution decoding
it's not perfect yet.
it decodes in lower resolution, but the window size is still the
original. i've patched vd_ffmpeg.c to subdivide window size by
lowres, it works somehow, but the top few lines of the chroma
plane is corrupted (overwritten):
Index: vd_ffmpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v
retrieving revision 1.134
diff -u -r1.134 vd_ffmpeg.c
--- vd_ffmpeg.c 26 Sep 2004 12:54:00 -0000 1.134
+++ vd_ffmpeg.c 26 Sep 2004 17:02:31 -0000
@@ -462,12 +462,18 @@
#else
float aspect= avctx->aspect_ratio;
#endif
+// int new_w=(avctx->width+(1<<lavc_param_lowres)-1)>>lavc_param_lowres;
+// int new_h=(avctx->height+(1<<lavc_param_lowres)-1)>>lavc_param_lowres;
+// int new_w=((avctx->width>>lavc_param_lowres)+15)&-15;
+// int new_h=((avctx->height>>lavc_param_lowres)+15)&-15;
+ int new_w=(avctx->width>>lavc_param_lowres);
+ int new_h=(avctx->height>>lavc_param_lowres);
// it is possible another vo buffers to be used after vo config()
// lavc reset its buffers on width/heigh change but not on aspect change!!!
if (// aspect != ctx->last_aspect ||
- avctx->width != sh->disp_w ||
- avctx->height != sh->disp_h ||
+ new_w != sh->disp_w ||
+ new_h != sh->disp_h ||
!ctx->vo_inited)
{
mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", aspect);
@@ -475,8 +481,8 @@
// if(ctx->last_aspect>=0.01 && ctx->last_aspect<100)
if(sh->aspect==0.0)
sh->aspect = ctx->last_aspect;
- sh->disp_w = avctx->width;
- sh->disp_h = avctx->height;
+ sh->disp_w = new_w;
+ sh->disp_h = new_h;
ctx->vo_inited=1;
switch(pix_fmt){
case PIX_FMT_YUV410P: ctx->best_csp=IMGFMT_YVU9;break; //svq1
But with -noslices it looks good, so it may be slices bug.
(i've tried it _after_ your slices fix commit in lavc, with full recompile)
As a feature request, what about lowres decoding to 4:4:4 chroma format?
ie. subdivide luma only in half size, leaving chroma in original res.
The most artifacts are visible in chroma channels only, and subdividing
chroma results in bad quality anyway, as it's already too bad.
A'rpi / MPlayer, Astral & ESP-team
--
MPlayer's new image: happiness & peace & cosmetics & vmiklos
More information about the MPlayer-cvslog
mailing list