1 /*
2 * V210 encoder
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
31
32 #define TYPE uint8_t
33 #define DEPTH 8
34 #define BYTES_PER_PIXEL 1
35 #define RENAME(a) a ## _ ## 8
37 #undef RENAME
38 #undef DEPTH
39 #undef BYTES_PER_PIXEL
40 #undef TYPE
41
44 #define BYTES_PER_PIXEL 2
45 #define RENAME(a) a ## _ ## 10
47 #undef RENAME
48 #undef DEPTH
49 #undef BYTES_PER_PIXEL
50 #undef TYPE
51
53 {
55
56 if (avctx->
width & 1) {
59 }
60
62
65
66 return 0;
67 }
68
70 const AVFrame *pic,
int *got_packet)
71 {
72 int aligned_width = ((avctx->
width + 47) / 48) * 48;
73 int stride = aligned_width * 8 / 3;
76 uint8_t *dst;
77
82 }
84
86 v210_enc_10(avctx, dst, pic);
88 v210_enc_8(avctx, dst, pic);
89
91 if (side_data && side_data->
size) {
93 if (!buf)
95 memcpy(buf, side_data->
data, side_data->
size);
96 }
97
99 if (side_data && side_data->
size) {
101 if (!buf)
103 memcpy(buf, side_data->
data, side_data->
size);
104 }
105
106 *got_packet = 1;
107 return 0;
108 }
109
121 };