Ticket #1627: bug1627.diff
| File bug1627.diff, 2.3 KB (added by , 17 years ago) |
|---|
-
libmpcodecs/vf_cropdetect.c
15 15 int x1,y1,x2,y2; 16 16 int limit; 17 17 int round; 18 int reset_count; 18 19 int fno; 19 20 }; 20 21 … … 57 58 mp_image_t *dmpi; 58 59 int bpp=mpi->bpp/8; 59 60 int w,h,x,y,shrink_by; 61 static int mycount = 0; // Keep track of frames since last crop area reset 60 62 61 63 // hope we'll get DR buffer: 62 64 dmpi=vf_get_image(vf->next,mpi->imgfmt, … … 73 75 dmpi->height=mpi->height; 74 76 75 77 if(++vf->priv->fno>2){ // ignore first 2 frames - they may be empty 78 79 // Reset the crop area every reset_count frames, if reset_count is > 0 80 mycount++; 81 if(vf->priv->reset_count && mycount >= vf->priv->reset_count){ 82 vf->priv->x1=mpi->w-1; 83 vf->priv->y1=mpi->h-1; 84 vf->priv->x2=0; 85 vf->priv->y2=0; 86 mycount=0; 87 } 76 88 77 89 for(y=0;y<vf->priv->y1;y++){ 78 90 if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){ … … 153 165 vf->priv=malloc(sizeof(struct vf_priv_s)); 154 166 vf->priv->limit=24; // should be option 155 167 vf->priv->round = 0; 156 if(args) sscanf(args, "%d:%d", 168 vf->priv->reset_count = 0; 169 if(args) sscanf(args, "%d:%d:%d", 157 170 &vf->priv->limit, 158 &vf->priv->round); 171 &vf->priv->round, 172 &vf->priv->reset_count); 159 173 return 1; 160 174 } 161 175 -
DOCS/man/en/mplayer.1
5775 5775 .PD 1 5776 5776 . 5777 5777 .TP 5778 .B cropdetect[=limit:round ]5778 .B cropdetect[=limit:round[:reset]] 5779 5779 Calculates necessary cropping parameters and prints the recommended parameters 5780 5780 to stdout. 5781 5781 .PD 0 … … 5789 5789 The offset is automatically adjusted to center the video. 5790 5790 Use 2 to get only even dimensions (needed for 4:2:2 video). 5791 5791 16 is best when encoding to most video codecs. 5792 .br 5793 .IPs <reset> 5794 Counter that determines after how many frames cropdetect will reset 5795 the previously detected largest video area and start over to detect 5796 the current optimal crop area. This can be usefull when channel 5797 logos distort the video area. 0 indicates never reset and return 5798 the the largest area encountered during playback. (default: 0). 5792 5799 .RE 5793 5800 .PD 1 5794 5801 .
