1 /*****************************************************************************
2 * omxdl.c : OpenMAX DL chroma conversions for VLC
3 *****************************************************************************
4 * Copyright (C) 2011 RĂ©mi Denis-Courmont
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
25 #include <vlc_common.h>
26 #include <vlc_plugin.h>
27 #include <vlc_filter.h>
31 static int Open (vlc_object_t
*);
32 static int OpenScaler (vlc_object_t
*);
35 set_description (N_("OpenMAX DL image processing"))
36 set_capability ("video filter2", 90)
37 set_callbacks (Open
, NULL
)
40 #define SRC_WIDTH (filter->fmt_in.video.i_width)
41 #define SRC_HEIGHT (filter->fmt_in.video.i_height)
42 #define DST_WIDTH (filter->fmt_out.video.i_width)
43 #define DST_HEIGHT (filter->fmt_out.video.i_height)
45 /*** Conversions from I420 ***/
46 static void I420_RV16 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
48 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
49 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
50 OMX_U16
*out
= (void *)dst
->p
->p_pixels
;
51 OMX_INT outstep
= dst
->p
->i_pitch
;
52 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
54 omxIPCS_YCbCr420ToBGR565_U8_U16_P3C3R (in
, instep
, out
, outstep
, size
);
56 VIDEO_FILTER_WRAPPER (I420_RV16
)
58 /*** Conversions from YV12 ***/
59 static void YV12_RV16 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
61 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->V_PIXELS
, src
->U_PIXELS
};
62 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->V_PITCH
, src
->U_PITCH
};
63 OMX_U16
*out
= (void *)dst
->p
->p_pixels
;
64 OMX_INT outstep
= dst
->p
->i_pitch
;
65 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
67 omxIPCS_YCbCr420ToBGR565_U8_U16_P3C3R (in
, instep
, out
, outstep
, size
);
69 VIDEO_FILTER_WRAPPER (YV12_RV16
)
71 /*** Conversions from I422 ***/
72 static void I422_I420 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
74 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
75 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
76 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->U_PIXELS
, dst
->V_PIXELS
};
77 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->U_PITCH
, dst
->V_PITCH
};
78 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
80 omxIPCS_YCbCr422ToYCbCr420Rotate_U8_P3R (
81 in
, instep
, out
, outstep
, size
, OMX_IP_DISABLE
);
83 VIDEO_FILTER_WRAPPER (I422_I420
)
85 static void I422_YV12 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
87 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
88 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
89 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->V_PIXELS
, dst
->U_PIXELS
};
90 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->V_PITCH
, dst
->U_PITCH
};
91 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
93 omxIPCS_YCbCr422ToYCbCr420Rotate_U8_P3R (
94 in
, instep
, out
, outstep
, size
, OMX_IP_DISABLE
);
96 VIDEO_FILTER_WRAPPER (I422_YV12
)
98 /*** Conversions from I444 ***/
99 static void I444_RV16 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
101 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
102 OMX_INT instep
= src
->p
->i_pitch
;
103 OMX_U16
*out
= (void *)dst
->p
->p_pixels
;
104 OMX_INT outstep
= dst
->p
->i_pitch
;
106 filter
->fmt_in
.video
.i_width
,
107 filter
->fmt_in
.video
.i_height
,
110 omxIPCS_YCbCr444ToBGR565_U8_U16_P3C3R (in
, instep
, out
, outstep
, size
);
112 VIDEO_FILTER_WRAPPER (I444_RV16
)
114 /*** Conversions from YUY2 ***/
115 static void YUYV_RV24 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
117 const OMX_U8
*in
= src
->p
->p_pixels
;
118 OMX_INT instep
= src
->p
->i_pitch
;
119 OMX_U8
*out
= dst
->p
->p_pixels
;
120 OMX_INT outstep
= dst
->p
->i_pitch
;
121 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
123 omxIPCS_YCbYCr422ToBGR888_U8_C2C3R (in
, instep
, out
, outstep
, size
);
125 VIDEO_FILTER_WRAPPER (YUYV_RV24
)
127 static void YUYV_RV16 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
129 const OMX_U8
*in
= src
->p
->p_pixels
;
130 OMX_INT instep
= src
->p
->i_pitch
;
131 OMX_U16
*out
= (void *)dst
->p
->p_pixels
;
132 OMX_INT outstep
= dst
->p
->i_pitch
;
133 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
135 omxIPCS_YCbYCr422ToBGR565_U8_U16_C2C3R (in
, instep
, out
, outstep
, size
);
137 VIDEO_FILTER_WRAPPER (YUYV_RV16
)
139 /*** Conversions from UYVY ***/
140 static void UYVY_I420 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
142 const OMX_U8
*in
= src
->p
->p_pixels
;
143 OMX_INT instep
= src
->p
->i_pitch
;
144 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->U_PIXELS
, dst
->V_PIXELS
};
145 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->U_PITCH
, dst
->V_PITCH
};
146 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
148 omxIPCS_CbYCrY422ToYCbCr420Rotate_U8_C2P3R (
149 in
, instep
, out
, outstep
, size
, OMX_IP_DISABLE
);
151 VIDEO_FILTER_WRAPPER (UYVY_I420
)
153 static void UYVY_YV12 (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
155 const OMX_U8
*in
= src
->p
->p_pixels
;
156 OMX_INT instep
= src
->p
->i_pitch
;
157 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->V_PIXELS
, dst
->U_PIXELS
};
158 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->V_PITCH
, dst
->U_PITCH
};
159 OMXSize size
= { SRC_WIDTH
, SRC_HEIGHT
};
161 omxIPCS_CbYCrY422ToYCbCr420Rotate_U8_C2P3R (
162 in
, instep
, out
, outstep
, size
, OMX_IP_DISABLE
);
164 VIDEO_FILTER_WRAPPER (UYVY_YV12
)
167 static int FixRV24 (video_format_t
*fmt
)
169 #ifndef WORDS_BIGENDIAN
170 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
172 fmt
->i_rmask
= 0xff0000;
173 fmt
->i_gmask
= 0x00ff00;
174 fmt
->i_bmask
= 0x0000ff;
176 return (fmt
->i_rmask
== 0xff0000 && fmt
->i_gmask
== 0x00ff00
177 && fmt
->i_bmask
== 0x0000ff) ? 0 : -1;
179 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
181 fmt
->i_rmask
= 0x0000ff;
182 fmt
->i_gmask
= 0x00ff00;
183 fmt
->i_bmask
= 0xff0000;
185 return (fmt
->i_rmask
== 0x0000ff && fmt
->i_gmask
== 0x00ff00
186 && fmt
->i_bmask
== 0xff0000) ? 0 : -1;
190 static int FixRV16 (video_format_t
*fmt
)
192 #ifndef WORDS_BIGENDIAN
193 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
195 fmt
->i_rmask
= 0xf800;
196 fmt
->i_gmask
= 0x07e0;
197 fmt
->i_bmask
= 0x001f;
199 return (fmt
->i_rmask
== 0xf800 && fmt
->i_gmask
== 0x07e0
200 && fmt
->i_bmask
== 0x001f) ? 0 : -1;
207 static int FixRV15 (video_format_t
*fmt
)
209 #ifndef WORDS_BIGENDIAN
210 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
212 fmt
->i_rmask
= 0x7c00;
213 fmt
->i_gmask
= 0x03e0;
214 fmt
->i_bmask
= 0x001f;
216 return (fmt
->i_rmask
== 0x7c00 && fmt
->i_gmask
== 0x03e0
217 && fmt
->i_bmask
== 0x001f) ? 0 : -1;
224 static int FixRV12 (video_format_t
*fmt
)
226 #ifndef WORDS_BIGENDIAN
227 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
229 fmt
->i_rmask
= 0x0f00;
230 fmt
->i_gmask
= 0x00f0;
231 fmt
->i_bmask
= 0x000f;
233 return (fmt
->i_rmask
== 0x0f00 && fmt
->i_gmask
== 0x00f0
234 && fmt
->i_bmask
== 0x000f) ? 0 : -1;
236 if (fmt
->i_rmask
== 0 && fmt
->i_gmask
== 0 && fmt
->i_bmask
== 0)
238 fmt
->i_rmask
= 0x000f;
239 fmt
->i_gmask
= 0xf000;
240 fmt
->i_bmask
= 0x0f00;
242 return (fmt
->i_rmask
== 0x000f && fmt
->i_gmask
== 0xf000
243 && fmt
->i_bmask
== 0x0f00) ? 0 : -1;
247 /*** Initialization ***/
248 static int Open (vlc_object_t
*obj
)
250 filter_t
*filter
= (filter_t
*)obj
;
252 if ((filter
->fmt_in
.video
.i_width
!= filter
->fmt_out
.video
.i_width
)
253 || (filter
->fmt_in
.video
.i_height
!= filter
->fmt_out
.video
.i_height
))
254 return OpenScaler (obj
);
256 switch (filter
->fmt_in
.video
.i_chroma
)
259 switch (filter
->fmt_out
.video
.i_chroma
)
261 case VLC_CODEC_RGB16
:
262 if (FixRV16 (&filter
->fmt_out
.video
))
264 filter
->pf_video_filter
= I420_RV16_Filter
;
270 switch (filter
->fmt_out
.video
.i_chroma
)
272 case VLC_CODEC_RGB16
:
273 if (FixRV16 (&filter
->fmt_out
.video
))
275 filter
->pf_video_filter
= YV12_RV16_Filter
;
281 switch (filter
->fmt_out
.video
.i_chroma
)
284 filter
->pf_video_filter
= I422_I420_Filter
;
287 filter
->pf_video_filter
= I422_YV12_Filter
;
293 switch (filter
->fmt_out
.video
.i_chroma
)
295 case VLC_CODEC_RGB16
:
296 if (FixRV16 (&filter
->fmt_out
.video
))
298 filter
->pf_video_filter
= I444_RV16_Filter
;
304 switch (filter
->fmt_out
.video
.i_chroma
)
306 case VLC_CODEC_RGB24
:
307 if (FixRV24 (&filter
->fmt_out
.video
))
309 filter
->pf_video_filter
= YUYV_RV24_Filter
;
311 case VLC_CODEC_RGB16
:
312 if (FixRV16 (&filter
->fmt_out
.video
))
314 filter
->pf_video_filter
= YUYV_RV16_Filter
;
320 switch (filter
->fmt_out
.video
.i_chroma
)
323 filter
->pf_video_filter
= UYVY_I420_Filter
;
326 filter
->pf_video_filter
= UYVY_YV12_Filter
;
331 /* fallback to scaler (conversion with 1:1 scale) */
332 return OpenScaler (obj
);
335 /* TODO: configurable interpolation */
338 (OMX_INT)(((float)((SRC_WIDTH & ~1) - 1)) / ((DST_WIDTH & ~1) - 1) * (1 << 16) + .5)
340 (OMX_INT)(((float)((SRC_HEIGHT & ~1) - 1)) / ((DST_HEIGHT & ~1) - 1) * (1 << 16) + .5)
341 #define CNV ((intptr_t)(filter->p_sys))
343 /*** Scaling from I420 ***/
344 static void I420_I420_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
346 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
347 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
348 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
349 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->U_PIXELS
, dst
->V_PIXELS
};
350 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->U_PITCH
, dst
->V_PITCH
};
351 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
353 omxIPCS_YCbCr420RszRot_U8_P3R (
354 in
, instep
, insize
, out
, outstep
, outsize
,
355 OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
357 VIDEO_FILTER_WRAPPER (I420_I420_Scale
)
359 static void I420_YV12_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
361 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
362 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
363 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
364 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->V_PIXELS
, dst
->U_PIXELS
};
365 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->V_PITCH
, dst
->U_PITCH
};
366 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
368 omxIPCS_YCbCr420RszRot_U8_P3R (
369 in
, instep
, insize
, out
, outstep
, outsize
,
370 OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
372 VIDEO_FILTER_WRAPPER (I420_YV12_Scale
)
374 static void I420_RGB_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
376 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
377 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
378 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
379 OMX_U8
*out
= dst
->p
->p_pixels
;
380 OMX_INT outstep
= dst
->p
->i_pitch
;
381 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
383 omxIPCS_YCbCr420RszCscRotBGR_U8_P3C3R (
384 in
, instep
, insize
, out
, outstep
, outsize
,
385 CNV
, OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
387 VIDEO_FILTER_WRAPPER (I420_RGB_Scale
)
389 /*** Scaling from YV12 ***/
390 static void YV12_I420_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
392 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->V_PIXELS
, src
->U_PIXELS
};
393 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->V_PITCH
, src
->U_PITCH
};
394 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
395 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->U_PIXELS
, dst
->V_PIXELS
};
396 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->U_PITCH
, dst
->V_PITCH
};
397 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
399 omxIPCS_YCbCr420RszRot_U8_P3R (
400 in
, instep
, insize
, out
, outstep
, outsize
,
401 OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
403 VIDEO_FILTER_WRAPPER (YV12_I420_Scale
)
405 static void YV12_YV12_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
407 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->V_PIXELS
, src
->U_PIXELS
};
408 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->V_PITCH
, src
->U_PITCH
};
409 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
410 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->V_PIXELS
, dst
->U_PIXELS
};
411 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->V_PITCH
, dst
->U_PITCH
};
412 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
414 omxIPCS_YCbCr420RszRot_U8_P3R (
415 in
, instep
, insize
, out
, outstep
, outsize
,
416 OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
418 VIDEO_FILTER_WRAPPER (YV12_YV12_Scale
)
420 static void YV12_RGB_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
422 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->V_PIXELS
, src
->U_PIXELS
};
423 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->V_PITCH
, src
->U_PITCH
};
424 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
425 OMX_U8
*out
= dst
->p
->p_pixels
;
426 OMX_INT outstep
= dst
->p
->i_pitch
;
427 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
429 omxIPCS_YCbCr420RszCscRotBGR_U8_P3C3R (
430 in
, instep
, insize
, out
, outstep
, outsize
,
431 CNV
, OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
433 VIDEO_FILTER_WRAPPER (YV12_RGB_Scale
)
435 /*** Scaling from I422 ***/
436 static void I422_I422_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
438 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
439 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
440 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
441 OMX_U8
*out
[3] = { dst
->Y_PIXELS
, dst
->U_PIXELS
, dst
->V_PIXELS
};
442 OMX_INT outstep
[3] = { dst
->Y_PITCH
, dst
->U_PITCH
, dst
->V_PITCH
};
443 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
445 omxIPCS_YCbCr422RszRot_U8_P3R (
446 in
, instep
, insize
, out
, outstep
, outsize
,
447 OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
449 VIDEO_FILTER_WRAPPER (I422_I422_Scale
)
451 static void I422_RGB_Scale (filter_t
*filter
, picture_t
*src
, picture_t
*dst
)
453 const OMX_U8
*in
[3] = { src
->Y_PIXELS
, src
->U_PIXELS
, src
->V_PIXELS
};
454 OMX_INT instep
[3] = { src
->Y_PITCH
, src
->U_PITCH
, src
->V_PITCH
};
455 OMXSize insize
= { SRC_WIDTH
, SRC_HEIGHT
};
456 OMX_U8
*out
= dst
->p
->p_pixels
;
457 OMX_INT outstep
= dst
->p
->i_pitch
;
458 OMXSize outsize
= { DST_WIDTH
, DST_HEIGHT
};
460 omxIPCS_YCbCr422RszCscRotBGR_U8_P3C3R (
461 in
, instep
, insize
, out
, outstep
, outsize
,
462 CNV
, OMX_IP_NEAREST
, OMX_IP_DISABLE
, XRR_MAX
, YRR_MAX
);
464 VIDEO_FILTER_WRAPPER (I422_RGB_Scale
)
466 /*** Scaling initialization ***/
467 static int OpenScaler (vlc_object_t
*obj
)
469 filter_t
*filter
= (filter_t
*)obj
;
471 switch (filter
->fmt_in
.video
.i_chroma
)
474 switch (filter
->fmt_out
.video
.i_chroma
)
477 filter
->pf_video_filter
= I420_I420_Scale_Filter
;
480 filter
->pf_video_filter
= I420_YV12_Scale_Filter
;
482 case VLC_CODEC_RGB16
:
483 if (FixRV16 (&filter
->fmt_out
.video
))
485 filter
->pf_video_filter
= I420_RGB_Scale_Filter
;
486 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR565
;
488 case VLC_CODEC_RGB15
:
489 if (FixRV15 (&filter
->fmt_out
.video
))
491 filter
->pf_video_filter
= I420_RGB_Scale_Filter
;
492 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR555
;
494 case VLC_CODEC_RGB12
:
495 if (FixRV12 (&filter
->fmt_out
.video
))
497 filter
->pf_video_filter
= I420_RGB_Scale_Filter
;
498 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR444
;
500 case VLC_CODEC_RGB24
:
501 if (FixRV24 (&filter
->fmt_out
.video
))
503 filter
->pf_video_filter
= I420_RGB_Scale_Filter
;
504 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR888
;
510 switch (filter
->fmt_out
.video
.i_chroma
)
513 filter
->pf_video_filter
= YV12_I420_Scale_Filter
;
516 filter
->pf_video_filter
= YV12_YV12_Scale_Filter
;
518 case VLC_CODEC_RGB16
:
519 if (FixRV16 (&filter
->fmt_out
.video
))
521 filter
->pf_video_filter
= YV12_RGB_Scale_Filter
;
522 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR565
;
524 case VLC_CODEC_RGB15
:
525 if (FixRV15 (&filter
->fmt_out
.video
))
527 filter
->pf_video_filter
= YV12_RGB_Scale_Filter
;
528 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR555
;
530 case VLC_CODEC_RGB12
:
531 if (FixRV12 (&filter
->fmt_out
.video
))
533 filter
->pf_video_filter
= YV12_RGB_Scale_Filter
;
534 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR444
;
536 case VLC_CODEC_RGB24
:
537 if (FixRV24 (&filter
->fmt_out
.video
))
539 filter
->pf_video_filter
= YV12_RGB_Scale_Filter
;
540 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR888
;
546 switch (filter
->fmt_out
.video
.i_chroma
)
549 filter
->pf_video_filter
= I422_I422_Scale_Filter
;
551 case VLC_CODEC_RGB16
:
552 if (FixRV16 (&filter
->fmt_out
.video
))
554 filter
->pf_video_filter
= I422_RGB_Scale_Filter
;
555 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR565
;
557 case VLC_CODEC_RGB15
:
558 if (FixRV15 (&filter
->fmt_out
.video
))
560 filter
->pf_video_filter
= I422_RGB_Scale_Filter
;
561 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR555
;
563 case VLC_CODEC_RGB12
:
564 if (FixRV12 (&filter
->fmt_out
.video
))
566 filter
->pf_video_filter
= I422_RGB_Scale_Filter
;
567 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR444
;
569 case VLC_CODEC_RGB24
:
570 if (FixRV24 (&filter
->fmt_out
.video
))
572 filter
->pf_video_filter
= I422_RGB_Scale_Filter
;
573 filter
->p_sys
= (void *)(intptr_t)OMX_IP_BGR888
;