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",
static const char *const format[]
__device__ int printf(const char *,...)
AVFilmGrainParams * av_film_grain_params_create_side_data(AVFrame *frame)
Allocate a complete AVFilmGrainParams and add it to the frame.
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 ...
AVFilmGrainParams * av_film_grain_params_alloc(size_t *size)
This file is part of FFmpeg.
@ AV_FILM_GRAIN_PARAMS_H274
The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
@ AV_FILM_GRAIN_PARAMS_NONE
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Memory handling functions.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_BT709
also ITU-R BT1361
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
This structure describes how to handle film grain synthesis in video for specific codecs.
enum AVColorPrimaries color_primaries
enum AVColorRange color_range
Intended video signal characteristics.
int subsampling_x
Intended subsampling ratio, or 0 for luma-only streams.
int bit_depth_luma
Intended bit depth, or 0 for unknown/unspecified.
enum AVFilmGrainParamsType type
Specifies the codec for which this structure is valid.
int width
Intended display resolution.
enum AVColorTransferCharacteristic color_trc
enum AVColorSpace color_space
This structure describes decoded (raw) audio or video data.
static AVFrame * create_frame(enum AVPixelFormat format, int width, int height)
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)