annotate fmt-conversion.h @ 25317:7f3cb5408f28

Fixed VIDIX color bug that was introduced when Radeon VIDIX driver was synchronized with vidix.sf.net. The red color was saturating. Corrected value fixes the issue and restore the color to the level it used to have before synchronization. Meaning of the value remains unknow but was retrieved from register's value of a Radeon 9000 card, so it may need further testing. Patch by Guillaume Lecerf (foxcore at gmail dot com)
author ben
date Mon, 10 Dec 2007 19:27:46 +0000
parents bc46e44e1f69
children 4129c8cfa742
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24156
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
1 #ifndef FMT_CONVERSION_H
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
2 #define FMT_CONVERSION_H
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
3
21778
bf1fbe97cc40 Fix build with shared libavutil. Approved by Diego.
rathann
parents: 19930
diff changeset
4 #ifdef USE_LIBAVUTIL_SO
bf1fbe97cc40 Fix build with shared libavutil. Approved by Diego.
rathann
parents: 19930
diff changeset
5 #include <ffmpeg/avutil.h>
bf1fbe97cc40 Fix build with shared libavutil. Approved by Diego.
rathann
parents: 19930
diff changeset
6 #else
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
7 #include "avutil.h"
21778
bf1fbe97cc40 Fix build with shared libavutil. Approved by Diego.
rathann
parents: 19930
diff changeset
8 #endif
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
9 #include "img_format.h"
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
10
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
11 enum PixelFormat imgfmt2pixfmt(int fmt)
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
12 {
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
13 switch (fmt) {
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
14 case IMGFMT_BGR32:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
15 return PIX_FMT_RGB32;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
16 case IMGFMT_BGR24:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
17 return PIX_FMT_BGR24;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
18 case IMGFMT_BGR16:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
19 return PIX_FMT_BGR565;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
20 case IMGFMT_BGR15:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
21 return PIX_FMT_BGR555;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
22 case IMGFMT_BGR8:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
23 return PIX_FMT_BGR8;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
24 case IMGFMT_BGR4:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
25 return PIX_FMT_BGR4;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
26 case IMGFMT_BGR1:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
27 case IMGFMT_RGB1:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
28 return PIX_FMT_MONOBLACK;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
29 case IMGFMT_RG4B:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
30 return PIX_FMT_RGB4_BYTE;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
31 case IMGFMT_BG4B:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
32 return PIX_FMT_BGR4_BYTE;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
33 case IMGFMT_RGB32:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
34 return PIX_FMT_BGR32;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
35 case IMGFMT_RGB24:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
36 return PIX_FMT_RGB24;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
37 case IMGFMT_RGB16:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
38 return PIX_FMT_RGB565;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
39 case IMGFMT_RGB15:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
40 return PIX_FMT_RGB555;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
41 case IMGFMT_RGB8:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
42 return PIX_FMT_RGB8;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
43 case IMGFMT_RGB4:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
44 return PIX_FMT_RGB4;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
45 case IMGFMT_YUY2:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
46 return PIX_FMT_YUYV422;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
47 case IMGFMT_UYVY:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
48 return PIX_FMT_UYVY422;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
49 case IMGFMT_NV12:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
50 return PIX_FMT_NV12;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
51 case IMGFMT_NV21:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
52 return PIX_FMT_NV21;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
53 case IMGFMT_Y800:
19916
3c9f5824444e Add conversion from IMGFMT_Y8 to PIX_FMT_GRAY8
lucabe
parents: 19872
diff changeset
54 case IMGFMT_Y8:
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
55 return PIX_FMT_GRAY8;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
56 case IMGFMT_IF09:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
57 case IMGFMT_YVU9:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
58 return PIX_FMT_YUV410P;
19930
5d0eaf70e1bc Add missing conversion from IMGFMT_I420 to PIX_FMT_YUV420P.
corey
parents: 19916
diff changeset
59 case IMGFMT_I420:
24416
bc46e44e1f69 DOCS/tech/colorspaces.txt says I420 and IYUV are the same, so add IYUV at the
reimar
parents: 24156
diff changeset
60 case IMGFMT_IYUV:
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
61 case IMGFMT_YV12:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
62 return PIX_FMT_YUV420P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
63 case IMGFMT_411P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
64 return PIX_FMT_YUV411P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
65 case IMGFMT_422P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
66 return PIX_FMT_YUV422P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
67 case IMGFMT_444P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
68 return PIX_FMT_YUV444P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
69 default:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
70 fprintf(stderr, "Unsupported format %s\n", vo_format_name(fmt));
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
71 }
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
72
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
73 return PIX_FMT_NONE;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
74 }
24156
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
75
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
76 #endif /* FMT_CONVERSION_H */