FFmpeg
Loading...
Searching...
No Matches
input_lsx.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Loongson Technology Corporation Limited
3 * Contributed by Shiyou Yin<yinshiyou-hf@loongson.cn>
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
22#include "swscale_loongarch.h"
23
25{
26 enum AVPixelFormat srcFormat = c->opts.src_format;
27
28 switch (srcFormat) {
30 c->chrToYV12 = yuy2ToUV_lsx;
31 break;
33 c->chrToYV12 = yvy2ToUV_lsx;
34 break;
36 c->chrToYV12 = uyvyToUV_lsx;
37 break;
38 case AV_PIX_FMT_NV12:
39 case AV_PIX_FMT_NV16:
40 case AV_PIX_FMT_NV24:
41 c->chrToYV12 = nv12ToUV_lsx;
42 break;
43 case AV_PIX_FMT_NV21:
44 case AV_PIX_FMT_NV42:
45 c->chrToYV12 = nv21ToUV_lsx;
46 break;
48 case AV_PIX_FMT_GBRP:
49 c->readChrPlanar = planar_rgb_to_uv_lsx;
50 break;
51 }
52
53 if (c->needAlpha) {
54 switch (srcFormat) {
55 case AV_PIX_FMT_BGRA:
56 case AV_PIX_FMT_RGBA:
57 c->alpToYV12 = rgbaToA_lsx;
58 break;
59 case AV_PIX_FMT_ABGR:
60 case AV_PIX_FMT_ARGB:
61 c->alpToYV12 = abgrToA_lsx;
62 break;
63 }
64 }
65}
av_cold void ff_sws_init_input_lsx(SwsInternal *c)
Definition input_lsx.c:24
#define av_cold
Definition attributes.h:117
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:96
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
Definition pixfmt.h:372
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition pixfmt.h:97
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition pixfmt.h:207
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition pixfmt.h:88
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:371
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:198
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition pixfmt.h:74
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
void yuy2ToUV_lsx(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
void nv12ToUV_lsx(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
void nv21ToUV_lsx(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
void rgbaToA_lsx(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
void uyvyToUV_lsx(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
void yvy2ToUV_lsx(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
void planar_rgb_to_uv_lsx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
void abgrToA_lsx(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
static double c[64]