[MPlayer-dev-eng] postprocessing filters

Nagendra Rao nag.nagendra at gmail.com
Thu Mar 24 06:53:47 CET 2005


hai

i am Nagendra,a student from National Institute Of Technology
Calicut,India.  i've posted this fourdays back till now nobody
responded. previously  i've posted questions regarding the same topic
in ffmpeg-devl list and some people suggested me mplayer. i've gone
thru the vf_pp.c of mplayer and attempted to link the pp stuff to
ffmpeg.

i am getting the message (i am using cygwin and gdb debugger)

[main] ffmpeg 1600 open_stackdumpfile: Dumping stack trace to ffmpeg.exe
.stackdump
Segmentation fault (core dumped)

actually the problem is occuring at line 3508 of postprocess_template.c

memcpy(dst + i*dstStride, tempDst + (9+i)*dstStride, width);

here i am attaching the files which i am using.pls tell me whether my
approach is correct and am i passing the correct parameters
??????????/

pls help me.

thanks in advance
Nagendra Rao
-------------- next part --------------
#include "libpostproc/postprocess.h"
#include "avcodec.h"
#include "mpegvideo.h"

typedef struct vf_priv_s {
    int pp;
    pp_mode_t *ppMode[PP_QUALITY_MAX+1];
    void *context;
    unsigned int outfmt;
}vf_priv_s;
 
int postprocesscall(AVCodecContext *avctx, AVFrame *src )
{
  char *name;
  int i,flags=0; //not using cpu capabilities like MMX
  
  AVFrame *dst= avcodec_alloc_frame();
  
  vf_priv_s *vf=av_malloc(sizeof(struct vf_priv_s));
  
  vf->context=NULL;
  
   name="de"; //default filter options "hdeblock:a,vdeblock:a,dering:a"
    for(i=0; i<=PP_QUALITY_MAX; i++){
            vf->ppMode[i]= pp_get_mode_by_name_and_quality(name, i);
            if(vf->ppMode[i]==NULL) return -1;
        }
  
    vf->pp=PP_QUALITY_MAX;
    vf->outfmt=PIX_FMT_YUV420P;
    
    if(vf->context) pp_free_context(vf->context);
    vf->context= pp_get_context(avctx->width,avctx->height, flags);
  
        dst->linesize[0] = src->linesize[0];
        dst->linesize[1] = src->linesize[1];
        dst->linesize[2] = src->linesize[2];
  
   pp_postprocess(&src->data[0],&src->linesize[0], &dst->data[0],&dst->linesize[0],
		    (avctx->width+7)&(~7),avctx->height,
		    src->qscale_table, src->qstride, vf->ppMode[ vf->pp ], vf->context,
		    src->pict_type);
  
  
      src=dst;
  av_free(dst);
  return 0;
 } 
 

 

-------------- next part --------------
--- ffmpeg1.c	Fri Mar  4 12:24:58 2005
+++ ffmpeg.c	Fri Mar 18 15:56:33 2005
@@ -19,7 +19,7 @@
 #define HAVE_AV_CONFIG_H
 #include <limits.h>
 #include "avformat.h"
 #include "framehook.h"
 
 #ifndef CONFIG_WIN32
 #include <unistd.h>
@@ -39,7 +39,6 @@
 #include <time.h>
 
 #include "cmdutils.h"
@@ -1075,7 +1071,13 @@
                     avcodec_get_frame_defaults(&picture);
 
                     ret = avcodec_decode_video(&ist->st->codec, 
-                                               &picture, &got_picture, ptr, len);
+                                            &picture, &got_picture, ptr, len);
+/*
+#ifdef CONFIG_PP
+            if(postprocesscall(&ist->st->codec,&picture)<0) 
+             fprintf(stderr, "pp failed\n");
+#endif                                               
+  */
                     ist->st->quality= picture.quality;
                     if (ret < 0) 
                         goto fail_decode;




More information about the MPlayer-dev-eng mailing list