History

avutil/film_grain_params: add metadata to common struct

This is needed for AV1 film grain as well, when using AFGS1 streams. Also add extra width/height and subsampling information, which AFGS1 cares about, as part of the same API bump. (And in principle, H274 should also expose this information, since it is needed downstream to correctly adjust the chroma grain frequency to the subsampling ratio) Deprecate the equivalent H274-exclusive fields. To avoid breaking ABI, add the new fields after the union; but with enough of a paper trail to hopefully re-order them on the next bump.

Niklas Haas committed 2 years ago

Commit 35d29601 parent bfbf0f43 files · +62 −4Browse files

Unified · Split

3 files
  1. doc/APIchanges +6 −0
  2. libavutil/film_grain_params.h +54 −3
  3. libavutil/version.h +2 −1
doc/APIchanges+6−0
@@ -2,6 +2,12 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52024-03-xx - xxxxxxxxxx - lavu 59.5.100 - film_grain_params.h
6 Add AVFilmGrainParams.color_range, color_primaries, color_trc, color_space,
7 width, height, subsampling_x, subsampling_y, bit_depth_luma and
8 bit_depth_chroma. Deprecate the corresponding fields from
9 AVFilmGrainH274Params.
10
52024-03-xx - xxxxxxxxxx - lavc 61.3.100 - jni.h112024-03-xx - xxxxxxxxxx - lavc 61.3.100 - jni.h
6 Add av_jni_set_android_app_ctx() and av_jni_get_android_app_ctx().12 Add av_jni_set_android_app_ctx() and av_jni_get_android_app_ctx().
7 13
libavutil/film_grain_params.h+54−3
@@ -136,20 +136,42 @@ typedef struct AVFilmGrainH274Params { · 135 unmodified lines
136 */136 */
137 int model_id;137 int model_id;
138 138
139 /**139#if FF_API_H274_FILM_GRAIN_VCS
140 * Specifies the bit depth used for the luma component.140 /**
141 */141 * TODO: On this ABI bump, please also re-order the fields in
142 * AVFilmGrainParams (see below)
143 */
144
145 /**
146 * Specifies the bit depth used for the luma component.
147 *
148 * @deprecated use AVFilmGrainParams.bit_depth_luma.
149 */
150 attribute_deprecated
142 int bit_depth_luma;151 int bit_depth_luma;
143 152
144 /**153 /**
145 * Specifies the bit depth used for the chroma components.154 * Specifies the bit depth used for the chroma components.
155 *
156 * @deprecated use AVFilmGrainParams.bit_depth_chroma.
146 */157 */
158 attribute_deprecated
147 int bit_depth_chroma;159 int bit_depth_chroma;
148 160
161 /**
162 * Specifies the video signal characteristics.
163 *
164 * @deprecated use AVFilmGrainParams.color_{range,primaries,trc,space}.
165 */
166 attribute_deprecated
149 enum AVColorRange color_range;167 enum AVColorRange color_range;
168 attribute_deprecated
150 enum AVColorPrimaries color_primaries;169 enum AVColorPrimaries color_primaries;
170 attribute_deprecated
151 enum AVColorTransferCharacteristic color_trc;171 enum AVColorTransferCharacteristic color_trc;
172 attribute_deprecated
152 enum AVColorSpace color_space;173 enum AVColorSpace color_space;
174#endif
153 175
154 /**176 /**
155 * Specifies the blending mode used to blend the simulated film grain177 * Specifies the blending mode used to blend the simulated film grain
@@ -231,11 +253,40 @@ typedef struct AVFilmGrainParams { · 75 unmodified lines
231 * Additional fields may be added both here and in any structure included.253 * Additional fields may be added both here and in any structure included.
232 * If a codec's film grain structure differs slightly over another254 * If a codec's film grain structure differs slightly over another
233 * codec's, fields within may change meaning depending on the type.255 * codec's, fields within may change meaning depending on the type.
256 *
257 * TODO: Move this to the end of the structure, at the next ABI bump.
234 */258 */
235 union {259 union {
236 AVFilmGrainAOMParams aom;260 AVFilmGrainAOMParams aom;
237 AVFilmGrainH274Params h274;261 AVFilmGrainH274Params h274;
238 } codec;262 } codec;
263
264 /**
265 * Intended display resolution. May be 0 if the codec does not specify
266 * any restrictions.
267 */
268
269 int width, height;
270
271 /**
272 * Intended subsampling ratio, or 0 for luma-only streams.
273 */
274 int subsampling_x, subsampling_y;
275
276 /**
277 * Intended video signal characteristics.
278 */
279 enum AVColorRange color_range;
280 enum AVColorPrimaries color_primaries;
281 enum AVColorTransferCharacteristic color_trc;
282 enum AVColorSpace color_space;
283
284 /**
285 * Intended bit depth, or 0 for unknown/unspecified.
286 */
287 int bit_depth_luma;
288 int bit_depth_chroma;
289
239} AVFilmGrainParams;290} AVFilmGrainParams;
240 291
241/**292/**
libavutil/version.h+2−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5981#define LIBAVUTIL_VERSION_MAJOR 59
82#define LIBAVUTIL_VERSION_MINOR 482#define LIBAVUTIL_VERSION_MINOR 5
83#define LIBAVUTIL_VERSION_MICRO 10083#define LIBAVUTIL_VERSION_MICRO 100
84 84
85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -111,6 +111,7 @@ · 25 unmodified lines
111#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 60)111#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 60)
112#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60)112#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60)
113#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)113#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)
114#define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60)
114 115
115/**116/**
116 * @}117 * @}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t