vf_down3dright.c
Go to the documentation of this file.
1 /*
2  * This file is part of MPlayer.
3  *
4  * MPlayer is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * MPlayer is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <inttypes.h>
23 
24 #include "config.h"
25 #include "mp_msg.h"
26 #include "cpudetect.h"
27 
28 #include "img_format.h"
29 #include "mp_image.h"
30 #include "vf.h"
31 
32 #include "libvo/fastmemcpy.h"
33 
34 struct vf_priv_s {
35  int skipline;
36  int scalew;
37  int scaleh;
38 };
39 
40 static void toright(unsigned char *dst[3], unsigned char *src[3],
41  int dststride[3], int srcstride[3],
42  int w, int h, struct vf_priv_s* p)
43 {
44  int k;
45 
46  for (k = 0; k < 3; k++) {
47  unsigned char* fromL = src[k];
48  unsigned char* fromR = src[k];
49  unsigned char* to = dst[k];
50  int src = srcstride[k];
51  int dst = dststride[k];
52  int ss;
53  unsigned int dd;
54  int i;
55 
56  if (k > 0) {
57  i = h / 4 - p->skipline / 2;
58  ss = src * (h / 4 + p->skipline / 2);
59  dd = w / 4;
60  } else {
61  i = h / 2 - p->skipline;
62  ss = src * (h / 2 + p->skipline);
63  dd = w / 2;
64  }
65  fromR += ss;
66  for ( ; i > 0; i--) {
67  int j;
68  unsigned char* t = to;
69  unsigned char* sL = fromL;
70  unsigned char* sR = fromR;
71 
72  if (p->scalew == 1) {
73  for (j = dd; j > 0; j--) {
74  *t++ = (sL[0] + sL[1]) / 2;
75  sL+=2;
76  }
77  for (j = dd ; j > 0; j--) {
78  *t++ = (sR[0] + sR[1]) / 2;
79  sR+=2;
80  }
81  } else {
82  for (j = dd * 2 ; j > 0; j--)
83  *t++ = *sL++;
84  for (j = dd * 2 ; j > 0; j--)
85  *t++ = *sR++;
86  }
87  if (p->scaleh == 1) {
88  fast_memcpy(to + dst, to, dst);
89  to += dst;
90  }
91  to += dst;
92  fromL += src;
93  fromR += src;
94  }
95  //printf("K %d %d %d %d %d \n", k, w, h, src, dst);
96  }
97 }
98 
99 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
100 {
101  mp_image_t *dmpi;
102 
103  // hope we'll get DR buffer:
104  dmpi=ff_vf_get_image(vf->next, IMGFMT_YV12,
106  ((vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0),
107  mpi->w * vf->priv->scalew,
108  mpi->h / vf->priv->scaleh - vf->priv->skipline);
109 
110  toright(dmpi->planes, mpi->planes, dmpi->stride,
111  mpi->stride, mpi->w, mpi->h, vf->priv);
112 
113  return ff_vf_next_put_image(vf,dmpi, pts);
114 }
115 
116 static int config(struct vf_instance *vf,
117  int width, int height, int d_width, int d_height,
118  unsigned int flags, unsigned int outfmt)
119 {
120  /* FIXME - also support UYVY output? */
121  return ff_vf_next_config(vf, width * vf->priv->scalew,
122  height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
123 }
124 
125 
126 static int query_format(struct vf_instance *vf, unsigned int fmt)
127 {
128  /* FIXME - really any YUV 4:2:0 input format should work */
129  switch (fmt) {
130  case IMGFMT_YV12:
131  case IMGFMT_IYUV:
132  case IMGFMT_I420:
134  }
135  return 0;
136 }
137 
138 static void uninit(struct vf_instance *vf)
139 {
140  free(vf->priv);
141 }
142 
143 static int vf_open(vf_instance_t *vf, char *args)
144 {
145  vf->config=config;
147  vf->put_image=put_image;
148  vf->uninit=uninit;
149 
150  vf->priv = calloc(1, sizeof (struct vf_priv_s));
151  vf->priv->skipline = 0;
152  vf->priv->scalew = 1;
153  vf->priv->scaleh = 2;
154  if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
155 
156  return 1;
157 }
158 
160  "convert stereo movie from top-bottom to left-right field",
161  "down3dright",
162  "Zdenek Kabelac",
163  "",
164  vf_open,
165  NULL
166 };
const char * fmt
Definition: avisynth_c.h:669
mp_image_t * ff_vf_get_image(vf_instance_t *vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h)
Definition: vf_mp.c:380
const vf_info_t ff_vf_info_down3dright
#define IMGFMT_YV12
Definition: img_format.h:119
void(* uninit)(struct vf_instance *vf)
Definition: vf.h:74
#define MP_IMGFLAG_READABLE
Definition: mp_image.h:55
output residual component w
int ff_vf_next_config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt)
Definition: vf_mp.c:584
int(* put_image)(struct vf_instance *vf, mp_image_t *mpi, double pts)
Definition: vf.h:68
Definition: vf.h:31
unsigned char * planes[MP_MAX_PLANES]
Definition: mp_image.h:133
int stride[MP_MAX_PLANES]
Definition: mp_image.h:134
static void toright(unsigned char *dst[3], unsigned char *src[3], int dststride[3], int srcstride[3], int w, int h, struct vf_priv_s *p)
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt)
int width
Definition: vf_fil.c:32
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
#define MP_IMGTYPE_TEMP
Definition: mp_image.h:104
int(* query_format)(struct vf_instance *vf, unsigned int fmt)
Definition: vf.h:64
static int vf_open(vf_instance_t *vf, char *args)
#define IMGFMT_IYUV
Definition: img_format.h:121
uint8_t * src
Definition: vf_fspp.c:98
t
Definition: genspecsines3.m:6
struct vf_instance * next
Definition: vf.h:84
for k
NULL
Definition: eval.c:55
synthesis window for stochastic i
int w
Definition: mp_image.h:132
int(* config)(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt)
Definition: vf.h:59
static int flags
Definition: cpu.c:23
FFmpeg Automated Testing Environment ************************************Table of Contents *****************FFmpeg Automated Testing Environment Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass target exec to configure or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script tests fate sh from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at doc fate_config sh template Create a configuration that suits your based on the configuration template The slot configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern< arch >< os >< compiler >< compiler version > The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the fate_recv variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ssh command with one or more v options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory FATE makefile targets and variables *************************************Makefile can be set to
Definition: fate.txt:142
void * fast_memcpy(void *to, const void *from, size_t len)
int ff_vf_next_put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
Definition: vf_mp.c:539
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
#define MP_IMGFLAG_ACCEPT_STRIDE
Definition: mp_image.h:63
struct vf_priv_s * priv
Definition: vf.h:86
#define IMGFMT_I420
Definition: img_format.h:120
int h
Definition: mp_image.h:132
static int query_format(struct vf_instance *vf, unsigned int fmt)
int ff_vf_next_query_format(struct vf_instance *vf, unsigned int fmt)
Definition: vf_mp.c:371
Definition: vf.h:56
static void uninit(struct vf_instance *vf)
int height
Definition: vf_fil.c:31
MUSIC TECHNOLOGY GROUP UNIVERSITAT POMPEU FABRA Free Non Commercial Binary License Agreement UNIVERSITAT POMPEU OR INDICATING ACCEPTANCE BY SELECTING THE ACCEPT BUTTON ON ANY DOWNLOAD OR INSTALL YOU ACCEPT THE TERMS OF THE LICENSE SUMMARY TABLE Software MELODIA Melody Extraction vamp plug in Licensor Music Technology Group Universitat Pompeu Plaça de la Spain Permitted purposes Non commercial internal research and validation and educational purposes only All commercial uses in a production either internal or are prohibited by this license and require an additional commercial exploitation license TERMS AND CONDITIONS SOFTWARE Software means the software programs identified herein in binary any other machine readable any updates or error corrections provided by and any user programming guides and other documentation provided to you by UPF under this Agreement LICENSE Subject to the terms and conditions of this UPF grants you a royalty free