FFmpeg
v210dec_init.h
Go to the documentation of this file.
1 /*
2  * V210 decoder DSP init
3  *
4  * Copyright (C) 2009 Michael Niedermayer <michaelni@gmx.at>
5  * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
6  *
7  * This file is part of FFmpeg.
8  *
9  * FFmpeg is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * FFmpeg is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with FFmpeg; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef AVCODEC_V210DEC_INIT_H
25 #define AVCODEC_V210DEC_INIT_H
26 
27 #include <stdint.h>
28 
29 #include "config.h"
30 #include "libavutil/attributes.h"
31 #include "libavutil/bswap.h"
32 #include "v210dec.h"
33 
34 #define READ_PIXELS(a, b, c) \
35  do { \
36  val = av_le2ne32(*src++); \
37  *a++ = val & 0x3FF; \
38  *b++ = (val >> 10) & 0x3FF; \
39  *c++ = (val >> 20) & 0x3FF; \
40  } while (0)
41 
42 static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width)
43 {
44  uint32_t val;
45 
46  for (int i = 0; i < width - 5; i += 6) {
47  READ_PIXELS(u, y, v);
48  READ_PIXELS(y, u, y);
49  READ_PIXELS(v, y, u);
50  READ_PIXELS(y, v, y);
51  }
52 }
53 
55 {
56  s->unpack_frame = v210_planar_unpack_c;
57 #if ARCH_X86
59 #endif
60 }
61 
62 #endif /* AVCODEC_V210DEC_INIT_H */
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:251
av_unused
#define av_unused
Definition: attributes.h:131
READ_PIXELS
#define READ_PIXELS(a, b, c)
Definition: v210dec_init.h:34
val
static double val(void *priv, double ch)
Definition: aeval.c:77
v210_planar_unpack_c
static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width)
Definition: v210dec_init.h:42
av_cold
#define av_cold
Definition: attributes.h:90
s
#define s(width, name)
Definition: cbs_vp9.c:198
ff_v210dec_init
static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
Definition: v210dec_init.h:54
V210DecContext
Definition: v210dec.h:26
attributes.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
bswap.h
ff_v210_x86_init
void ff_v210_x86_init(V210DecContext *s)
Definition: v210-init.c:33
width
#define width
Definition: dsp.h:85
src
#define src
Definition: vp8dsp.c:248
v210dec.h