1 /*
2 * Copyright (c) 2011 Stefano Sabatini
3 * This file is part of FFmpeg.
4 *
5 * FFmpeg is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with FFmpeg; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /**
21 * @file
22 * filter for showing textual video frame information
23 */
24
25 #include <inttypes.h>
26
34
38
40 {
42
44 if (sd->
size <
sizeof(*stereo)) {
46 return;
47 }
48
50
52 switch (stereo->
type) {
61 "(quincunx subsampling)"); break;
63 }
64
67 }
68
70 {
71 int i;
72
73 for (i = 0; i <
len; i++) {
74 *sum += src[i];
75 *sum2 += src[i] * src[i];
76 }
77 }
78
80 {
83 uint32_t plane_checksum[4] = {0}, checksum = 0;
84 int64_t sum[4] = {0}, sum2[4] = {0};
87
88 for (plane = 0; plane < 4 && frame->
data[plane] && frame->
linesize[plane]; plane++) {
90 int h = plane == 1 || plane == 2 ?
FF_CEIL_RSHIFT(inlink->
h, vsub) : inlink->
h;
92
93 if (linesize < 0)
94 return linesize;
95
96 for (i = 0; i < h; i++) {
99
101 pixelcount[plane] += linesize;
103 }
104 }
105
107 "n:%4"PRId64" pts:%7s pts_time:%-7s pos:%9"PRId64" "
108 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "
109 "checksum:%08"PRIX32" plane_checksum:[%08"PRIX32,
119 checksum, plane_checksum[0]);
120
121 for (plane = 1; plane < 4 && frame->
data[plane] && frame->
linesize[plane]; plane++)
124 for (plane = 0; plane < 4 && frame->
data[plane] && frame->
linesize[plane]; plane++)
125 av_log(ctx,
AV_LOG_INFO,
"%"PRId64
" ", (sum[plane] + pixelcount[plane]/2) / pixelcount[plane]);
127 for (plane = 0; plane < 4 && frame->
data[plane] && frame->
linesize[plane]; plane++)
129 sqrt((sum2[plane] - sum[plane]*(double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
131
134
139 break;
142 break;
145 break;
149 break;
152 break;
153 default:
156 break;
157 }
158
160 }
161
163 }
164
166 {
167
169 is_out ? "out" :"in",
172 );
173
174 return 0;
175 }
176
178 {
181 }
182
184 {
187 }
188
190 {
195 },
197 };
198
200 {
204 },
206 };
207
213 };