Go to the documentation of this file.
39 int bd_luma,
int bd_chroma)
61 printf(
"Testing av_film_grain_params_alloc()\n");
64 printf(
"alloc with size: %s\n", (fgp &&
size > 0) ?
"OK" :
"FAIL");
68 printf(
"alloc without size: %s\n", fgp ?
"OK" :
"FAIL");
71 printf(
"\nTesting av_film_grain_params_create_side_data()\n");
76 printf(
"create: OK\ndefaults: range=%d pri=%d trc=%d space=%d\n",
83 printf(
"\nTesting av_film_grain_params_select()\n");
89 printf(
"invalid format: %s\n", sel ?
"FAIL" :
"NULL");
95 printf(
"no side data: %s\n", sel ?
"FAIL" :
"NULL");
102 printf(
"NONE type: %s\n", sel ?
"FAIL" :
"NULL");
109 printf(
"AV1 match: %s\n", sel ?
"OK" :
"FAIL");
116 printf(
"AV1 sub mismatch: %s\n", sel ?
"FAIL" :
"NULL");
123 printf(
"H274 match: %s\n", sel ?
"OK" :
"FAIL");
130 printf(
"H274 lower sub: %s\n", sel ?
"OK" :
"FAIL");
137 printf(
"H274 higher sub: %s\n", sel ?
"FAIL" :
"NULL");
144 printf(
"width too large: %s\n", sel ?
"FAIL" :
"NULL");
151 printf(
"height too large: %s\n", sel ?
"FAIL" :
"NULL");
158 printf(
"size unspecified: %s\n", sel ?
"OK" :
"FAIL");
165 printf(
"bd_luma mismatch: %s\n", sel ?
"FAIL" :
"NULL");
172 printf(
"bd_chroma mismatch: %s\n", sel ?
"FAIL" :
"NULL");
179 printf(
"bd unspecified: %s\n", sel ?
"OK" :
"FAIL");
186 printf(
"bd exact match: %s\n", sel ?
"OK" :
"FAIL");
195 printf(
"color_range mismatch: %s\n", sel ?
"FAIL" :
"NULL");
204 printf(
"color_primaries mismatch: %s\n", sel ?
"FAIL" :
"NULL");
213 printf(
"color_trc mismatch: %s\n", sel ?
"FAIL" :
"NULL");
222 printf(
"color_space mismatch: %s\n", sel ?
"FAIL" :
"NULL");
229 printf(
"color unspecified: %s\n", sel ?
"OK" :
"FAIL");
238 printf(
"best selection: width=%d height=%d\n",
AVPixelFormat
Pixel format.
__device__ int printf(const char *,...)
int bit_depth_luma
Intended bit depth, or 0 for unknown/unspecified.
AVFilmGrainParams * av_film_grain_params_alloc(size_t *size)
This file is part of FFmpeg.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
@ AVCOL_RANGE_JPEG
Full range content.
enum AVColorSpace color_space
enum AVColorTransferCharacteristic color_trc
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
const AVFilmGrainParams * av_film_grain_params_select(const AVFrame *frame)
Select the most appropriate film grain parameters set for the frame, taking into account the frame's ...
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int width
Intended display resolution.
static AVFrame * create_frame(enum AVPixelFormat format, int width, int height)
AVFilmGrainParams * av_film_grain_params_create_side_data(AVFrame *frame)
Allocate a complete AVFilmGrainParams and add it to the frame.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_FILM_GRAIN_PARAMS_NONE
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
int subsampling_x
Intended subsampling ratio, or 0 for luma-only streams.
This structure describes how to handle film grain synthesis in video for specific codecs.
@ AVCOL_TRC_BT709
also ITU-R BT1361
enum AVColorPrimaries color_primaries
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
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
@ AV_FILM_GRAIN_PARAMS_H274
The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
enum AVColorRange color_range
Intended video signal characteristics.
static AVFilmGrainParams * add_grain(AVFrame *frame, enum AVFilmGrainParamsType type, int width, int height, int sub_x, int sub_y, int bd_luma, int bd_chroma)
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
enum AVFilmGrainParamsType type
Specifies the codec for which this structure is valid.