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

Showing the changes to libavcodec (1 of 4 files). Show all

Unified · Split

libavcodec/dovi_rpu.c+8−1
@@ -110,7 +110,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) · 109 unmodified lines
110 /* Copy only the parts of these structs known to us at compiler-time. */110 /* Copy only the parts of these structs known to us at compiler-time. */
111#define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last))111#define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last))
112 COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag);112 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);
114 COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal);114 COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal);
115 return 0;115 return 0;
116}116}
@@ -347,7 +347,14 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size) · 230 unmodified lines
347 }347 }
348 348
349 if (use_nlq) {349 if (use_nlq) {
350 int nlq_pivot = 0;
350 vdr->mapping.nlq_method_idc = get_bits(gb, 3);351 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
351 /**358 /**
352 * The patent mentions another legal value, NLQ_MU_LAW, but it's359 * The patent mentions another legal value, NLQ_MU_LAW, but it's
353 * not documented anywhere how to parse or apply that type of NLQ.360 * not documented anywhere how to parse or apply that type of NLQ.

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