History

avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots

The NLQ pivots are not documented but should be present in the header for profile 7 RPU format. It has been verified using Dolby's verification toolkit.

quietvoid committed 4 years ago

Commit 78076ed1 parent 591e27d4 files · +13 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/dovi_rpu.c +8 −1
  3. libavutil/dovi_meta.h +1 −0
  4. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line
22
33 API changes, most recent first:
44
5+2024-04-xx - xxxxxxxxxx - lavu 59.11.100 - dovi_meta.h
6+ Add AVDOVIDataMapping.nlq_pivots.
7+
58 2024-03-29 - xxxxxxxxxx - lavf 61.3.100 - avformat.h
69 Add AVFormatContext.duration_probesize.
710
libavcodec/dovi_rpu.c+8−1
@@ -110,7 +110,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) · 109 unmodified lines
110110 /* Copy only the parts of these structs known to us at compiler-time. */
111111 #define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last))
112112 COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag);
113− COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq[2].linear_deadzone_threshold);
113+ COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots);
114114 COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal);
115115 return 0;
116116 }
@@ -347,7 +347,14 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size) · 230 unmodified lines
347347 }
348348
349349 if (use_nlq) {
350+ int nlq_pivot = 0;
350351 vdr->mapping.nlq_method_idc = get_bits(gb, 3);
352+
353+ for (int i = 0; i < 2; i++) {
354+ nlq_pivot += get_bits(gb, hdr->bl_bit_depth);
355+ vdr->mapping.nlq_pivots[i] = av_clip_uint16(nlq_pivot);
356+ }
357+
351358 /**
352359 * The patent mentions another legal value, NLQ_MU_LAW, but it's
353360 * not documented anywhere how to parse or apply that type of NLQ.
libavutil/dovi_meta.h+1−0
@@ -147,6 +147,7 @@ typedef struct AVDOVIDataMapping { · 146 unmodified lines
147147 uint32_t num_x_partitions;
148148 uint32_t num_y_partitions;
149149 AVDOVINLQParams nlq[3]; /* per component */
150+ uint16_t nlq_pivots[2];
150151 } AVDOVIDataMapping;
151152
152153 /**
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 59
82−#define LIBAVUTIL_VERSION_MINOR 10
82+#define LIBAVUTIL_VERSION_MINOR 11
8383 #define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

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