Mercurial > libavutil.hg
annotate pixdesc.c @ 1027:7d79d41d152e libavutil
Move av_get_token() from libavfilter to libavutil.
author | stefano |
---|---|
date | Mon, 27 Sep 2010 16:23:43 +0000 |
parents | 4c26dcb90bc6 |
children |
rev | line source |
---|---|
781 | 1 /* |
2 * pixel format descriptor | |
3 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at> | |
4 * | |
5 * This file is part of FFmpeg. | |
6 * | |
7 * FFmpeg is free software; you can redistribute it and/or | |
8 * modify it under the terms of the GNU Lesser General Public | |
9 * License as published by the Free Software Foundation; either | |
10 * version 2.1 of the License, or (at your option) any later version. | |
11 * | |
12 * FFmpeg is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Lesser General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Lesser General Public | |
18 * License along with FFmpeg; if not, write to the Free Software | |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 */ | |
21 | |
989 | 22 #include <stdio.h> |
23 #include <string.h> | |
781 | 24 #include "pixfmt.h" |
25 #include "pixdesc.h" | |
26 | |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
27 #include "intreadwrite.h" |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
28 |
982
da1b5110dbd0
Rename read/write_line() to av_read/write_image_line().
mru
parents:
898
diff
changeset
|
29 void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], |
987 | 30 const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component) |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
31 { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
32 AVComponentDescriptor comp= desc->comp[c]; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
33 int plane= comp.plane; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
34 int depth= comp.depth_minus1+1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
35 int mask = (1<<depth)-1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
36 int shift= comp.shift; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
37 int step = comp.step_minus1+1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
38 int flags= desc->flags; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
39 |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
40 if (flags & PIX_FMT_BITSTREAM){ |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
41 int skip = x*step + comp.offset_plus1-1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
42 const uint8_t *p = data[plane] + y*linesize[plane] + (skip>>3); |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
43 int shift = 8 - depth - (skip&7); |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
44 |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
45 while(w--){ |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
46 int val = (*p >> shift) & mask; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
47 if(read_pal_component) |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
48 val= data[1][4*val + c]; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
49 shift -= step; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
50 p -= shift>>3; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
51 shift &= 7; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
52 *dst++= val; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
53 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
54 } else { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
55 const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1; |
1016
4c26dcb90bc6
Apply minor simplification in av_read_image_line().
stefano
parents:
1015
diff
changeset
|
56 int is_8bit = shift + depth <= 8; |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
57 |
1016
4c26dcb90bc6
Apply minor simplification in av_read_image_line().
stefano
parents:
1015
diff
changeset
|
58 if (is_8bit) |
1014
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
59 p += !!(flags & PIX_FMT_BE); |
1016
4c26dcb90bc6
Apply minor simplification in av_read_image_line().
stefano
parents:
1015
diff
changeset
|
60 |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
61 while(w--){ |
1014
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
62 int val = is_8bit ? *p : |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
63 flags & PIX_FMT_BE ? AV_RB16(p) : AV_RL16(p); |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
64 val = (val>>shift) & mask; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
65 if(read_pal_component) |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
66 val= data[1][4*val + c]; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
67 p+= step; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
68 *dst++= val; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
69 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
70 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
71 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
72 |
982
da1b5110dbd0
Rename read/write_line() to av_read/write_image_line().
mru
parents:
898
diff
changeset
|
73 void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], |
987 | 74 const AVPixFmtDescriptor *desc, int x, int y, int c, int w) |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
75 { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
76 AVComponentDescriptor comp = desc->comp[c]; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
77 int plane = comp.plane; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
78 int depth = comp.depth_minus1+1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
79 int step = comp.step_minus1+1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
80 int flags = desc->flags; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
81 |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
82 if (flags & PIX_FMT_BITSTREAM) { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
83 int skip = x*step + comp.offset_plus1-1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
84 uint8_t *p = data[plane] + y*linesize[plane] + (skip>>3); |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
85 int shift = 8 - depth - (skip&7); |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
86 |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
87 while (w--) { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
88 *p |= *src++ << shift; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
89 shift -= step; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
90 p -= shift>>3; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
91 shift &= 7; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
92 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
93 } else { |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
94 int shift = comp.shift; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
95 uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1; |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
96 |
1014
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
97 if (shift + depth <= 8) { |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
98 p += !!(flags & PIX_FMT_BE); |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
99 while (w--) { |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
100 *p |= (*src++<<shift); |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
101 p += step; |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
102 } |
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
103 } else { |
1015 | 104 while (w--) { |
105 if (flags & PIX_FMT_BE) { | |
106 uint16_t val = AV_RB16(p) | (*src++<<shift); | |
107 AV_WB16(p, val); | |
108 } else { | |
109 uint16_t val = AV_RL16(p) | (*src++<<shift); | |
110 AV_WL16(p, val); | |
111 } | |
112 p+= step; | |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
113 } |
1014
3728a7291737
pixdesc: use 8-bit accesses when possible in av_read/write_image_line()
mru
parents:
1013
diff
changeset
|
114 } |
836
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
115 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
116 } |
af688c6fa72f
Move read_line() and write_line() definition from pixdesc.h to
stefano
parents:
827
diff
changeset
|
117 |
781 | 118 const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { |
119 [PIX_FMT_YUV420P] = { | |
120 .name = "yuv420p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
121 .nb_components= 3, |
781 | 122 .log2_chroma_w= 1, |
123 .log2_chroma_h= 1, | |
124 .comp = { | |
125 {0,0,1,0,7}, /* Y */ | |
126 {1,0,1,0,7}, /* U */ | |
127 {2,0,1,0,7}, /* V */ | |
128 }, | |
129 }, | |
130 [PIX_FMT_YUYV422] = { | |
131 .name = "yuyv422", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
132 .nb_components= 3, |
781 | 133 .log2_chroma_w= 1, |
134 .log2_chroma_h= 0, | |
135 .comp = { | |
136 {0,1,1,0,7}, /* Y */ | |
137 {0,3,2,0,7}, /* U */ | |
138 {0,3,4,0,7}, /* V */ | |
139 }, | |
140 }, | |
141 [PIX_FMT_RGB24] = { | |
142 .name = "rgb24", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
143 .nb_components= 3, |
781 | 144 .log2_chroma_w= 0, |
145 .log2_chroma_h= 0, | |
146 .comp = { | |
147 {0,2,1,0,7}, /* R */ | |
148 {0,2,2,0,7}, /* G */ | |
149 {0,2,3,0,7}, /* B */ | |
150 }, | |
151 }, | |
152 [PIX_FMT_BGR24] = { | |
153 .name = "bgr24", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
154 .nb_components= 3, |
781 | 155 .log2_chroma_w= 0, |
156 .log2_chroma_h= 0, | |
157 .comp = { | |
158 {0,2,1,0,7}, /* B */ | |
159 {0,2,2,0,7}, /* G */ | |
160 {0,2,3,0,7}, /* R */ | |
161 }, | |
162 }, | |
163 [PIX_FMT_YUV422P] = { | |
164 .name = "yuv422p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
165 .nb_components= 3, |
781 | 166 .log2_chroma_w= 1, |
167 .log2_chroma_h= 0, | |
168 .comp = { | |
169 {0,0,1,0,7}, /* Y */ | |
170 {1,0,1,0,7}, /* U */ | |
171 {2,0,1,0,7}, /* V */ | |
172 }, | |
173 }, | |
174 [PIX_FMT_YUV444P] = { | |
175 .name = "yuv444p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
176 .nb_components= 3, |
781 | 177 .log2_chroma_w= 0, |
178 .log2_chroma_h= 0, | |
179 .comp = { | |
180 {0,0,1,0,7}, /* Y */ | |
181 {1,0,1,0,7}, /* U */ | |
182 {2,0,1,0,7}, /* V */ | |
183 }, | |
184 }, | |
185 [PIX_FMT_YUV410P] = { | |
186 .name = "yuv410p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
187 .nb_components= 3, |
781 | 188 .log2_chroma_w= 2, |
189 .log2_chroma_h= 2, | |
190 .comp = { | |
191 {0,0,1,0,7}, /* Y */ | |
192 {1,0,1,0,7}, /* U */ | |
193 {2,0,1,0,7}, /* V */ | |
194 }, | |
195 }, | |
196 [PIX_FMT_YUV411P] = { | |
197 .name = "yuv411p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
198 .nb_components= 3, |
781 | 199 .log2_chroma_w= 2, |
200 .log2_chroma_h= 0, | |
201 .comp = { | |
202 {0,0,1,0,7}, /* Y */ | |
203 {1,0,1,0,7}, /* U */ | |
204 {2,0,1,0,7}, /* V */ | |
205 }, | |
206 }, | |
207 [PIX_FMT_GRAY8] = { | |
796
ecf400e9601b
Make av_pix_fmt_descriptors use the same pixel format names as defined
stefano
parents:
791
diff
changeset
|
208 .name = "gray", |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
209 .nb_components= 1, |
781 | 210 .log2_chroma_w= 0, |
211 .log2_chroma_h= 0, | |
212 .comp = { | |
213 {0,0,1,0,7}, /* Y */ | |
214 }, | |
856
f01741b79070
Declare the PIX_FMT_GRAY8 pixel format as a paletted format. This is
stefano
parents:
836
diff
changeset
|
215 .flags = PIX_FMT_PAL, |
781 | 216 }, |
217 [PIX_FMT_MONOWHITE] = { | |
796
ecf400e9601b
Make av_pix_fmt_descriptors use the same pixel format names as defined
stefano
parents:
791
diff
changeset
|
218 .name = "monow", |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
219 .nb_components= 1, |
781 | 220 .log2_chroma_w= 0, |
221 .log2_chroma_h= 0, | |
222 .comp = { | |
223 {0,0,1,0,0}, /* Y */ | |
224 }, | |
225 .flags = PIX_FMT_BITSTREAM, | |
226 }, | |
227 [PIX_FMT_MONOBLACK] = { | |
796
ecf400e9601b
Make av_pix_fmt_descriptors use the same pixel format names as defined
stefano
parents:
791
diff
changeset
|
228 .name = "monob", |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
229 .nb_components= 1, |
781 | 230 .log2_chroma_w= 0, |
231 .log2_chroma_h= 0, | |
232 .comp = { | |
233 {0,0,1,7,0}, /* Y */ | |
234 }, | |
235 .flags = PIX_FMT_BITSTREAM, | |
236 }, | |
237 [PIX_FMT_PAL8] = { | |
238 .name = "pal8", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
239 .nb_components= 1, |
781 | 240 .log2_chroma_w= 0, |
241 .log2_chroma_h= 0, | |
242 .comp = { | |
243 {0,0,1,0,7}, | |
244 }, | |
245 .flags = PIX_FMT_PAL, | |
246 }, | |
247 [PIX_FMT_YUVJ420P] = { | |
248 .name = "yuvj420p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
249 .nb_components= 3, |
781 | 250 .log2_chroma_w= 1, |
251 .log2_chroma_h= 1, | |
252 .comp = { | |
253 {0,0,1,0,7}, /* Y */ | |
254 {1,0,1,0,7}, /* U */ | |
255 {2,0,1,0,7}, /* V */ | |
256 }, | |
257 }, | |
258 [PIX_FMT_YUVJ422P] = { | |
259 .name = "yuvj422p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
260 .nb_components= 3, |
781 | 261 .log2_chroma_w= 1, |
262 .log2_chroma_h= 0, | |
263 .comp = { | |
264 {0,0,1,0,7}, /* Y */ | |
265 {1,0,1,0,7}, /* U */ | |
266 {2,0,1,0,7}, /* V */ | |
267 }, | |
268 }, | |
269 [PIX_FMT_YUVJ444P] = { | |
270 .name = "yuvj444p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
271 .nb_components= 3, |
781 | 272 .log2_chroma_w= 0, |
273 .log2_chroma_h= 0, | |
274 .comp = { | |
275 {0,0,1,0,7}, /* Y */ | |
276 {1,0,1,0,7}, /* U */ | |
277 {2,0,1,0,7}, /* V */ | |
278 }, | |
279 }, | |
783
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
280 [PIX_FMT_XVMC_MPEG2_MC] = { |
796
ecf400e9601b
Make av_pix_fmt_descriptors use the same pixel format names as defined
stefano
parents:
791
diff
changeset
|
281 .name = "xvmcmc", |
783
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
282 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
283 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
284 [PIX_FMT_XVMC_MPEG2_IDCT] = { |
796
ecf400e9601b
Make av_pix_fmt_descriptors use the same pixel format names as defined
stefano
parents:
791
diff
changeset
|
285 .name = "xvmcidct", |
783
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
286 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
287 }, |
781 | 288 [PIX_FMT_UYVY422] = { |
289 .name = "uyvy422", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
290 .nb_components= 3, |
781 | 291 .log2_chroma_w= 1, |
292 .log2_chroma_h= 0, | |
293 .comp = { | |
294 {0,1,2,0,7}, /* Y */ | |
295 {0,3,1,0,7}, /* U */ | |
296 {0,3,3,0,7}, /* V */ | |
297 }, | |
298 }, | |
299 [PIX_FMT_UYYVYY411] = { | |
300 .name = "uyyvyy411", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
301 .nb_components= 3, |
781 | 302 .log2_chroma_w= 2, |
303 .log2_chroma_h= 0, | |
304 .comp = { | |
305 {0,3,2,0,7}, /* Y */ | |
306 {0,5,1,0,7}, /* U */ | |
307 {0,5,4,0,7}, /* V */ | |
308 }, | |
309 }, | |
310 [PIX_FMT_BGR8] = { | |
311 .name = "bgr8", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
312 .nb_components= 3, |
781 | 313 .log2_chroma_w= 0, |
314 .log2_chroma_h= 0, | |
315 .comp = { | |
316 {0,0,1,6,1}, /* B */ | |
317 {0,0,1,3,2}, /* G */ | |
318 {0,0,1,0,2}, /* R */ | |
319 }, | |
782
9b06eaf7b6ef
Add PIX_FMT_PAL flag to BGR8, BGR4_BYTE, RGB8, and RGB4_BYTE formats.
stefano
parents:
781
diff
changeset
|
320 .flags = PIX_FMT_PAL, |
781 | 321 }, |
322 [PIX_FMT_BGR4] = { | |
323 .name = "bgr4", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
324 .nb_components= 3, |
781 | 325 .log2_chroma_w= 0, |
326 .log2_chroma_h= 0, | |
327 .comp = { | |
328 {0,3,1,0,0}, /* B */ | |
329 {0,3,2,0,1}, /* G */ | |
330 {0,3,4,0,0}, /* R */ | |
331 }, | |
332 .flags = PIX_FMT_BITSTREAM, | |
333 }, | |
334 [PIX_FMT_BGR4_BYTE] = { | |
335 .name = "bgr4_byte", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
336 .nb_components= 3, |
781 | 337 .log2_chroma_w= 0, |
338 .log2_chroma_h= 0, | |
339 .comp = { | |
340 {0,0,1,3,0}, /* B */ | |
341 {0,0,1,1,1}, /* G */ | |
342 {0,0,1,0,0}, /* R */ | |
343 }, | |
782
9b06eaf7b6ef
Add PIX_FMT_PAL flag to BGR8, BGR4_BYTE, RGB8, and RGB4_BYTE formats.
stefano
parents:
781
diff
changeset
|
344 .flags = PIX_FMT_PAL, |
781 | 345 }, |
346 [PIX_FMT_RGB8] = { | |
347 .name = "rgb8", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
348 .nb_components= 3, |
781 | 349 .log2_chroma_w= 0, |
350 .log2_chroma_h= 0, | |
351 .comp = { | |
352 {0,0,1,6,1}, /* R */ | |
353 {0,0,1,3,2}, /* G */ | |
354 {0,0,1,0,2}, /* B */ | |
355 }, | |
782
9b06eaf7b6ef
Add PIX_FMT_PAL flag to BGR8, BGR4_BYTE, RGB8, and RGB4_BYTE formats.
stefano
parents:
781
diff
changeset
|
356 .flags = PIX_FMT_PAL, |
781 | 357 }, |
358 [PIX_FMT_RGB4] = { | |
359 .name = "rgb4", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
360 .nb_components= 3, |
781 | 361 .log2_chroma_w= 0, |
362 .log2_chroma_h= 0, | |
363 .comp = { | |
364 {0,3,1,0,0}, /* R */ | |
365 {0,3,2,0,1}, /* G */ | |
366 {0,3,4,0,0}, /* B */ | |
367 }, | |
368 .flags = PIX_FMT_BITSTREAM, | |
369 }, | |
370 [PIX_FMT_RGB4_BYTE] = { | |
371 .name = "rgb4_byte", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
372 .nb_components= 3, |
781 | 373 .log2_chroma_w= 0, |
374 .log2_chroma_h= 0, | |
375 .comp = { | |
376 {0,0,1,3,0}, /* R */ | |
377 {0,0,1,1,1}, /* G */ | |
378 {0,0,1,0,0}, /* B */ | |
379 }, | |
782
9b06eaf7b6ef
Add PIX_FMT_PAL flag to BGR8, BGR4_BYTE, RGB8, and RGB4_BYTE formats.
stefano
parents:
781
diff
changeset
|
380 .flags = PIX_FMT_PAL, |
781 | 381 }, |
382 [PIX_FMT_NV12] = { | |
383 .name = "nv12", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
384 .nb_components= 3, |
781 | 385 .log2_chroma_w= 1, |
386 .log2_chroma_h= 1, | |
387 .comp = { | |
388 {0,0,1,0,7}, /* Y */ | |
389 {1,1,1,0,7}, /* U */ | |
390 {1,1,2,0,7}, /* V */ | |
391 }, | |
392 }, | |
393 [PIX_FMT_NV21] = { | |
394 .name = "nv21", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
395 .nb_components= 3, |
781 | 396 .log2_chroma_w= 1, |
397 .log2_chroma_h= 1, | |
398 .comp = { | |
399 {0,0,1,0,7}, /* Y */ | |
400 {1,1,1,0,7}, /* V */ | |
401 {1,1,2,0,7}, /* U */ | |
402 }, | |
403 }, | |
404 [PIX_FMT_ARGB] = { | |
405 .name = "argb", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
406 .nb_components= 4, |
781 | 407 .log2_chroma_w= 0, |
408 .log2_chroma_h= 0, | |
409 .comp = { | |
410 {0,3,1,0,7}, /* A */ | |
411 {0,3,2,0,7}, /* R */ | |
412 {0,3,3,0,7}, /* G */ | |
413 {0,3,4,0,7}, /* B */ | |
414 }, | |
415 }, | |
416 [PIX_FMT_RGBA] = { | |
417 .name = "rgba", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
418 .nb_components= 4, |
781 | 419 .log2_chroma_w= 0, |
420 .log2_chroma_h= 0, | |
421 .comp = { | |
422 {0,3,1,0,7}, /* R */ | |
423 {0,3,2,0,7}, /* G */ | |
424 {0,3,3,0,7}, /* B */ | |
425 {0,3,4,0,7}, /* A */ | |
426 }, | |
427 }, | |
428 [PIX_FMT_ABGR] = { | |
429 .name = "abgr", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
430 .nb_components= 4, |
781 | 431 .log2_chroma_w= 0, |
432 .log2_chroma_h= 0, | |
433 .comp = { | |
434 {0,3,1,0,7}, /* A */ | |
435 {0,3,2,0,7}, /* B */ | |
436 {0,3,3,0,7}, /* G */ | |
437 {0,3,4,0,7}, /* R */ | |
438 }, | |
439 }, | |
440 [PIX_FMT_BGRA] = { | |
441 .name = "bgra", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
442 .nb_components= 4, |
781 | 443 .log2_chroma_w= 0, |
444 .log2_chroma_h= 0, | |
445 .comp = { | |
446 {0,3,1,0,7}, /* B */ | |
447 {0,3,2,0,7}, /* G */ | |
448 {0,3,3,0,7}, /* R */ | |
449 {0,3,4,0,7}, /* A */ | |
450 }, | |
451 }, | |
452 [PIX_FMT_GRAY16BE] = { | |
453 .name = "gray16be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
454 .nb_components= 1, |
781 | 455 .log2_chroma_w= 0, |
456 .log2_chroma_h= 0, | |
457 .comp = { | |
458 {0,1,1,0,15}, /* Y */ | |
459 }, | |
460 .flags = PIX_FMT_BE, | |
461 }, | |
462 [PIX_FMT_GRAY16LE] = { | |
463 .name = "gray16le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
464 .nb_components= 1, |
781 | 465 .log2_chroma_w= 0, |
466 .log2_chroma_h= 0, | |
467 .comp = { | |
468 {0,1,1,0,15}, /* Y */ | |
469 }, | |
470 }, | |
471 [PIX_FMT_YUV440P] = { | |
472 .name = "yuv440p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
473 .nb_components= 3, |
781 | 474 .log2_chroma_w= 0, |
475 .log2_chroma_h= 1, | |
476 .comp = { | |
477 {0,0,1,0,7}, /* Y */ | |
478 {1,0,1,0,7}, /* U */ | |
479 {2,0,1,0,7}, /* V */ | |
480 }, | |
481 }, | |
482 [PIX_FMT_YUVJ440P] = { | |
483 .name = "yuvj440p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
484 .nb_components= 3, |
781 | 485 .log2_chroma_w= 0, |
486 .log2_chroma_h= 1, | |
487 .comp = { | |
488 {0,0,1,0,7}, /* Y */ | |
489 {1,0,1,0,7}, /* U */ | |
490 {2,0,1,0,7}, /* V */ | |
491 }, | |
492 }, | |
493 [PIX_FMT_YUVA420P] = { | |
494 .name = "yuva420p", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
495 .nb_components= 4, |
781 | 496 .log2_chroma_w= 1, |
497 .log2_chroma_h= 1, | |
498 .comp = { | |
499 {0,0,1,0,7}, /* Y */ | |
500 {1,0,1,0,7}, /* U */ | |
501 {2,0,1,0,7}, /* V */ | |
502 {3,0,1,0,7}, /* A */ | |
503 }, | |
504 }, | |
783
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
505 [PIX_FMT_VDPAU_H264] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
506 .name = "vdpau_h264", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
507 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
508 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
509 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
510 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
511 [PIX_FMT_VDPAU_MPEG1] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
512 .name = "vdpau_mpeg1", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
513 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
514 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
515 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
516 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
517 [PIX_FMT_VDPAU_MPEG2] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
518 .name = "vdpau_mpeg2", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
519 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
520 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
521 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
522 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
523 [PIX_FMT_VDPAU_WMV3] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
524 .name = "vdpau_wmv3", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
525 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
526 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
527 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
528 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
529 [PIX_FMT_VDPAU_VC1] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
530 .name = "vdpau_vc1", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
531 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
532 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
533 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
534 }, |
787 | 535 [PIX_FMT_VDPAU_MPEG4] = { |
536 .name = "vdpau_mpeg4", | |
537 .log2_chroma_w = 1, | |
538 .log2_chroma_h = 1, | |
539 .flags = PIX_FMT_HWACCEL, | |
540 }, | |
781 | 541 [PIX_FMT_RGB48BE] = { |
542 .name = "rgb48be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
543 .nb_components= 3, |
781 | 544 .log2_chroma_w= 0, |
545 .log2_chroma_h= 0, | |
546 .comp = { | |
547 {0,5,1,0,15}, /* R */ | |
548 {0,5,3,0,15}, /* G */ | |
549 {0,5,5,0,15}, /* B */ | |
550 }, | |
551 .flags = PIX_FMT_BE, | |
552 }, | |
553 [PIX_FMT_RGB48LE] = { | |
554 .name = "rgb48le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
555 .nb_components= 3, |
781 | 556 .log2_chroma_w= 0, |
557 .log2_chroma_h= 0, | |
558 .comp = { | |
559 {0,5,1,0,15}, /* R */ | |
560 {0,5,3,0,15}, /* G */ | |
561 {0,5,5,0,15}, /* B */ | |
562 }, | |
563 }, | |
564 [PIX_FMT_RGB565BE] = { | |
565 .name = "rgb565be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
566 .nb_components= 3, |
781 | 567 .log2_chroma_w= 0, |
568 .log2_chroma_h= 0, | |
569 .comp = { | |
570 {0,1,0,3,4}, /* R */ | |
571 {0,1,1,5,5}, /* G */ | |
572 {0,1,1,0,4}, /* B */ | |
573 }, | |
574 .flags = PIX_FMT_BE, | |
575 }, | |
576 [PIX_FMT_RGB565LE] = { | |
577 .name = "rgb565le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
578 .nb_components= 3, |
781 | 579 .log2_chroma_w= 0, |
580 .log2_chroma_h= 0, | |
581 .comp = { | |
582 {0,1,2,3,4}, /* R */ | |
583 {0,1,1,5,5}, /* G */ | |
584 {0,1,1,0,4}, /* B */ | |
585 }, | |
586 }, | |
587 [PIX_FMT_RGB555BE] = { | |
588 .name = "rgb555be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
589 .nb_components= 3, |
781 | 590 .log2_chroma_w= 0, |
591 .log2_chroma_h= 0, | |
592 .comp = { | |
593 {0,1,0,2,4}, /* R */ | |
594 {0,1,1,5,4}, /* G */ | |
595 {0,1,1,0,4}, /* B */ | |
596 }, | |
597 .flags = PIX_FMT_BE, | |
598 }, | |
599 [PIX_FMT_RGB555LE] = { | |
600 .name = "rgb555le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
601 .nb_components= 3, |
781 | 602 .log2_chroma_w= 0, |
603 .log2_chroma_h= 0, | |
604 .comp = { | |
605 {0,1,2,2,4}, /* R */ | |
606 {0,1,1,5,4}, /* G */ | |
607 {0,1,1,0,4}, /* B */ | |
608 }, | |
609 }, | |
857 | 610 [PIX_FMT_RGB444BE] = { |
611 .name = "rgb444be", | |
612 .nb_components= 3, | |
613 .log2_chroma_w= 0, | |
614 .log2_chroma_h= 0, | |
615 .comp = { | |
616 {0,1,0,0,3}, /* R */ | |
617 {0,1,1,4,3}, /* G */ | |
618 {0,1,1,0,3}, /* B */ | |
619 }, | |
620 .flags = PIX_FMT_BE, | |
621 }, | |
622 [PIX_FMT_RGB444LE] = { | |
623 .name = "rgb444le", | |
624 .nb_components= 3, | |
625 .log2_chroma_w= 0, | |
626 .log2_chroma_h= 0, | |
627 .comp = { | |
628 {0,1,2,0,3}, /* R */ | |
629 {0,1,1,4,3}, /* G */ | |
630 {0,1,1,0,3}, /* B */ | |
631 }, | |
632 }, | |
781 | 633 [PIX_FMT_BGR565BE] = { |
634 .name = "bgr565be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
635 .nb_components= 3, |
781 | 636 .log2_chroma_w= 0, |
637 .log2_chroma_h= 0, | |
638 .comp = { | |
639 {0,1,0,3,4}, /* B */ | |
640 {0,1,1,5,5}, /* G */ | |
641 {0,1,1,0,4}, /* R */ | |
642 }, | |
643 .flags = PIX_FMT_BE, | |
644 }, | |
645 [PIX_FMT_BGR565LE] = { | |
646 .name = "bgr565le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
647 .nb_components= 3, |
781 | 648 .log2_chroma_w= 0, |
649 .log2_chroma_h= 0, | |
650 .comp = { | |
651 {0,1,2,3,4}, /* B */ | |
652 {0,1,1,5,5}, /* G */ | |
653 {0,1,1,0,4}, /* R */ | |
654 }, | |
655 }, | |
656 [PIX_FMT_BGR555BE] = { | |
657 .name = "bgr555be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
658 .nb_components= 3, |
781 | 659 .log2_chroma_w= 0, |
660 .log2_chroma_h= 0, | |
661 .comp = { | |
662 {0,1,0,2,4}, /* B */ | |
663 {0,1,1,5,4}, /* G */ | |
664 {0,1,1,0,4}, /* R */ | |
665 }, | |
666 .flags = PIX_FMT_BE, | |
667 }, | |
668 [PIX_FMT_BGR555LE] = { | |
669 .name = "bgr555le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
670 .nb_components= 3, |
781 | 671 .log2_chroma_w= 0, |
672 .log2_chroma_h= 0, | |
673 .comp = { | |
674 {0,1,2,2,4}, /* B */ | |
675 {0,1,1,5,4}, /* G */ | |
676 {0,1,1,0,4}, /* R */ | |
677 }, | |
678 }, | |
857 | 679 [PIX_FMT_BGR444BE] = { |
680 .name = "bgr444be", | |
681 .nb_components= 3, | |
682 .log2_chroma_w= 0, | |
683 .log2_chroma_h= 0, | |
684 .comp = { | |
685 {0,1,0,0,3}, /* B */ | |
686 {0,1,1,4,3}, /* G */ | |
687 {0,1,1,0,3}, /* R */ | |
688 }, | |
689 .flags = PIX_FMT_BE, | |
690 }, | |
691 [PIX_FMT_BGR444LE] = { | |
692 .name = "bgr444le", | |
693 .nb_components= 3, | |
694 .log2_chroma_w= 0, | |
695 .log2_chroma_h= 0, | |
696 .comp = { | |
697 {0,1,2,0,3}, /* B */ | |
698 {0,1,1,4,3}, /* G */ | |
699 {0,1,1,0,3}, /* R */ | |
700 }, | |
701 }, | |
783
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
702 [PIX_FMT_VAAPI_MOCO] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
703 .name = "vaapi_moco", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
704 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
705 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
706 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
707 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
708 [PIX_FMT_VAAPI_IDCT] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
709 .name = "vaapi_idct", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
710 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
711 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
712 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
713 }, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
714 [PIX_FMT_VAAPI_VLD] = { |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
715 .name = "vaapi_vld", |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
716 .log2_chroma_w = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
717 .log2_chroma_h = 1, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
718 .flags = PIX_FMT_HWACCEL, |
c0b4f10edb74
Add pixel format descriptors for the HW-accelerated formats.
stefano
parents:
782
diff
changeset
|
719 }, |
781 | 720 [PIX_FMT_YUV420P16LE] = { |
721 .name = "yuv420p16le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
722 .nb_components= 3, |
781 | 723 .log2_chroma_w= 1, |
724 .log2_chroma_h= 1, | |
725 .comp = { | |
726 {0,1,1,0,15}, /* Y */ | |
727 {1,1,1,0,15}, /* U */ | |
728 {2,1,1,0,15}, /* V */ | |
729 }, | |
730 }, | |
731 [PIX_FMT_YUV420P16BE] = { | |
732 .name = "yuv420p16be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
733 .nb_components= 3, |
781 | 734 .log2_chroma_w= 1, |
735 .log2_chroma_h= 1, | |
736 .comp = { | |
737 {0,1,1,0,15}, /* Y */ | |
738 {1,1,1,0,15}, /* U */ | |
739 {2,1,1,0,15}, /* V */ | |
740 }, | |
741 .flags = PIX_FMT_BE, | |
742 }, | |
743 [PIX_FMT_YUV422P16LE] = { | |
744 .name = "yuv422p16le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
745 .nb_components= 3, |
781 | 746 .log2_chroma_w= 1, |
747 .log2_chroma_h= 0, | |
748 .comp = { | |
749 {0,1,1,0,15}, /* Y */ | |
750 {1,1,1,0,15}, /* U */ | |
751 {2,1,1,0,15}, /* V */ | |
752 }, | |
753 }, | |
754 [PIX_FMT_YUV422P16BE] = { | |
755 .name = "yuv422p16be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
756 .nb_components= 3, |
781 | 757 .log2_chroma_w= 1, |
758 .log2_chroma_h= 0, | |
759 .comp = { | |
760 {0,1,1,0,15}, /* Y */ | |
761 {1,1,1,0,15}, /* U */ | |
762 {2,1,1,0,15}, /* V */ | |
763 }, | |
764 .flags = PIX_FMT_BE, | |
765 }, | |
766 [PIX_FMT_YUV444P16LE] = { | |
767 .name = "yuv444p16le", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
768 .nb_components= 3, |
781 | 769 .log2_chroma_w= 0, |
770 .log2_chroma_h= 0, | |
771 .comp = { | |
772 {0,1,1,0,15}, /* Y */ | |
773 {1,1,1,0,15}, /* U */ | |
774 {2,1,1,0,15}, /* V */ | |
775 }, | |
776 }, | |
777 [PIX_FMT_YUV444P16BE] = { | |
778 .name = "yuv444p16be", | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
779 .nb_components= 3, |
781 | 780 .log2_chroma_w= 0, |
781 .log2_chroma_h= 0, | |
782 .comp = { | |
783 {0,1,1,0,15}, /* Y */ | |
784 {1,1,1,0,15}, /* U */ | |
785 {2,1,1,0,15}, /* V */ | |
786 }, | |
787 .flags = PIX_FMT_BE, | |
788 }, | |
818 | 789 [PIX_FMT_DXVA2_VLD] = { |
790 .name = "dxva2_vld", | |
791 .log2_chroma_w = 1, | |
792 .log2_chroma_h = 1, | |
793 .flags = PIX_FMT_HWACCEL, | |
794 }, | |
898 | 795 [PIX_FMT_Y400A] = { |
796 .name = "y400a", | |
797 .nb_components= 2, | |
798 .comp = { | |
799 {0,1,1,0,7}, /* Y */ | |
800 {0,1,2,0,7}, /* A */ | |
801 }, | |
802 }, | |
781 | 803 }; |
804 | |
827
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
805 static enum PixelFormat get_pix_fmt_internal(const char *name) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
806 { |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
807 enum PixelFormat pix_fmt; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
808 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
809 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
810 if (av_pix_fmt_descriptors[pix_fmt].name && |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
811 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name)) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
812 return pix_fmt; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
813 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
814 return PIX_FMT_NONE; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
815 } |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
816 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
817 #if HAVE_BIGENDIAN |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
818 # define X_NE(be, le) be |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
819 #else |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
820 # define X_NE(be, le) le |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
821 #endif |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
822 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
823 enum PixelFormat av_get_pix_fmt(const char *name) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
824 { |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
825 enum PixelFormat pix_fmt; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
826 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
827 if (!strcmp(name, "rgb32")) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
828 name = X_NE("argb", "bgra"); |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
829 else if (!strcmp(name, "bgr32")) |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
830 name = X_NE("abgr", "rgba"); |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
831 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
832 pix_fmt = get_pix_fmt_internal(name); |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
833 if (pix_fmt == PIX_FMT_NONE) { |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
834 char name2[32]; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
835 |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
836 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le")); |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
837 pix_fmt = get_pix_fmt_internal(name2); |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
838 } |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
839 return pix_fmt; |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
840 } |
f01765adeb5c
Implement av_get_pix_fmt(), and deprecate avcodec_get_pix_fmt().
stefano
parents:
818
diff
changeset
|
841 |
781 | 842 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) |
843 { | |
844 int c, bits = 0; | |
845 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h; | |
846 | |
791
ecf67bd079fe
Rename AVPixFmtDescriptor.nb_channels to nb_components, the new name
stefano
parents:
787
diff
changeset
|
847 for (c = 0; c < pixdesc->nb_components; c++) { |
781 | 848 int s = c==1 || c==2 ? 0 : log2_pixels; |
849 bits += (pixdesc->comp[c].depth_minus1+1) << s; | |
850 } | |
851 | |
852 return bits >> log2_pixels; | |
853 } |