1 /*
2 * Raw video utils
3 * Copyright (c) 2016 Michael Niedermayer
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
26
28 {
32 int min_stride = (par->
width * bpc + 7) >> 3;
33 int with_pal_size = min_stride * par->
height + 1024;
34 int contains_pal = bpc == 8 &&
pkt->
size == with_pal_size;
37 int padding = expected_stride -
FFMIN(expected_stride,
stride);
38 int y;
40
42 return 0;
44 return 0;
45
47 if (!new_pkt)
49
53
57
58 for (y = 0; y<par->
height; y++) {
60 memset(new_pkt->
data + y*expected_stride + expected_stride - padding, 0, padding);
61 }
62
63 *ppkt = new_pkt;
64 return 1 + contains_pal;
67
69 }
70
72 {
73 uint8_t *side_data;
75
77 if (side_data) {
81 }
83 return 1;
84 }
85
89 return 1;
90 }
91
92 return 0;
93 }