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 "config.h"
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24
25 #if HAVE_MALLOC_H
26 #include <malloc.h>
27 #endif
28
31
33 //#include "libavutil/mem.h"
35
40
41 // IF09 - allocate space for 4. plane delta info - unused
45 } else
49 // YV12/I420/YVU9/IF09. feel free to add other planar formats here...
54 // I420/IYUV (Y,U,V)
59 } else {
60 // YV12,YVU9,IF09 (Y,V,U)
65 }
66 } else {
67 // NV12/NV21
70 }
71 } else {
75 memcpy(mpi->
planes[1], temp, 1024);
76 }
77 }
79 }
80
83
86
87 return mpi;
88 }
89
98 } else {
100 mpi->
w*(dmpi->
bpp/8), mpi->
h,
102 }
103 }
104
108 // compressed formats
113 return;
114 }
119 else
121 return;
122 }
126 else
129 return;
130 }
135 return;
139 return;
143 return;
144 }
151 }
152 switch(out_fmt){
157 return;
198 return;
204 /* they're planar ones, but for easier handling use them as packed */
207 return;
210 return;
217 return;
228 return;
229 }
232 }
233
236 if(!mpi) return NULL; // error!
240 return mpi;
241 }
242
244 if(!mpi) return;
246 /* becouse we allocate the whole image in once */
250 }
251 free(mpi);
252 }
253