FFmpeg
swscale_loongarch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Loongson Technology Corporation Limited
3  * Contributed by Hao Chen(chenhao@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 #ifndef SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H
23 #define SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H
24 
25 #include "libswscale/swscale.h"
27 
28 void ff_hscale_8_to_15_lasx(SwsContext *c, int16_t *dst, int dstW,
29  const uint8_t *src, const int16_t *filter,
30  const int32_t *filterPos, int filterSize);
31 
32 void ff_hscale_8_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW,
33  const uint8_t *src, const int16_t *filter,
34  const int32_t *filterPos, int filterSize);
35 
36 void ff_hscale_16_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW,
37  const uint8_t *_src, const int16_t *filter,
38  const int32_t *filterPos, int filterSize);
39 
40 void ff_hscale_16_to_15_lasx(SwsContext *c, int16_t *dst, int dstW,
41  const uint8_t *_src, const int16_t *filter,
42  const int32_t *filterPos, int filterSize);
43 
44 void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4],
45  int width, int32_t *rgb2yuv, void *opq);
46 
47 void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width,
48  int32_t *rgb2yuv, void *opq);
49 
50 int yuv420_rgb24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
51  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
52 
53 int yuv420_bgr24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
54  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
55 
56 int yuv420_rgba32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
57  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
58 
59 int yuv420_bgra32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
60  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
61 
62 int yuv420_argb32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
63  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
64 
65 int yuv420_abgr32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
66  int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
67 
68 void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2,
69  uint8_t *dest, int width, int height,
70  int src1Stride, int src2Stride, int dstStride);
71 
73 
74 void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize,
75  const int16_t **src, uint8_t *dest, int dstW,
76  const uint8_t *dither, int offset);
77 
78 #endif /* SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H */
yuv420_bgr24_lasx
int yuv420_bgr24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
ff_yuv2planeX_8_lasx
void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Definition: output_lasx.c:25
src1
const pixel * src1
Definition: h264pred_template.c:421
rgb2yuv
static const char rgb2yuv[]
Definition: vf_scale_vulkan.c:68
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
planar_rgb_to_y_lasx
void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
Definition: input_lasx.c:127
av_cold
#define av_cold
Definition: attributes.h:90
width
#define width
planar_rgb_to_uv_lasx
void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
Definition: input_lasx.c:25
ff_hscale_8_to_15_lasx
void ff_hscale_8_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale_lasx.c:314
ff_interleave_bytes_lasx
void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, int width, int height, int src1Stride, int src2Stride, int dstStride)
Definition: rgb2rgb_lasx.c:25
ff_hscale_16_to_15_lasx
void ff_hscale_16_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale_lasx.c:676
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
yuv420_bgra32_lasx
int yuv420_bgra32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
srcSliceH
return srcSliceH
Definition: yuv2rgb_template.c:87
height
#define height
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
src2
const pixel * src2
Definition: h264pred_template.c:422
swscale_internal.h
ff_hscale_16_to_19_lasx
void ff_hscale_16_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale_lasx.c:823
ff_sws_init_output_loongarch
av_cold void ff_sws_init_output_loongarch(SwsContext *c)
Definition: output_lasx.c:1780
yuv420_rgb24_lasx
int yuv420_rgb24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
yuv420_abgr32_lasx
int yuv420_abgr32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
yuv420_argb32_lasx
int yuv420_argb32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
ff_hscale_8_to_19_lasx
void ff_hscale_8_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale_lasx.c:474
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
int32_t
int32_t
Definition: audioconvert.c:56
SwsContext
Definition: swscale_internal.h:299
swscale.h
yuv420_rgba32_lasx
int yuv420_rgba32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
dither
static const uint8_t dither[8][8]
Definition: vf_fspp.c:58