FFmpeg
aom_film_grain.h
Go to the documentation of this file.
1 /*
2  * AOM film grain synthesis
3  * Copyright (c) 2021 Niklas Haas <ffmpeg@haasn.xyz>
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 
22 /**
23  * @file
24  * AOM film grain synthesis.
25  * @author Niklas Haas <ffmpeg@haasn.xyz>
26  */
27 
28 #ifndef AVCODEC_AOM_FILM_GRAIN_H
29 #define AVCODEC_AOM_FILM_GRAIN_H
30 
32 
33 typedef struct AVFilmGrainAFGS1Params {
34  int enable;
37 
38 // Synthesizes film grain on top of `in` and stores the result to `out`. `out`
39 // must already have been allocated and set to the same size and format as `in`.
41  const AVFilmGrainParams *params);
42 
43 // Parse AFGS1 parameter sets from an ITU-T T.35 payload. Returns 0 on success,
44 // or a negative error code.
46  const uint8_t *payload, int payload_size);
47 
48 // Attach all valid film grain param sets to `frame`.
50 
51 #endif /* AVCODEC_AOM_FILM_GRAIN_H */
AVFilmGrainAFGS1Params::sets
AVFilmGrainParams sets[8]
Definition: aom_film_grain.h:35
out
FILE * out
Definition: movenc.c:55
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
AVFilmGrainAFGS1Params::enable
int enable
Definition: aom_film_grain.h:34
film_grain_params.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
ff_aom_apply_film_grain
int ff_aom_apply_film_grain(AVFrame *out, const AVFrame *in, const AVFilmGrainParams *params)
Definition: aom_film_grain.c:66
ff_aom_attach_film_grain_sets
int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *frame)
Definition: aom_film_grain.c:341
AVFilmGrainParams
This structure describes how to handle film grain synthesis in video for specific codecs.
Definition: film_grain_params.h:238
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
ff_aom_parse_film_grain_sets
int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s, const uint8_t *payload, int payload_size)
Definition: aom_film_grain.c:122
AVFilmGrainAFGS1Params
Definition: aom_film_grain.h:33