Mercurial > libavcodec.hg
annotate raw.c @ 7459:283eeda62184 libavcodec
Modify av_audio_convert() to use AVAudioConvert context struct; add av_audio_convert_alloc() and av_audio_convert_free() support functions.
author | pross |
---|---|
date | Fri, 01 Aug 2008 13:53:18 +0000 |
parents | 6b8daf48b82f |
children | 76f6a08c9fe6 |
rev | line source |
---|---|
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
1 /* |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
2 * Raw Video Codec |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
3 * Copyright (c) 2001 Fabrice Bellard. |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
4 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
5 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
6 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
11 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
16 * |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3777
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2979
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
20 */ |
2967 | 21 |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
22 /** |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
23 * @file raw.c |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
24 * Raw Video Codec |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
25 */ |
2967 | 26 |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
27 #include "avcodec.h" |
5264
810df021dbef
split rawvideo encoder and decoder in their own files
aurel
parents:
4872
diff
changeset
|
28 #include "raw.h" |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
29 |
5264
810df021dbef
split rawvideo encoder and decoder in their own files
aurel
parents:
4872
diff
changeset
|
30 const PixelFormatTag ff_raw_pixelFormatTags[] = { |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
31 { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
32 { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, |
3587
d4ab276e5987
Add YV12 support, patch by Steve Lhomme % steve P lhomme A free P fr %
gpoirier
parents:
3306
diff
changeset
|
33 { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') }, |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
34 { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') }, |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
35 { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') }, |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
36 { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') }, |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
37 { PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') }, |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
38 { PIX_FMT_GRAY8, MKTAG(' ', ' ', 'Y', '8') }, |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
39 |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
40 |
4494
ce643a22f049
Replace deprecated PIX_FMT names by the newer variants.
diego
parents:
4170
diff
changeset
|
41 { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */ |
ce643a22f049
Replace deprecated PIX_FMT names by the newer variants.
diego
parents:
4170
diff
changeset
|
42 { PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') }, |
2142
caacb3f9ee51
Add UYVY support to libavcodec/raw.c patch by ("Todd.Kirby" <doubleshot at pacbell dot net>)
michael
parents:
2133
diff
changeset
|
43 { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') }, |
5695 | 44 { PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') }, |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
45 { PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') }, |
4082
f72cc635cce9
adds missing rgb/bgr 555 codec->fmt mappings, ok'ed by Michael
reynaldo
parents:
3947
diff
changeset
|
46 { PIX_FMT_RGB555, MKTAG('R', 'G', 'B', 15) }, |
f72cc635cce9
adds missing rgb/bgr 555 codec->fmt mappings, ok'ed by Michael
reynaldo
parents:
3947
diff
changeset
|
47 { PIX_FMT_BGR555, MKTAG('B', 'G', 'R', 15) }, |
4083
065ee7dd69ca
adds missing rgb/bgr 565 codec->fmt mappings, ok'ed by Michael
reynaldo
parents:
4082
diff
changeset
|
48 { PIX_FMT_RGB565, MKTAG('R', 'G', 'B', 16) }, |
065ee7dd69ca
adds missing rgb/bgr 565 codec->fmt mappings, ok'ed by Michael
reynaldo
parents:
4082
diff
changeset
|
49 { PIX_FMT_BGR565, MKTAG('B', 'G', 'R', 16) }, |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
50 |
3306 | 51 /* quicktime */ |
52 { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') }, | |
4619 | 53 { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */ |
3306 | 54 |
1139
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
55 { -1, 0 }, |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
56 }; |
6842feb093c1
rawvideo patch by (Fred Rothganger <rothgang at uiuc dot edu>)
michaelni
parents:
diff
changeset
|
57 |
2341 | 58 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt) |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
59 { |
5264
810df021dbef
split rawvideo encoder and decoder in their own files
aurel
parents:
4872
diff
changeset
|
60 const PixelFormatTag * tags = ff_raw_pixelFormatTags; |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
61 while (tags->pix_fmt >= 0) { |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
62 if (tags->pix_fmt == fmt) |
2979 | 63 return tags->fourcc; |
64 tags++; | |
1231
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
65 } |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
66 return 0; |
b88dfc4bbf8c
* introducing new public interface in imgconvert.c
romansh
parents:
1195
diff
changeset
|
67 } |