FFmpeg
test_utils.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 Michael Niedermayer
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/frame.h"
22 #include "libavutil/adler32.h"
23 #include "test_utils.h"
24 
26 {
27  AVAdler a = 123;
28 
29  for(int y=0; y<f->height; y++) {
30  a = av_adler32_update(a, &f->data[0][y*f->linesize[0]], f->width);
31  }
32  for(int y=0; y<(f->height+1)/2; y++) {
33  a = av_adler32_update(a, &f->data[1][y*f->linesize[1]], (f->width+1)/2);
34  a = av_adler32_update(a, &f->data[2][y*f->linesize[2]], (f->width+1)/2);
35  }
36 
37  return a;
38 }
int64_t
long long int64_t
Definition: coverity.c:34
test_utils.h
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:410
adler32.h
ff_chksum
int64_t ff_chksum(AVFrame *f)
Definition: test_utils.c:25
av_adler32_update
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
Definition: adler32.c:44
f
f
Definition: af_crystalizer.c:122
frame.h
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
AVAdler
uint32_t AVAdler
Definition: adler32.h:42