FFmpeg
Loading...
Searching...
No Matches
utvideodsp.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include <stdint.h>
20
21#include "config.h"
23#include "utvideodsp.h"
24
25static void restore_rgb_planes_c(uint8_t *src_r,
26 uint8_t *src_g,
27 uint8_t *src_b,
28 ptrdiff_t linesize_r,
29 ptrdiff_t linesize_g,
30 ptrdiff_t linesize_b,
31 int width, int height)
32{
33 uint8_t r, g, b;
34 int i, j;
35
36 for (j = 0; j < height; j++) {
37 for (i = 0; i < width; i++) {
38 r = src_r[i];
39 g = src_g[i];
40 b = src_b[i];
41 src_r[i] = r + g - 0x80;
42 src_b[i] = b + g - 0x80;
43 }
44 src_r += linesize_r;
45 src_g += linesize_g;
46 src_b += linesize_b;
47 }
48}
49
50static void restore_rgb_planes10_c(uint16_t *src_r,
51 uint16_t *src_g,
52 uint16_t *src_b,
53 ptrdiff_t linesize_r,
54 ptrdiff_t linesize_g,
55 ptrdiff_t linesize_b,
56 int width, int height)
57{
58 int r, g, b;
59 int i, j;
60
61 for (j = 0; j < height; j++) {
62 for (i = 0; i < width; i++) {
63 r = src_r[i];
64 g = src_g[i];
65 b = src_b[i];
66 src_r[i] = (r + g - 0x200) & 0x3FF;
67 src_b[i] = (b + g - 0x200) & 0x3FF;
68 }
69 src_r += linesize_r;
70 src_g += linesize_g;
71 src_b += linesize_b;
72 }
73}
74
76{
77 c->restore_rgb_planes = restore_rgb_planes_c;
78 c->restore_rgb_planes10 = restore_rgb_planes10_c;
79
80#if ARCH_RISCV
82#elif ARCH_X86 && HAVE_X86ASM
84#endif
85}
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define r
Definition input.c:42
#define b
Definition input.c:43
static void restore_rgb_planes_c(uint8_t *src_r, uint8_t *src_g, uint8_t *src_b, ptrdiff_t linesize_r, ptrdiff_t linesize_g, ptrdiff_t linesize_b, int width, int height)
Definition utvideodsp.c:25
av_cold void ff_utvideodsp_init(UTVideoDSPContext *c)
Definition utvideodsp.c:75
static void restore_rgb_planes10_c(uint16_t *src_r, uint16_t *src_g, uint16_t *src_b, ptrdiff_t linesize_r, ptrdiff_t linesize_g, ptrdiff_t linesize_b, int width, int height)
Definition utvideodsp.c:50
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
av_cold void ff_utvideodsp_init_riscv(UTVideoDSPContext *c)
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
const char * g
Definition vf_curves.c:128
static double c[64]