libaom: remove references to yuv440p pixfmt
[libav.git] / libavcodec / libaom.c
CommitLineData
c438899a
LB
1/*
2 * Copyright (c) 2013 Guillaume Martres <smarter@ubuntu.com>
3 *
4 * This file is part of Libav.
5 *
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <aom/aom_image.h>
22
23#include "libaom.h"
24
25#define HIGH_DEPTH(fmt) \
26case AOM_IMG_FMT_I ## fmt ## 16: \
27 switch (depth) { \
28 case 8: \
29 return AV_PIX_FMT_YUV ## fmt ## P; \
30 case 10: \
31 return AV_PIX_FMT_YUV ## fmt ## P10; \
32 case 12: \
33 return AV_PIX_FMT_YUV ## fmt ## P12; \
34 default: \
35 return AV_PIX_FMT_NONE; \
36 }
37
38enum AVPixelFormat ff_aom_imgfmt_to_pixfmt(aom_img_fmt_t img, int depth)
39{
40 switch (img) {
41 case AOM_IMG_FMT_RGB24:
42 return AV_PIX_FMT_RGB24;
43 case AOM_IMG_FMT_RGB565:
44 return AV_PIX_FMT_RGB565BE;
45 case AOM_IMG_FMT_RGB555:
46 return AV_PIX_FMT_RGB555BE;
47 case AOM_IMG_FMT_UYVY:
48 return AV_PIX_FMT_UYVY422;
49 case AOM_IMG_FMT_YUY2:
50 return AV_PIX_FMT_YUYV422;
51 case AOM_IMG_FMT_YVYU:
52 return AV_PIX_FMT_YVYU422;
53 case AOM_IMG_FMT_BGR24:
54 return AV_PIX_FMT_BGR24;
55 case AOM_IMG_FMT_ARGB:
56 return AV_PIX_FMT_ARGB;
57 case AOM_IMG_FMT_ARGB_LE:
58 return AV_PIX_FMT_BGRA;
59 case AOM_IMG_FMT_RGB565_LE:
60 return AV_PIX_FMT_RGB565LE;
61 case AOM_IMG_FMT_RGB555_LE:
62 return AV_PIX_FMT_RGB555LE;
63 case AOM_IMG_FMT_I420:
64 return AV_PIX_FMT_YUV420P;
65 case AOM_IMG_FMT_I422:
66 return AV_PIX_FMT_YUV422P;
67 case AOM_IMG_FMT_I444:
68 return AV_PIX_FMT_YUV444P;
69 case AOM_IMG_FMT_444A:
70 return AV_PIX_FMT_YUVA444P;
c438899a
LB
71 HIGH_DEPTH(420)
72 HIGH_DEPTH(422)
73 HIGH_DEPTH(444)
74 default:
75 return AV_PIX_FMT_NONE;
76 }
77}
78
79#undef HIGH_DEPTH
80
81aom_img_fmt_t ff_aom_pixfmt_to_imgfmt(enum AVPixelFormat pix)
82{
83 switch (pix) {
84 case AV_PIX_FMT_RGB24:
85 return AOM_IMG_FMT_RGB24;
86 case AV_PIX_FMT_RGB565BE:
87 return AOM_IMG_FMT_RGB565;
88 case AV_PIX_FMT_RGB555BE:
89 return AOM_IMG_FMT_RGB555;
90 case AV_PIX_FMT_UYVY422:
91 return AOM_IMG_FMT_UYVY;
92 case AV_PIX_FMT_YUYV422:
93 return AOM_IMG_FMT_YUY2;
94 case AV_PIX_FMT_YVYU422:
95 return AOM_IMG_FMT_YVYU;
96 case AV_PIX_FMT_BGR24:
97 return AOM_IMG_FMT_BGR24;
98 case AV_PIX_FMT_ARGB:
99 return AOM_IMG_FMT_ARGB;
100 case AV_PIX_FMT_BGRA:
101 return AOM_IMG_FMT_ARGB_LE;
102 case AV_PIX_FMT_RGB565LE:
103 return AOM_IMG_FMT_RGB565_LE;
104 case AV_PIX_FMT_RGB555LE:
105 return AOM_IMG_FMT_RGB555_LE;
106 case AV_PIX_FMT_YUV420P:
107 return AOM_IMG_FMT_I420;
108 case AV_PIX_FMT_YUV422P:
109 return AOM_IMG_FMT_I422;
110 case AV_PIX_FMT_YUV444P:
111 return AOM_IMG_FMT_I444;
112 case AV_PIX_FMT_YUVA444P:
113 return AOM_IMG_FMT_444A;
c438899a
LB
114 case AV_PIX_FMT_YUV420P10:
115 return AOM_IMG_FMT_I42016;
116 case AV_PIX_FMT_YUV422P10:
117 return AOM_IMG_FMT_I42216;
118 case AV_PIX_FMT_YUV444P10:
119 return AOM_IMG_FMT_I44416;
120 case AV_PIX_FMT_YUV420P12:
121 return AOM_IMG_FMT_I42016;
122 case AV_PIX_FMT_YUV422P12:
123 return AOM_IMG_FMT_I42216;
124 case AV_PIX_FMT_YUV444P12:
125 return AOM_IMG_FMT_I44416;
126 default:
127 return AOM_IMG_FMT_NONE;
128 }
129}