| @@ -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's | 359 | * 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. |