FFmpeg: libavutil/hash.c Source File
Go to the documentation of this file. 1 /*
2 * Copyright (C) 2013 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
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 <stddef.h>
22 #include <stdint.h>
24
32
38
56 };
57
64
65 static const struct {
82 [
CRC32] = {
"CRC32", 4},
84 };
85
87 {
90 }
91
93 {
95 }
96
98 {
100 }
101
103 {
109 break;
112 if (!res)
return AVERROR(ENOMEM);
130 }
134 }
136 return 0;
137 }
138
140 {
155 case CRC32:
ctx->crc = UINT32_MAX;
break;
157 }
158 }
159
161 {
178 }
179 }
180
182 {
199 }
200 }
201
203 {
206
210 memset(dst + rsize, 0,
size - rsize);
211 }
212
214 {
217
221 }
222
224 {
227
234 }
235
237 {
241 }
Filter the word "frame" indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void av_sha512_final(AVSHA512 *ctx, uint8_t *digest)
Finish hashing and output digest value.
struct AVRIPEMD * av_ripemd_alloc(void)
Allocate an AVRIPEMD context.
#define AV_HASH_MAX_SIZE
Maximum value that av_hash_get_size() will currently return.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
av_cold int av_sha_init(AVSHA *ctx, int bits)
Initialize SHA-1 or SHA-2 hashing.
struct AVSHA512 * av_sha512_alloc(void)
Allocate an AVSHA512 context.
void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size)
Finalize a hash context and store the Base64 representation of the actual hash value as a string.
static const struct @296 hashdesc[]
const char * av_hash_get_name(const AVHashContext *ctx)
void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size)
Finalize a hash context and store the actual hash value in a buffer.
int av_hash_alloc(AVHashContext **ctx, const char *name)
Allocate a hash context for the algorithm specified by name.
AVMurMur3 * av_murmur3_alloc(void)
Allocate an AVMurMur3 hash context.
void av_sha_final(AVSHA *ctx, uint8_t *digest)
Finish hashing and output digest value.
const char * av_hash_names(int i)
Get the names of available hash algorithms.
void av_hash_init(AVHashContext *ctx)
Initialize or reset a hash context.
void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
Update a hash context with additional data.
void av_murmur3_final(AVMurMur3 *c, uint8_t dst[16])
Finish hashing and output digest value.
av_cold int av_ripemd_init(AVRIPEMD *ctx, int bits)
Initialize RIPEMD hashing.
void av_hash_freep(AVHashContext **ctx)
Free hash context and set hash context pointer to NULL.
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
void av_ripemd_final(AVRIPEMD *ctx, uint8_t *digest)
Finish hashing and output digest value.
void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len)
Update hash value.
void av_hash_final(AVHashContext *ctx, uint8_t *dst)
Finalize a hash context and compute the actual hash value.
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
struct AVSHA * av_sha_alloc(void)
Allocate an AVSHA context.
void av_md5_init(AVMD5 *ctx)
Initialize MD5 hashing.
#define AV_BASE64_SIZE(x)
Calculate the output size needed to base64-encode x bytes to a null-terminated string.
#define i(width, name, range_min, range_max)
av_cold int av_sha512_init(AVSHA512 *ctx, int bits)
Initialize SHA-2 512 hashing.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void av_md5_final(AVMD5 *ctx, uint8_t *dst)
Finish hashing and output digest value.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
struct AVMD5 * av_md5_alloc(void)
Allocate an AVMD5 context.
void av_ripemd_update(AVRIPEMD *ctx, const uint8_t *data, size_t len)
Update hash value.
int av_hash_get_size(const AVHashContext *ctx)
char * av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
Encode data to base64 and null-terminate.
void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len)
Update hash value.
void av_murmur3_init(AVMurMur3 *c)
Initialize or reinitialize an AVMurMur3 hash context.
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, size_t len)
Update hash context with new data.
void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size)
Finalize a hash context and store the hexadecimal representation of the actual hash value as a string...
void av_sha512_update(AVSHA512 *ctx, const uint8_t *data, size_t len)
Update hash value.
Generated on Wed Aug 24 2022 21:38:29 for FFmpeg by
doxygen
1.8.17